summaryrefslogtreecommitdiff
path: root/test/pacman
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-03 18:32:43 -0600
committerDan McGee <dan@archlinux.org>2011-01-10 10:51:35 -0600
commita9cbd15260b396c38b7d5ffe5669994e65f9a86f (patch)
tree44e0bb36dff83d35e63bdc71899188b15c56b008 /test/pacman
parent3e1bdfa93c0c0c1a966ba24f8013754a8a87f0ec (diff)
pactest: correctly write epoch and force as necessary
We were missing this in a few places; also add the ability to check the outcome via a new rule type. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test/pacman')
-rwxr-xr-xtest/pacman/pmdb.py2
-rwxr-xr-xtest/pacman/pmpkg.py4
-rwxr-xr-xtest/pacman/pmrule.py3
3 files changed, 9 insertions, 0 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index c2753370..60460ce2 100755
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -252,6 +252,8 @@ class pmdb:
data.append(_mksection("SIZE", pkg.size))
if pkg.reason:
data.append(_mksection("REASON", pkg.reason))
+ if pkg.epoch:
+ data.append(_mksection("EPOCH", pkg.epoch))
else:
data.append(_mksection("FILENAME", pkg.filename()))
if pkg.replaces:
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index e0f3baab..3aabea49 100755
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -132,6 +132,10 @@ class pmpkg:
data.append("builddate = %s" % self.builddate)
data.append("packager = %s" % self.packager)
data.append("size = %s" % self.size)
+ if self.force:
+ data.append("force = true")
+ if self.epoch:
+ data.append("epoch = %d" % self.epoch)
if self.arch:
data.append("arch = %s" % self.arch)
for i in self.license:
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py
index 89ae3f49..bea8e4a4 100755
--- a/test/pacman/pmrule.py
+++ b/test/pacman/pmrule.py
@@ -78,6 +78,9 @@ class pmrule:
elif case == "VERSION":
if value != newpkg.version:
success = 0
+ elif case == "EPOCH":
+ if int(value) != newpkg.epoch:
+ success = 0
elif case == "DESC":
if value != newpkg.desc:
success = 0