summaryrefslogtreecommitdiff
path: root/pactest/pmpkg.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-19 16:18:40 -0500
committerDan McGee <dan@archlinux.org>2008-04-19 16:18:40 -0500
commit423820b34c018e655aac5836873fef8dc475bd74 (patch)
tree690c72ae87a207870b9b0eaa6eec130de8978d37 /pactest/pmpkg.py
parent7a873a8f1284058c968c5d8026fbde7867913cb5 (diff)
parentc465d9e848b19b495259c7021a583c29fba92b44 (diff)
downloadpacman-423820b34c018e655aac5836873fef8dc475bd74.tar.xz
Merge branch 'maint'
Conflicts: pactest/pmtest.py
Diffstat (limited to 'pactest/pmpkg.py')
-rwxr-xr-xpactest/pmpkg.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/pactest/pmpkg.py b/pactest/pmpkg.py
index 3ee58156..48d79a35 100755
--- a/pactest/pmpkg.py
+++ b/pactest/pmpkg.py
@@ -20,6 +20,7 @@ import os
import tempfile
import stat
import shutil
+import tarfile
from util import *
@@ -153,25 +154,25 @@ class pmpkg:
for i in self.backup:
data.append("backup = %s" % i)
mkfile(".PKGINFO", "\n".join(data))
- targets = ".PKGINFO"
# .INSTALL
- empty = 1
if len(self.install.values()) > 0:
- empty = 0
- if not empty:
mkinstallfile(".INSTALL", self.install)
- targets += " .INSTALL"
- # package files
- if self.files:
- targets += " *"
-
- #safely create the dir
+ # safely create the dir
mkdir(os.path.dirname(self.path))
# Generate package archive
- os.system("tar zcf %s %s" % (self.path, targets))
+ tar = tarfile.open(self.path, "w:gz")
+
+ # package files
+ for root, dirs, files in os.walk('.'):
+ for d in dirs:
+ tar.add(os.path.join(root, d), recursive=False)
+ for f in files:
+ tar.add(os.path.join(root, f))
+
+ tar.close()
os.chdir(curdir)
shutil.rmtree(tmpdir)