summaryrefslogtreecommitdiff
path: root/poky/bitbake/lib/bb/fetch2/gitsm.py
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-05 22:28:33 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-04-05 22:31:28 +0300
commit193236933b0f4ab91b1625b64e2187e2db4e0e8f (patch)
treee12769d7c76d8b0517d6de3d3c72189753d253ed /poky/bitbake/lib/bb/fetch2/gitsm.py
parentbd93df9478f2f56ffcbc8cb88f1709c735dcd85b (diff)
downloadopenbmc-193236933b0f4ab91b1625b64e2187e2db4e0e8f.tar.xz
reset upstream subtrees to HEAD
Reset the following subtrees on HEAD: poky: 8217b477a1(master) meta-xilinx: 64aa3d35ae(master) meta-openembedded: 0435c9e193(master) meta-raspberrypi: 490a4441ac(master) meta-security: cb6d1c85ee(master) Squashed patches: meta-phosphor: drop systemd 239 patches meta-phosphor: mrw-api: use correct install path Change-Id: I268e2646d9174ad305630c6bbd3fbc1a6105f43d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/bitbake/lib/bb/fetch2/gitsm.py')
-rw-r--r--poky/bitbake/lib/bb/fetch2/gitsm.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/poky/bitbake/lib/bb/fetch2/gitsm.py b/poky/bitbake/lib/bb/fetch2/gitsm.py
index b21fed266..32389130b 100644
--- a/poky/bitbake/lib/bb/fetch2/gitsm.py
+++ b/poky/bitbake/lib/bb/fetch2/gitsm.py
@@ -147,6 +147,23 @@ class GitSM(Git):
return submodules != []
+ def need_update(self, ud, d):
+ if Git.need_update(self, ud, d):
+ return True
+
+ try:
+ # Check for the nugget dropped by the download operation
+ known_srcrevs = runfetchcmd("%s config --get-all bitbake.srcrev" % \
+ (ud.basecmd), d, workdir=ud.clonedir)
+
+ if ud.revisions[ud.names[0]] not in known_srcrevs.split():
+ return True
+ except bb.fetch2.FetchError:
+ # No srcrev nuggets, so this is new and needs to be updated
+ return True
+
+ return False
+
def download(self, ud, d):
def download_submodule(ud, url, module, modpath, d):
url += ";bareclone=1;nobranch=1"
@@ -157,6 +174,9 @@ class GitSM(Git):
try:
newfetch = Fetch([url], d, cache=False)
newfetch.download()
+ # Drop a nugget to add each of the srcrevs we've fetched (used by need_update)
+ runfetchcmd("%s config --add bitbake.srcrev %s" % \
+ (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=ud.clonedir)
except Exception as e:
logger.error('gitsm: submodule download failed: %s %s' % (type(e).__name__, str(e)))
raise