diff options
author | Dan McGee <dan@archlinux.org> | 2010-10-27 05:55:31 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-01-22 18:19:21 +0100 |
commit | 32727efc38bf5376a402c4c4149cc4148ba2068b (patch) | |
tree | ebbe400b78b4431ca197ee9c49541178ac4dc066 /test/pacman/pmdb.py | |
parent | 5699f2c94c39afec19810fc450b78dced86e7c5d (diff) | |
download | pacman-32727efc38bf5376a402c4c4149cc4148ba2068b.tar.gz pacman-32727efc38bf5376a402c4c4149cc4148ba2068b.tar.xz |
pactest: revamp modified logic
Remove all logic dealing with PKG_MODIFIED as this rule no longer exists.
This removes a bunch of unnecessary stat and checksum logic that most of the
time we were never even using. Also update the file modified checks to mark
every file created using mkfile() with an older time so any modified checks
will just work without hacks.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test/pacman/pmdb.py')
-rwxr-xr-x | test/pacman/pmdb.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index 22af989d..bb5aab92 100755 --- a/test/pacman/pmdb.py +++ b/test/pacman/pmdb.py @@ -161,8 +161,6 @@ class pmdb: elif line == "%PROVIDES%": pkg.provides = _getsection(fd) fd.close() - pkg.checksum["desc"] = util.getmd5sum(filename) - pkg.mtime["desc"] = util.getmtime(filename) # files filename = os.path.join(path, "files") @@ -183,14 +181,9 @@ class pmdb: if line == "%BACKUP%": pkg.backup = _getsection(fd) fd.close() - pkg.checksum["files"] = util.getmd5sum(filename) - pkg.mtime["files"] = util.getmtime(filename) # install filename = os.path.join(path, "install") - if os.path.isfile(filename): - pkg.checksum["install"] = util.getmd5sum(filename) - pkg.mtime["install"] = util.getmtime(filename) return pkg @@ -252,8 +245,6 @@ class pmdb: data.append("") filename = os.path.join(path, "desc") util.mkfile(filename, "\n".join(data)) - pkg.checksum["desc"] = util.getmd5sum(filename) - pkg.mtime["desc"] = util.getmtime(filename) # files # for local entries, fields are: files, backup @@ -268,8 +259,6 @@ class pmdb: data.append("") filename = os.path.join(path, "files") util.mkfile(filename, "\n".join(data)) - pkg.checksum["files"] = util.getmd5sum(filename) - pkg.mtime["files"] = util.getmtime(filename) # install if self.treename == "local": @@ -280,8 +269,6 @@ class pmdb: if not empty: filename = os.path.join(path, "install") util.mkinstallfile(filename, pkg.install) - pkg.checksum["install"] = util.getmd5sum(filename) - pkg.mtime["install"] = util.getmtime(filename) def gensync(self): """ @@ -300,31 +287,4 @@ class pmdb: os.chdir(curdir) - def ispkgmodified(self, pkg): - """ - """ - - modified = 0 - - oldpkg = self.getpkg(pkg.name) - if not oldpkg: - return 0 - - util.vprint("\toldpkg.checksum : %s" % oldpkg.checksum) - util.vprint("\toldpkg.mtime : %s" % oldpkg.mtime) - - for key in pkg.mtime.keys(): - if key == "install" \ - and oldpkg.mtime[key] == (0, 0, 0) \ - and pkg.mtime[key] == (0, 0, 0): - continue - if oldpkg.mtime[key][1:3] != pkg.mtime[key][1:3]: - modified += 1 - - return modified - - -if __name__ == "__main__": - db = pmdb("local") - print db # vim: set ts=4 sw=4 et: |