diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-03-16 08:07:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-06 15:42:03 +0100 |
commit | 88dbb0523cfdc46c8f7e4484ce57c3f46fd475a1 (patch) | |
tree | 6d713979334869df56ee14acdb39ca742b9d2798 /bitbake/lib/bb/fetch2 | |
parent | 628bd54d936650d03ba2ffd0a08aade2f84529b1 (diff) | |
download | poky-88dbb0523cfdc46c8f7e4484ce57c3f46fd475a1.tar.gz |
Initial work on getting bitbake working under pypy
- use os.chmod, not os.fchmod, as the latter is missing under pypy
- rearrange our imports a bit
- don't die if sqlite3 is missing shared cache support
(Bitbake rev: f229824dc9c453adf6067500e2bf6761536e4f2f)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 0bb90976e3..ca0197e220 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -28,10 +28,8 @@ from __future__ import absolute_import | |||
28 | from __future__ import print_function | 28 | from __future__ import print_function |
29 | import os, re | 29 | import os, re |
30 | import logging | 30 | import logging |
31 | import bb | 31 | import bb.data, bb.persist_data, bb.utils |
32 | from bb import data | 32 | from bb import data |
33 | from bb import persist_data | ||
34 | from bb import utils | ||
35 | 33 | ||
36 | __version__ = "2" | 34 | __version__ = "2" |
37 | 35 | ||
@@ -352,7 +350,7 @@ def get_srcrev(d): | |||
352 | 350 | ||
353 | def localpath(url, d): | 351 | def localpath(url, d): |
354 | fetcher = bb.fetch2.Fetch([url], d) | 352 | fetcher = bb.fetch2.Fetch([url], d) |
355 | return fetcher.localpath(url) | 353 | return fetcher.localpath(url) |
356 | 354 | ||
357 | def runfetchcmd(cmd, d, quiet = False, cleanup = []): | 355 | def runfetchcmd(cmd, d, quiet = False, cleanup = []): |
358 | """ | 356 | """ |
@@ -372,7 +370,7 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []): | |||
372 | 'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME'] | 370 | 'SSH_AUTH_SOCK', 'SSH_AGENT_PID', 'HOME'] |
373 | 371 | ||
374 | for var in exportvars: | 372 | for var in exportvars: |
375 | val = data.getVar(var, d, True) | 373 | val = bb.data.getVar(var, d, True) |
376 | if val: | 374 | if val: |
377 | cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) | 375 | cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd) |
378 | 376 | ||
@@ -498,15 +496,15 @@ def srcrev_internal_helper(ud, d, name): | |||
498 | return ud.parm['tag'] | 496 | return ud.parm['tag'] |
499 | 497 | ||
500 | rev = None | 498 | rev = None |
501 | pn = data.getVar("PN", d, True) | 499 | pn = bb.data.getVar("PN", d, True) |
502 | if name != '': | 500 | if name != '': |
503 | rev = data.getVar("SRCREV_%s_pn-%s" % (name, pn), d, True) | 501 | rev = bb.data.getVar("SRCREV_%s_pn-%s" % (name, pn), d, True) |
504 | if not rev: | 502 | if not rev: |
505 | rev = data.getVar("SRCREV_%s" % name, d, True) | 503 | rev = bb.data.getVar("SRCREV_%s" % name, d, True) |
506 | if not rev: | 504 | if not rev: |
507 | rev = data.getVar("SRCREV_pn-%s" % pn, d, True) | 505 | rev = bb.data.getVar("SRCREV_pn-%s" % pn, d, True) |
508 | if not rev: | 506 | if not rev: |
509 | rev = data.getVar("SRCREV", d, True) | 507 | rev = bb.data.getVar("SRCREV", d, True) |
510 | if rev == "INVALID": | 508 | if rev == "INVALID": |
511 | raise FetchError("Please set SRCREV to a valid value", ud.url) | 509 | raise FetchError("Please set SRCREV to a valid value", ud.url) |
512 | if rev == "AUTOINC": | 510 | if rev == "AUTOINC": |
@@ -592,12 +590,12 @@ class FetchData(object): | |||
592 | if "srcdate" in self.parm: | 590 | if "srcdate" in self.parm: |
593 | return self.parm['srcdate'] | 591 | return self.parm['srcdate'] |
594 | 592 | ||
595 | pn = data.getVar("PN", d, True) | 593 | pn = bb.data.getVar("PN", d, True) |
596 | 594 | ||
597 | if pn: | 595 | if pn: |
598 | return data.getVar("SRCDATE_%s" % pn, d, True) or data.getVar("SRCDATE", d, True) or data.getVar("DATE", d, True) | 596 | return bb.data.getVar("SRCDATE_%s" % pn, d, True) or bb.data.getVar("SRCDATE", d, True) or bb.data.getVar("DATE", d, True) |
599 | 597 | ||
600 | return data.getVar("SRCDATE", d, True) or data.getVar("DATE", d, True) | 598 | return bb.data.getVar("SRCDATE", d, True) or bb.data.getVar("DATE", d, True) |
601 | 599 | ||
602 | class FetchMethod(object): | 600 | class FetchMethod(object): |
603 | """Base class for 'fetch'ing data""" | 601 | """Base class for 'fetch'ing data""" |
@@ -790,10 +788,10 @@ class FetchMethod(object): | |||
790 | 788 | ||
791 | localcount = None | 789 | localcount = None |
792 | if name != '': | 790 | if name != '': |
793 | pn = data.getVar("PN", d, True) | 791 | pn = bb.data.getVar("PN", d, True) |
794 | localcount = data.getVar("LOCALCOUNT_" + name, d, True) | 792 | localcount = bb.data.getVar("LOCALCOUNT_" + name, d, True) |
795 | if not localcount: | 793 | if not localcount: |
796 | localcount = data.getVar("LOCALCOUNT", d, True) | 794 | localcount = bb.data.getVar("LOCALCOUNT", d, True) |
797 | return localcount | 795 | return localcount |
798 | 796 | ||
799 | localcount_internal_helper = staticmethod(localcount_internal_helper) | 797 | localcount_internal_helper = staticmethod(localcount_internal_helper) |