summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-10-26 21:35:07 -0500
committerDan McGee <dan@archlinux.org>2011-01-22 11:14:42 -0600
commitd94346ede2b146a3eb9bfc263c049aa2783a032c (patch)
tree1bfe8f1226c0985f49e06138b37bd741e2bc2a68
parent946f4af7f376c22d33bb24ff997c99231a05c0e7 (diff)
downloadpacman-d94346ede2b146a3eb9bfc263c049aa2783a032c.tar.xz
pactest: pylint changes for pmpkg
Signed-off-by: Dan McGee <dan@archlinux.org>
-rwxr-xr-xtest/pacman/pmpkg.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 988f4c28..2b4a4a72 100755
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -22,8 +22,7 @@ import stat
import shutil
import tarfile
-from util import *
-
+import util
class pmpkg:
"""Package object.
@@ -96,14 +95,14 @@ class pmpkg:
Returns a string formatted as follows: "pkgname-pkgver.PKG_EXT_PKG".
"""
- return "%s%s" % (self.fullname(), PM_EXT_PKG)
+ return "%s%s" % (self.fullname(), util.PM_EXT_PKG)
def install_files(self, root):
"""Install files in the filesystem located under "root".
Files are created with content generated automatically.
"""
- [mkfile(os.path.join(root, f), f) for f in self.files]
+ [util.mkfile(os.path.join(root, f), f) for f in self.files]
def makepkg(self, path):
"""Creates an ArchLinux package archive.
@@ -119,8 +118,8 @@ class pmpkg:
# Generate package file system
for f in self.files:
- mkfile(f, f)
- self.size += os.stat(getfilename(f))[stat.ST_SIZE]
+ util.mkfile(f, f)
+ self.size += os.stat(util.getfilename(f))[stat.ST_SIZE]
# .PKGINFO
data = ["pkgname = %s" % self.name]
@@ -148,14 +147,14 @@ class pmpkg:
data.append("provides = %s" % i)
for i in self.backup:
data.append("backup = %s" % i)
- mkfile(".PKGINFO", "\n".join(data))
+ util.mkfile(".PKGINFO", "\n".join(data))
# .INSTALL
if len(self.install.values()) > 0:
- mkinstallfile(".INSTALL", self.install)
+ util.mkinstallfile(".INSTALL", self.install)
# safely create the dir
- mkdir(os.path.dirname(self.path))
+ util.mkdir(os.path.dirname(self.path))
# Generate package archive
tar = tarfile.open(self.path, "w:gz")
@@ -166,8 +165,4 @@ class pmpkg:
os.chdir(curdir)
shutil.rmtree(tmpdir)
-
-if __name__ == "__main__":
- pkg = pmpkg("dummy")
- print pkg
# vim: set ts=4 sw=4 et: