summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>2004-10-22 23:16:45 +0000
committerMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>2004-10-22 23:16:45 +0000
commit0599b6f7bec334d775a04ee348ae7be66cc289d8 (patch)
treea7e85538f45f545ab74f763f83fc5e5c5b3aecf5
parentd4bbb29088161bbb35d3198f526805471b24afef (diff)
downloadbitbake-contrib-0599b6f7bec334d775a04ee348ae7be66cc289d8.tar.gz
Auto merged
-rw-r--r--bin/oe/fetch.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/bin/oe/fetch.py b/bin/oe/fetch.py
index ae13f2ed7..7b3f42b0f 100644
--- a/bin/oe/fetch.py
+++ b/bin/oe/fetch.py
@@ -378,33 +378,38 @@ class Cvs(Fetch):
oe.data.setVar('CVSCOOPTS', " ".join(options), localdata)
oe.data.setVar('CVSMODULE', module, localdata)
cvscmd = oe.data.getVar('FETCHCOMMAND', localdata, 1)
+ cvsupdatecmd = oe.data.getVar('UPDATECOMMAND', localdata, 1)
if cvs_rsh:
cvscmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvscmd)
-# create temp directory
- oe.debug(2, "Fetch: creating temporary directory")
- oe.mkdirhier(oe.data.expand('${WORKDIR}', localdata))
- oe.data.setVar('TMPBASE', oe.data.expand('${WORKDIR}/oecvs.XXXXXX', localdata), localdata)
- tmppipe = os.popen(oe.data.getVar('MKTEMPDIRCMD', localdata, 1) or "false")
- tmpfile = tmppipe.readline().strip()
- if not tmpfile:
- oe.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.")
- raise FetchError(module)
+# create module directory
+ oe.debug(2, "Fetch: checking for module directory")
+ pkg=oe.data.expand('${PN}', d)
+ pkgdir=os.path.join(oe.data.expand('${CVSDIR}', localdata), pkg)
+ moddir=os.path.join(pkgdir,module)
+ if os.access(os.path.join(moddir,'CVS'), os.R_OK):
+ oe.note("Update " + loc)
+# update sources there
+ os.chdir(moddir)
+ myret = os.system(cvsupdatecmd)
+ else:
+ oe.note("Fetch " + loc)
+# check out sources there
+ oe.mkdirhier(pkgdir)
+ os.chdir(pkgdir)
+ oe.debug(1, "Running %s" % cvscmd)
+ myret = os.system(cvscmd)
-# check out sources there
- os.chdir(tmpfile)
- oe.note("Fetch " + loc)
- oe.debug(1, "Running %s" % cvscmd)
- myret = os.system(cvscmd)
if myret != 0:
try:
- os.rmdir(tmpfile)
+ os.rmdir(moddir)
except OSError:
pass
raise FetchError(module)
- os.chdir(os.path.join(tmpfile, os.path.dirname(module)))
+ os.chdir(moddir)
+ os.chdir('..')
# tar them up to a defined filename
myret = os.system("tar -czf %s %s" % (os.path.join(dldir,tarfn), localdir))
if myret != 0:
@@ -412,8 +417,6 @@ class Cvs(Fetch):
os.unlink(tarfn)
except OSError:
pass
-# cleanup
- os.system('rm -rf %s' % tmpfile)
os.chdir(olddir)
del localdata