summaryrefslogtreecommitdiffstats
path: root/test/pacman/pmtest.py
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-01-20 07:49:52 +0100
committerAllan McRae <allan@archlinux.org>2013-01-28 14:38:34 +0100
commit801f7d1033f74644c6d427cff9618270b2878582 (patch)
treeac2225cf4f0c6d68b0006e04f3088e72a537ceab /test/pacman/pmtest.py
parentad280e1b56b6c6632b2fae5288f6441c343d0185 (diff)
downloadpacman-801f7d1033f74644c6d427cff9618270b2878582.tar.gz
pacman-801f7d1033f74644c6d427cff9618270b2878582.tar.xz
pactest: handle non-default scriptlet shells
pacman can be configured to use a different shell than /bin/sh for scriplets. Pass the cnfigured value to the pactest suite and make the necessary "copy" of the shell in the test root. Also update all copyright years in the pactest suite. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/pmtest.py')
-rw-r--r--test/pacman/pmtest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 00a0b96e..af5d342b 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -1,6 +1,7 @@
#! /usr/bin/python2
#
# Copyright (c) 2006 by Aurelien Foret <orelien@chez.com>
+# Copyright (c) 2006-2013 Pacman Development Team <pacman-dev@archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -102,7 +103,7 @@ class pmtest(object):
else:
raise IOError("file %s does not exist!" % self.name)
- def generate(self):
+ def generate(self, pacman):
print "==> Generating test environment"
# Cleanup leftover files from a previous test session
@@ -120,13 +121,18 @@ class pmtest(object):
etcdir = os.path.join(self.root, os.path.dirname(util.PACCONF))
bindir = os.path.join(self.root, "bin")
sbindir = os.path.join(self.root, "sbin")
- sys_dirs = [dbdir, cachedir, syncdir, tmpdir, logdir, etcdir, bindir, sbindir]
+ shell = pacman["scriptlet-shell"][1:]
+ shelldir = os.path.join(self.root, os.path.dirname(shell))
+ sys_dirs = [dbdir, cachedir, syncdir, tmpdir, logdir, etcdir, bindir,
+ sbindir, shelldir]
for sys_dir in sys_dirs:
if not os.path.isdir(sys_dir):
vprint("\t%s" % sys_dir[len(self.root)+1:])
os.makedirs(sys_dir, 0755)
# Only the dynamically linked binary is needed for fakechroot
shutil.copy("/bin/sh", bindir)
+ if shell != "bin/sh":
+ shutil.copy("/bin/sh", os.path.join(self.root, shell))
shutil.copy(os.path.join(util.SELFPATH, "ldconfig.stub"),
os.path.join(sbindir, "ldconfig"))
ld_so_conf = open(os.path.join(etcdir, "ld.so.conf"), "w")