From aea9acb329d715db851c1bed8506c3d0f9b42ae1 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Jul 2009 11:27:31 -0700 Subject: Let the distro control whether we include hostap or madwifi. - Add base_ifelse convenience function to base.bbclass. - Replace all conditionals in the recipes relating to hostap and madwifi to look for their name in COMBINED_FEATURES rather than looking for specific buses (pci, pcmcia). - Change the default COMBINED_FEATURES to enable: - madwifi, when: - distro has pci, wifi, and madwifi in its features - machine has pci in its features - hostap, when: - 'wifi' and 'hostap' are in distro features - either 'pci' or 'pcmcia' are in both distro and machine features Signed-off-by: Chris Larson --- classes/base.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 51648dae92..aed927404a 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -159,6 +159,12 @@ def base_read_file(filename): return f.read().strip() return None +def base_ifelse(condition, iftrue = True, iffalse = False): + if condition: + return iftrue + else: + return iffalse + def base_conditional(variable, checkvalue, truevalue, falsevalue, d): import bb if bb.data.getVar(variable,d,1) == checkvalue: -- cgit v1.2.3 From ac729cee6058e9e601af4869874213ccd129c732 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Tue, 7 Jul 2009 15:19:07 -0700 Subject: base.bbclass: catch bb.MalformedUrl in do_fetch. Signed-off-by: Chris Larson --- classes/base.bbclass | 3 +++ 1 file changed, 3 insertions(+) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index aed927404a..598a7bb77f 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -620,6 +620,9 @@ python base_do_fetch() { except bb.fetch.NoMethodError: (type, value, traceback) = sys.exc_info() raise bb.build.FuncFailed("No method: %s" % value) + except bb.MalformedUrl: + (type, value, traceback) = sys.exc_info() + raise bb.build.FuncFailed("Malformed URL: %s" % value) try: bb.fetch.go(localdata) -- cgit v1.2.3