1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Merge branch 'maint'

Conflicts:

	pactest/pmtest.py
This commit is contained in:
Dan McGee 2008-04-19 16:18:40 -05:00
commit 423820b34c
3 changed files with 22 additions and 14 deletions

View File

@ -19,6 +19,7 @@
import os
import tempfile
import shutil
import tarfile
import pmpkg
from util import *
@ -343,7 +344,13 @@ class pmdb:
# Generate database archive
mkdir(path)
archive = os.path.join(path, "%s%s" % (self.treename, PM_EXT_DB))
os.system("tar zcf %s *" % archive)
tar = tarfile.open(archive, "w:gz")
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)

View File

@ -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)

View File

@ -200,7 +200,7 @@ class pmtest:
cmd.append("libtool gdb --args")
if pacman["valgrind"]:
cmd.append("valgrind -q --tool=memcheck --leak-check=full --show-reachable=yes")
cmd.append("%s --config=%s --root=%s --dbpath=%s --cachedir=%s" \
cmd.append("\"%s\" --config=\"%s\" --root=\"%s\" --dbpath=\"%s\" --cachedir=\"%s\"" \
% (pacman["bin"],
os.path.join(self.root, PACCONF),
self.root,
@ -212,7 +212,7 @@ class pmtest:
cmd.append("--debug=%s" % pacman["debug"])
cmd.append("%s" % self.args)
if not pacman["gdb"] and not pacman["valgrind"] and not pacman["nolog"]:
cmd.append(">%s 2>&1" % os.path.join(self.root, LOGFILE))
cmd.append(">\"%s\" 2>&1" % os.path.join(self.root, LOGFILE))
vprint("\trunning: %s" % " ".join(cmd))
# Change to the tmp dir before running pacman, so that local package