[Frugalware-git] pacman-tools: chkdep: use bsdtar instead of tarfile to handle xz-compressed fpms
Miklos Vajna
vmiklos at frugalware.org
Mon Aug 23 21:43:31 CEST 2010
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=465f83e988db967df86ae19e3db89fce3daf2fae
commit 465f83e988db967df86ae19e3db89fce3daf2fae
Author: Miklos Vajna <vmiklos at frugalware.org>
Date: Mon Aug 23 21:43:43 2010 +0200
chkdep: use bsdtar instead of tarfile to handle xz-compressed fpms
diff --git a/chkdep b/chkdep
index 83697cb..2b4425b 100755
--- a/chkdep
+++ b/chkdep
@@ -21,7 +21,7 @@
# USA.
#
-import tarfile, tempfile, shutil, os, stat, re, pacman, getopt, sys
+import subprocess, tempfile, shutil, os, stat, re, pacman, getopt, sys
from modulefinder import ModuleFinder
@@ -235,9 +235,11 @@ if "FAKEROOTKEY" in os.environ.keys():
if pkg:
fpmroot = tempfile.mkdtemp()
- fpm = tarfile.TarFile.open(pkg, "r:bz2")
- fpm.extractall(fpmroot)
- fpm.close()
+ cwd = os.getcwd()
+ os.chdir(fpmroot)
+ if subprocess.call(["bsdtar", "xf", os.path.join(cwd, pkg)]) != 0:
+ raise Exception("bsdtar failed")
+ os.chdir(cwd)
if dir:
fpmroot = dir
More information about the Frugalware-git
mailing list