summaryrefslogtreecommitdiff
path: root/pactest/pmtest.py
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-03-05 18:06:12 +0000
committerAaron Griffin <aaron@archlinux.org>2007-03-05 18:06:12 +0000
commit2caadb33bf60167401f7dd316e704bc42e32a1a9 (patch)
treed7c349246b591073b91a5b6635503cfafda3bd52 /pactest/pmtest.py
parent714a414e72591f3273583cb4970e1515c94e5887 (diff)
downloadpacman-2caadb33bf60167401f7dd316e704bc42e32a1a9.tar.xz
* Fixed an issue with globbing the --test argument
* Added a custom 'mkdir' function which makes parents and doesn't fail on existence * Added output for 'SKIP' messages (it did not indicate WHY it was skipped) * Added the ability to generate DB packages in the sync dir (not the cache dir) for testing downloading. (self.cachepkgs = False) * Added pmtest.path for the full path to the package file
Diffstat (limited to 'pactest/pmtest.py')
-rwxr-xr-xpactest/pmtest.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/pactest/pmtest.py b/pactest/pmtest.py
index 0b21ba40..06b65bbb 100755
--- a/pactest/pmtest.py
+++ b/pactest/pmtest.py
@@ -38,6 +38,7 @@ class pmtest:
self.name = name
self.testname = os.path.basename(name).replace('.py', '')
self.root = root
+ self.cachepkgs = True
def __str__(self):
return "name = %s\n" \
@@ -130,14 +131,15 @@ class pmtest:
vprint("\t%s" % os.path.join(TMPDIR, pkg.filename()))
pkg.makepkg(tmpdir)
for key, value in self.db.iteritems():
- if key == "local":
- continue
+ if key == "local": continue
for pkg in value.pkgs:
- archive = pkg.filename()
- vprint("\t%s" % os.path.join(PM_CACHEDIR, archive))
- pkg.makepkg(cachedir)
- pkg.md5sum = getmd5sum(os.path.join(cachedir, archive))
- pkg.csize = os.stat(os.path.join(cachedir, archive))[stat.ST_SIZE]
+ vprint("\t%s" % os.path.join(PM_CACHEDIR, pkg.filename()))
+ if self.cachepkgs:
+ pkg.makepkg(cachedir)
+ else:
+ pkg.makepkg(os.path.join(syncdir, value.treename))
+ pkg.md5sum = getmd5sum(pkg.path)
+ pkg.csize = os.stat(pkg.path)[stat.ST_SIZE]
# Populating databases
vprint(" Populating databases")
@@ -151,8 +153,7 @@ class pmtest:
# Creating sync database archives
vprint(" Creating sync database archives")
for key, value in self.db.iteritems():
- if key == "local":
- continue
+ if key == "local": continue
archive = value.treename + PM_EXT_DB
vprint("\t" + os.path.join(SYNCREPO, archive))
value.gensync(os.path.join(syncdir, value.treename))