diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-02 12:48:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-02 17:11:41 +0000 |
commit | 05048e0f9168ceb7d66f6ac79dcae42f1e696826 (patch) | |
tree | 86d533135cd77ddda82856cab709c92e71c8e711 /bitbake/lib/bb/fetch2 | |
parent | 3a3fc6b071f09970e7f79fb4f1a8f0013917371e (diff) | |
download | poky-05048e0f9168ceb7d66f6ac79dcae42f1e696826.tar.gz |
bitbake/fetch2/git: Add nocheckout option to disable checkouts and always add scm data to checkouts
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0a1818f825..6e078a1f7f 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -53,6 +53,10 @@ class Git(Fetch): | |||
53 | else: | 53 | else: |
54 | ud.proto = "rsync" | 54 | ud.proto = "rsync" |
55 | 55 | ||
56 | ud.nocheckout = False | ||
57 | if 'nocheckout' in ud.parm: | ||
58 | ud.nocheckout = True | ||
59 | |||
56 | ud.branch = ud.parm.get("branch", "master") | 60 | ud.branch = ud.parm.get("branch", "master") |
57 | 61 | ||
58 | gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) | 62 | gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) |
@@ -207,16 +211,15 @@ class Git(Fetch): | |||
207 | if os.path.exists(destdir): | 211 | if os.path.exists(destdir): |
208 | bb.utils.prunedir(destdir) | 212 | bb.utils.prunedir(destdir) |
209 | 213 | ||
210 | if 'fullclone' in ud.parm: | 214 | runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) |
211 | runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) | 215 | if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir): |
212 | if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir): | 216 | runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d) |
213 | runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d) | 217 | if os.path.exists("%s/.git/packed-refs" % ud.clonedir): |
214 | if os.path.exists("%s/.git/packed-refs" % ud.clonedir): | 218 | runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d) |
215 | runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d) | 219 | if not ud.nocheckout: |
216 | else: | 220 | os.chdir(destdir) |
217 | os.chdir(ud.clonedir) | ||
218 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d) | 221 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d) |
219 | runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, destdir), d) | 222 | runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) |
220 | return True | 223 | return True |
221 | 224 | ||
222 | def supports_srcrev(self): | 225 | def supports_srcrev(self): |