index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2010-10-26 21:16:52 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-01-22 11:14:42 -0600 |
commit | 0de314205f9925c073566de109464b46737b0527 (patch) | |
tree | 369ea09d137ffb1f10f021142f3878a1065dbbb2 | |
parent | 36ea02cc482f14b787f1c7c4999fc347d77be7e5 (diff) |
-rwxr-xr-x | test/pacman/pmfile.py | 24 |
diff --git a/test/pacman/pmfile.py b/test/pacman/pmfile.py index ab4aa2c7..ffa4aa7e 100755 --- a/test/pacman/pmfile.py +++ b/test/pacman/pmfile.py @@ -18,8 +18,7 @@ import os -from util import * - +import util class pmfile: """File object @@ -30,8 +29,8 @@ class pmfile: self.root = root filename = os.path.join(self.root, self.name) - self.checksum = getmd5sum(filename) - self.mtime = getmtime(filename) + self.checksum = util.getmd5sum(filename) + self.mtime = util.getmtime(filename) def __str__(self): return "%s (%s / %lu)" % (self.name, self.checksum, self.mtime) @@ -43,12 +42,12 @@ class pmfile: retval = 0 filename = os.path.join(self.root, self.name) - checksum = getmd5sum(filename) - mtime = getmtime(filename) + checksum = util.getmd5sum(filename) + mtime = util.getmtime(filename) - vprint("\tismodified(%s)" % self.name) - vprint("\t\told: %s / %s" % (self.checksum, self.mtime)) - vprint("\t\tnew: %s / %s" % (checksum, mtime)) + util.vprint("\tismodified(%s)" % self.name) + util.vprint("\t\told: %s / %s" % (self.checksum, self.mtime)) + util.vprint("\t\tnew: %s / %s" % (checksum, mtime)) if self.checksum != checksum \ or (self.mtime[1], self.mtime[2]) != (mtime[1], mtime[2]): @@ -62,10 +61,7 @@ class pmfile: filename = os.path.join(self.root, self.name) os.utime(filename, (355, 355)) - self.mtime = getmtime(filename) - vprint("\tmtime reset (%s)" % self.name) + self.mtime = util.getmtime(filename) + util.vprint("\tmtime reset (%s)" % self.name) -if __name__ == "__main__": - f = pmfile("/tmp", "foobar") - print f # vim: set ts=4 sw=4 et: |