1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-10 21:38:19 -05: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 os
import tempfile import tempfile
import shutil import shutil
import tarfile
import pmpkg import pmpkg
from util import * from util import *
@ -343,7 +344,13 @@ class pmdb:
# Generate database archive # Generate database archive
mkdir(path) mkdir(path)
archive = os.path.join(path, "%s%s" % (self.treename, PM_EXT_DB)) 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) os.chdir(curdir)
shutil.rmtree(tmpdir) shutil.rmtree(tmpdir)

View File

@ -20,6 +20,7 @@ import os
import tempfile import tempfile
import stat import stat
import shutil import shutil
import tarfile
from util import * from util import *
@ -153,25 +154,25 @@ class pmpkg:
for i in self.backup: for i in self.backup:
data.append("backup = %s" % i) data.append("backup = %s" % i)
mkfile(".PKGINFO", "\n".join(data)) mkfile(".PKGINFO", "\n".join(data))
targets = ".PKGINFO"
# .INSTALL # .INSTALL
empty = 1
if len(self.install.values()) > 0: if len(self.install.values()) > 0:
empty = 0
if not empty:
mkinstallfile(".INSTALL", self.install) 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)) mkdir(os.path.dirname(self.path))
# Generate package archive # 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) os.chdir(curdir)
shutil.rmtree(tmpdir) shutil.rmtree(tmpdir)

View File

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