summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-05-30 10:21:02 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-01 12:38:41 +0100
commit49557a5e9d93665e2409e4b12850dc325dee19dd (patch)
treeeff75c2751073587d22bb1dcf2aaac6b2d587880 /meta/lib/oeqa/selftest/devtool.py
parent0a7c699b3337806c63b745bf1e9736d296b8e42f (diff)
downloadpoky-49557a5e9d93665e2409e4b12850dc325dee19dd.tar.gz
recipetool / devtool: set a fixed SRCREV by default when fetching from git
If fetching source from a git repository, typically within OpenEmbedded we encourage setting SRCREV to a fixed revision, so change to do that by default and add a -a/--autorev option to use "${AUTOREV}" instead. (From OE-Core rev: 000480c42797dd2f03ebc3bc6d1dabfc6a7b75f5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 132a73d0ec..b64f9b3e76 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -207,12 +207,14 @@ class DevtoolTests(DevtoolBase):
207 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 207 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
208 self.track_for_cleanup(tempdir) 208 self.track_for_cleanup(tempdir)
209 pn = 'dbus-wait' 209 pn = 'dbus-wait'
210 srcrev = '6cc6077a36fe2648a5f993fe7c16c9632f946517'
210 # We choose an https:// git URL here to check rewriting the URL works 211 # We choose an https:// git URL here to check rewriting the URL works
211 url = 'https://git.yoctoproject.org/git/dbus-wait' 212 url = 'https://git.yoctoproject.org/git/dbus-wait'
212 # Force fetching to "noname" subdir so we verify we're picking up the name from autoconf 213 # Force fetching to "noname" subdir so we verify we're picking up the name from autoconf
213 # instead of the directory name 214 # instead of the directory name
214 result = runCmd('git clone %s noname' % url, cwd=tempdir) 215 result = runCmd('git clone %s noname' % url, cwd=tempdir)
215 srcdir = os.path.join(tempdir, 'noname') 216 srcdir = os.path.join(tempdir, 'noname')
217 result = runCmd('git reset --hard %s' % srcrev, cwd=srcdir)
216 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure script in source directory') 218 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure script in source directory')
217 # Test devtool add 219 # Test devtool add
218 self.track_for_cleanup(self.workspacedir) 220 self.track_for_cleanup(self.workspacedir)
@@ -235,7 +237,7 @@ class DevtoolTests(DevtoolBase):
235 checkvars['S'] = '${WORKDIR}/git' 237 checkvars['S'] = '${WORKDIR}/git'
236 checkvars['PV'] = '0.1+git${SRCPV}' 238 checkvars['PV'] = '0.1+git${SRCPV}'
237 checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https' 239 checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https'
238 checkvars['SRCREV'] = '${AUTOREV}' 240 checkvars['SRCREV'] = srcrev
239 checkvars['DEPENDS'] = set(['dbus']) 241 checkvars['DEPENDS'] = set(['dbus'])
240 self._test_recipe_contents(recipefile, checkvars, []) 242 self._test_recipe_contents(recipefile, checkvars, [])
241 243
@@ -345,7 +347,7 @@ class DevtoolTests(DevtoolBase):
345 self.track_for_cleanup(self.workspacedir) 347 self.track_for_cleanup(self.workspacedir)
346 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe) 348 self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
347 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') 349 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
348 result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url)) 350 result = runCmd('devtool add %s %s -a -f %s' % (testrecipe, srcdir, url))
349 self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output) 351 self.assertTrue(os.path.exists(os.path.join(self.workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output)
350 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory') 352 self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
351 # Test devtool status 353 # Test devtool status