]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: upgrade: fetch remote repository before checking out new revision
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 22 Nov 2015 21:07:57 +0000 (10:07 +1300)
committerRobert Yang <liezhi.yang@windriver.com>
Mon, 28 Dec 2015 07:03:15 +0000 (23:03 -0800)
If we're upgrading a recipe that fetches from git, and we've simply
fetched a tarball of the repo instead of directly from the upstream repo
(this can happen if you have PREMIRRORS set up as in poky with a core recipe,
e.g. kernelshark) then we won't have any new revisions, and the checkout
will fail with "fatal: reference is not a tree: <hash>". To avoid this,
do a "git fetch" before checking out the new revision.

(From OE-Core master rev: c4daebf3fe797a8063dcbc2ab229be2fbedc8134)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/upgrade.py

index f033fc8010a159ba1227f44b99fb08bec53eb24b..6bac44bb5c1fe14e0ee957e97a3913030ef3f699 100644 (file)
@@ -199,6 +199,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
     if srcrev:
         rev = srcrev
     if uri.startswith('git://'):
+        __run('git fetch')
         __run('git checkout %s' % rev)
         __run('git tag -f devtool-base-new')
         md5 = None