summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2011-02-05 14:11:25 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:36:54 +0000
commit6130729c49cc7500102ec22817e039bc982234bc (patch)
treee116c0e94de786b77589d912bad640095f5aded0 /lib/bb/fetch2
parent23a74be8c3d4b685cda8bb96317e866160a0e104 (diff)
downloadbitbake-6130729c49cc7500102ec22817e039bc982234bc.tar.gz
fetch2/git.py: Fix problem when fetching with no origin
When updating a git repo, its possible to not have an origin, so fail gracefully with a debug message. (From Poky rev: 192f631129e25b959d501c46c3156b7037b49c22) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/git.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index ec20d262a..ba8126f00 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -127,8 +127,12 @@ class Git(Fetch):
needupdate = True
if needupdate:
bb.fetch2.check_network_access(d, "git fetch %s%s" % (ud.host, ud.path))
- runfetchcmd("%s remote prune origin" % ud.basecmd, d)
- runfetchcmd("%s remote rm origin" % ud.basecmd, d)
+ try:
+ runfetchcmd("%s remote prune origin" % ud.basecmd, d)
+ runfetchcmd("%s remote rm origin" % ud.basecmd, d)
+ except bb.fetch2.FetchError:
+ logger.debug(1, "No Origin")
+
runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
runfetchcmd("%s fetch --all -t" % ud.basecmd, d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)