summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2008-05-01 11:42:24 +0000
committerRoss Burton <ross@openedhand.com>2008-05-01 11:42:24 +0000
commit06fd2b6aaf0392368c6937aa56525f1aa6e76141 (patch)
treec8e0a1a13b391a6e389f4e27db9efd0724100304 /meta
parent6697984ca28fbc2dfaa77dfe6ff593bbafd5e545 (diff)
downloadpoky-06fd2b6aaf0392368c6937aa56525f1aa6e76141.tar.gz
base.bbclass: only depend on shasum-native if we don't have hashlib
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4389 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/base.bbclass26
1 files changed, 22 insertions, 4 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 0c048b997b..d27f0d3c5d 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -91,10 +91,20 @@ def base_dep_prepend(d):
91 # the case where host == build == target, for now we don't work in 91 # the case where host == build == target, for now we don't work in
92 # that case though. 92 # that case though.
93 # 93 #
94 deps = "shasum-native "
95 if bb.data.getVar('PN', d, True) == "shasum-native":
96 deps = ""
97 94
95 deps = ""
96
97 # bb.utils.sha256_file() will return None on Python 2.4 because hashlib
98 # isn't present. In this case we use a shasum-native to checksum, so if
99 # hashlib isn't present then add shasum-native to the dependencies.
100 try:
101 import hashlib
102 except ImportError:
103 # Adding shasum-native as a dependency of shasum-native would be
104 # stupid, so don't do that.
105 if bb.data.getVar('PN', d, True) != "shasum-native":
106 deps = "shasum-native "
107
98 # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not 108 # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
99 # we need that built is the responsibility of the patch function / class, not 109 # we need that built is the responsibility of the patch function / class, not
100 # the application. 110 # the application.
@@ -484,7 +494,6 @@ python base_scenefunction () {
484 494
485addtask fetch 495addtask fetch
486do_fetch[dirs] = "${DL_DIR}" 496do_fetch[dirs] = "${DL_DIR}"
487do_fetch[depends] = "shasum-native:do_populate_staging"
488python base_do_fetch() { 497python base_do_fetch() {
489 import sys 498 import sys
490 499
@@ -969,6 +978,15 @@ def base_after_parse(d):
969 depends = depends + " git-native:do_populate_staging" 978 depends = depends + " git-native:do_populate_staging"
970 bb.data.setVarFlag('do_fetch', 'depends', depends, d) 979 bb.data.setVarFlag('do_fetch', 'depends', depends, d)
971 980
981 # bb.utils.sha256_file() will fail if hashlib isn't present, so we fallback
982 # on shasum-native. We need to ensure that it is staged before we fetch.
983 try:
984 import hashlib
985 except ImportError:
986 depends = bb.data.getVarFlag('do_fetch', 'depends', d) or ""
987 depends = depends + " shasum-native:do_populate_staging"
988 bb.data.setVarFlag('do_fetch', 'depends', depends, d)
989
972 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1) 990 mach_arch = bb.data.getVar('MACHINE_ARCH', d, 1)
973 old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1) 991 old_arch = bb.data.getVar('PACKAGE_ARCH', d, 1)
974 if (old_arch == mach_arch): 992 if (old_arch == mach_arch):