summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorYu Ke <ke.yu@intel.com>2011-01-18 23:35:30 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-25 12:25:47 +0000
commitef918a72de97fd2189e1c8487e371d13e18088fd (patch)
treef19cd59514794dc42bbcc0e459e681cecd101770 /bitbake/lib/bb/fetch2/git.py
parente2ac26e7b1a1d058915d489cf3e0985484e1f69e (diff)
downloadpoky-ef918a72de97fd2189e1c8487e371d13e18088fd.tar.gz
git.py: split download to download() and build_mirror_data()
the download is to fetch the source from URL, the build_mirror_data is to create the mirror tar ball. the original go() method mix them together, it is more clean to split them. Signed-off-by: Yu Ke <ke.yu@intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index c962acb106..d47191e57f 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -116,9 +116,6 @@ class Git(Fetch):
116 116
117 repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball) 117 repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball)
118 118
119 coname = '%s' % (ud.tag)
120 codir = os.path.join(ud.clonedir, coname)
121
122 # If we have no existing clone and no mirror tarball, try and obtain one 119 # If we have no existing clone and no mirror tarball, try and obtain one
123 if not os.path.exists(ud.clonedir) and not os.path.exists(repofile): 120 if not os.path.exists(ud.clonedir) and not os.path.exists(repofile):
124 try: 121 try:
@@ -149,7 +146,12 @@ class Git(Fetch):
149 runfetchcmd("%s prune-packed" % ud.basecmd, d) 146 runfetchcmd("%s prune-packed" % ud.basecmd, d)
150 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) 147 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
151 148
149 def build_mirror_data(self, url, ud, d):
152 # Generate a mirror tarball if needed 150 # Generate a mirror tarball if needed
151 coname = '%s' % (ud.tag)
152 codir = os.path.join(ud.clonedir, coname)
153 repofile = os.path.join(data.getVar("DL_DIR", d, 1), ud.mirrortarball)
154
153 os.chdir(ud.clonedir) 155 os.chdir(ud.clonedir)
154 mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) 156 mirror_tarballs = data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True)
155 if mirror_tarballs != "0" or 'fullclone' in ud.parm: 157 if mirror_tarballs != "0" or 'fullclone' in ud.parm: