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>
This commit is contained in:
Dan McGee 2011-01-03 18:32:43 -06:00
parent 3e1bdfa93c
commit a9cbd15260
3 changed files with 9 additions and 0 deletions

View File

@ -252,6 +252,8 @@ def db_write(self, pkg):
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:

View File

@ -132,6 +132,10 @@ def makepkg(self, path):
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:

View File

@ -78,6 +78,9 @@ def check(self, root, retcode, localdb, files):
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