summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/patch.py8
-rw-r--r--meta/lib/oe/reproducible.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py12
3 files changed, 13 insertions, 9 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 60a0cc8291..58c6e34fe8 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -882,7 +882,7 @@ class UserResolver(Resolver):
882 os.chdir(olddir) 882 os.chdir(olddir)
883 883
884 884
885def patch_path(url, fetch, workdir, expand=True): 885def patch_path(url, fetch, unpackdir, expand=True):
886 """Return the local path of a patch, or return nothing if this isn't a patch""" 886 """Return the local path of a patch, or return nothing if this isn't a patch"""
887 887
888 local = fetch.localpath(url) 888 local = fetch.localpath(url)
@@ -891,7 +891,7 @@ def patch_path(url, fetch, workdir, expand=True):
891 base, ext = os.path.splitext(os.path.basename(local)) 891 base, ext = os.path.splitext(os.path.basename(local))
892 if ext in ('.gz', '.bz2', '.xz', '.Z'): 892 if ext in ('.gz', '.bz2', '.xz', '.Z'):
893 if expand: 893 if expand:
894 local = os.path.join(workdir, base) 894 local = os.path.join(unpackdir, base)
895 ext = os.path.splitext(base)[1] 895 ext = os.path.splitext(base)[1]
896 896
897 urldata = fetch.ud[url] 897 urldata = fetch.ud[url]
@@ -905,12 +905,12 @@ def patch_path(url, fetch, workdir, expand=True):
905 return local 905 return local
906 906
907def src_patches(d, all=False, expand=True): 907def src_patches(d, all=False, expand=True):
908 workdir = d.getVar('WORKDIR') 908 unpackdir = d.getVar('UNPACKDIR')
909 fetch = bb.fetch2.Fetch([], d) 909 fetch = bb.fetch2.Fetch([], d)
910 patches = [] 910 patches = []
911 sources = [] 911 sources = []
912 for url in fetch.urls: 912 for url in fetch.urls:
913 local = patch_path(url, fetch, workdir, expand) 913 local = patch_path(url, fetch, unpackdir, expand)
914 if not local: 914 if not local:
915 if all: 915 if all:
916 local = fetch.localpath(url) 916 local = fetch.localpath(url)
diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py
index 448befce33..a9f717159e 100644
--- a/meta/lib/oe/reproducible.py
+++ b/meta/lib/oe/reproducible.py
@@ -120,7 +120,7 @@ def get_source_date_epoch_from_git(d, sourcedir):
120 return int(p.stdout.decode('utf-8')) 120 return int(p.stdout.decode('utf-8'))
121 121
122def get_source_date_epoch_from_youngest_file(d, sourcedir): 122def get_source_date_epoch_from_youngest_file(d, sourcedir):
123 if sourcedir == d.getVar('WORKDIR'): 123 if sourcedir == d.getVar('UNPACKDIR'):
124 # These sources are almost certainly not from a tarball 124 # These sources are almost certainly not from a tarball
125 return None 125 return None
126 126
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 51949e3c93..c8f9534e41 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -286,10 +286,13 @@ class DevtoolTestCase(OESelftestTestCase):
286 else: 286 else:
287 self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') 287 self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
288 288
289 def _test_devtool_add_git_url(self, git_url, version, pn, resulting_src_uri): 289 def _test_devtool_add_git_url(self, git_url, version, pn, resulting_src_uri, srcrev=None):
290 self.track_for_cleanup(self.workspacedir) 290 self.track_for_cleanup(self.workspacedir)
291 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 291 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
292 result = runCmd('devtool add --version %s %s %s' % (version, pn, git_url)) 292 command = 'devtool add --version %s %s %s' % (version, pn, git_url)
293 if srcrev :
294 command += ' --srcrev %s' %srcrev
295 result = runCmd(command)
293 self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') 296 self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
294 # Check the recipe name is correct 297 # Check the recipe name is correct
295 recipefile = get_bb_var('FILE', pn) 298 recipefile = get_bb_var('FILE', pn)
@@ -479,11 +482,12 @@ class DevtoolAddTests(DevtoolBase):
479 482
480 def test_devtool_add_git_style2(self): 483 def test_devtool_add_git_style2(self):
481 version = 'v3.1.0' 484 version = 'v3.1.0'
485 srcrev = 'v3.1.0'
482 pn = 'mbedtls' 486 pn = 'mbedtls'
483 # this will trigger reformat_git_uri with branch parameter in url 487 # this will trigger reformat_git_uri with branch parameter in url
484 git_url = "'git://git@github.com/ARMmbed/mbedtls.git;protocol=https'" 488 git_url = "'git://git@github.com/ARMmbed/mbedtls.git;protocol=https'"
485 resulting_src_uri = "gitsm://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master" 489 resulting_src_uri = "git://git@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master"
486 self._test_devtool_add_git_url(git_url, version, pn, resulting_src_uri) 490 self._test_devtool_add_git_url(git_url, version, pn, resulting_src_uri, srcrev)
487 491
488 def test_devtool_add_library(self): 492 def test_devtool_add_library(self):
489 # Fetch source 493 # Fetch source