Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2021-01-19 10:30:08 -0800
committerAllan McRae <allan@archlinux.org>2021-01-21 17:19:01 +1000
commitad84a572aac455dcd3de111dbf8d66c45b20573a (patch)
tree52f408fc198563b6ee67f52a9d72ffc17ef39c80 /test
parent743e041dbc22ed16a6f996b0caff6523ffecf136 (diff)
pmdb: add option to skip populating file:// server
Populating a file:// Server prevents any manually registered HTTP servers from ever being used. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmdb.py1
-rw-r--r--test/pacman/pmtest.py7
-rw-r--r--test/pacman/util.py9
3 files changed, 9 insertions, 8 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index 971e28eb..cae51b4e 100644
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -54,6 +54,7 @@ class pmdb(object):
self.root = root
self.pkgs = []
self.option = {}
+ self.syncdir = True
if self.treename == "local":
self.dbdir = os.path.join(root, util.PM_DBPATH, treename)
self.dbfile = None
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index ed6eab6a..8669f31d 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -167,10 +167,11 @@ class pmtest(object):
vprint("\t%s" % os.path.join(util.PM_CACHEDIR, pkg.filename()))
if self.cachepkgs:
pkg.makepkg(cachedir)
- else:
+ elif value.syncdir:
pkg.makepkg(os.path.join(syncdir, value.treename))
- pkg.md5sum = util.getmd5sum(pkg.path)
- pkg.csize = os.stat(pkg.path)[stat.ST_SIZE]
+ if pkg.path:
+ pkg.md5sum = util.getmd5sum(pkg.path)
+ pkg.csize = os.stat(pkg.path)[stat.ST_SIZE]
# Creating sync database archives
vprint(" Creating databases")
diff --git a/test/pacman/util.py b/test/pacman/util.py
index 1e0eb385..2957a020 100644
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -122,11 +122,10 @@ def mkcfgfile(filename, root, option, db):
for key in sorted(db.keys()):
if key != "local":
value = db[key]
- data.append("[%s]\n" \
- "SigLevel = %s\n" \
- "Server = file://%s" \
- % (value.treename, value.getverify(), \
- os.path.join(root, SYNCREPO, value.treename)))
+ data.append("[%s]\n" % (value.treename))
+ data.append("SigLevel = %s\n" % (value.getverify()))
+ if value.syncdir:
+ data.append("Server = file://%s" % (os.path.join(root, SYNCREPO, value.treename)))
for optkey, optval in value.option.items():
data.extend(["%s = %s" % (optkey, j) for j in optval])