diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-11-17 14:44:40 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:41 +0000 |
commit | 87b6f7d27ace9d6465414c28bbba003f368a49dd (patch) | |
tree | 8c53d7327b7dc8eec439cae5c69de5b36ba42ed3 /bitbake/lib/bb/fetch/osc.py | |
parent | d0d67a9fe279d26423494946666a5ca0acc5d66f (diff) | |
download | poky-87b6f7d27ace9d6465414c28bbba003f368a49dd.tar.gz |
fetch: add common helper _strip_leading_slashes()
Several fetcher need a way to strip leading slashes off a local path.
This helper-function consolidates all such occurances.
(Bitbake rev: 823a02185ed109054c6c1ae366221aaed0353f24)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/osc.py')
-rw-r--r-- | bitbake/lib/bb/fetch/osc.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch/osc.py b/bitbake/lib/bb/fetch/osc.py index 6fcb344ce0..a32d0b0a29 100644 --- a/bitbake/lib/bb/fetch/osc.py +++ b/bitbake/lib/bb/fetch/osc.py | |||
@@ -33,10 +33,7 @@ class Osc(Fetch): | |||
33 | ud.module = ud.parm["module"] | 33 | ud.module = ud.parm["module"] |
34 | 34 | ||
35 | # Create paths to osc checkouts | 35 | # Create paths to osc checkouts |
36 | relpath = ud.path | 36 | relpath = self._strip_leading_slashes(ud.path) |
37 | if relpath.startswith('/'): | ||
38 | # Remove leading slash as os.path.join can't cope | ||
39 | relpath = relpath[1:] | ||
40 | ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host) | 37 | ud.pkgdir = os.path.join(data.expand('${OSCDIR}', d), ud.host) |
41 | ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module) | 38 | ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module) |
42 | 39 | ||
@@ -73,10 +70,7 @@ class Osc(Fetch): | |||
73 | if ud.revision: | 70 | if ud.revision: |
74 | options.append("-r %s" % ud.revision) | 71 | options.append("-r %s" % ud.revision) |
75 | 72 | ||
76 | coroot = ud.path | 73 | coroot = self._strip_leading_slashes(ud.path) |
77 | if coroot.startswith('/'): | ||
78 | # Remove leading slash as os.path.join can't cope | ||
79 | coroot= coroot[1:] | ||
80 | 74 | ||
81 | if command is "fetch": | 75 | if command is "fetch": |
82 | osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options)) | 76 | osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options)) |