Revert execvp and related commits
This reverts commit4a8c2852a8
. This reverts commit993700bc6b
. This reverts commitbb4d2b72c1
. This reverts commit60b192e383
. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
b27886ab59
commit
ad280e1b56
|
@ -28,7 +28,6 @@ check-local: test-pacman test-pacsort test-vercmp test-parseopts
|
||||||
test-pacman: test/pacman src/pacman
|
test-pacman: test/pacman src/pacman
|
||||||
LC_ALL=C $(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
|
LC_ALL=C $(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
|
||||||
--test $(top_srcdir)/test/pacman/tests/*.py \
|
--test $(top_srcdir)/test/pacman/tests/*.py \
|
||||||
--scriptlet-shell $(SCRIPTLET_SHELL) \
|
|
||||||
-p $(top_builddir)/src/pacman/pacman
|
-p $(top_builddir)/src/pacman/pacman
|
||||||
|
|
||||||
test-pacsort: test/util src/util
|
test-pacsort: test/util src/util
|
||||||
|
|
|
@ -105,8 +105,8 @@ AC_ARG_WITH(debug-suffix,
|
||||||
# Help line for changing shell used to run install scriptlets
|
# Help line for changing shell used to run install scriptlets
|
||||||
AC_ARG_WITH(scriptlet-shell,
|
AC_ARG_WITH(scriptlet-shell,
|
||||||
AS_HELP_STRING([--with-scriptlet-shell=shell],
|
AS_HELP_STRING([--with-scriptlet-shell=shell],
|
||||||
[set the shell used to run install scriptlets]),
|
[set the full path to the shell used to run install scriptlets]),
|
||||||
[SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=sh])
|
[SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=/bin/sh])
|
||||||
|
|
||||||
# Help line for using OpenSSL
|
# Help line for using OpenSSL
|
||||||
AC_ARG_WITH(openssl,
|
AC_ARG_WITH(openssl,
|
||||||
|
@ -455,7 +455,7 @@ AC_SUBST(DEBUGSUFFIX)
|
||||||
AC_DEFINE_UNQUOTED([DEBUGSUFFIX], "$DEBUGSUFFIX", [The suffix for debugging symbol packages used by makepkg])
|
AC_DEFINE_UNQUOTED([DEBUGSUFFIX], "$DEBUGSUFFIX", [The suffix for debugging symbol packages used by makepkg])
|
||||||
# Set shell used by install scriptlets
|
# Set shell used by install scriptlets
|
||||||
AC_SUBST(SCRIPTLET_SHELL)
|
AC_SUBST(SCRIPTLET_SHELL)
|
||||||
AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The shell used to run install scriptlets])
|
AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The full path of the shell used to run install scriptlets])
|
||||||
|
|
||||||
# Configuration files
|
# Configuration files
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
|
|
|
@ -549,9 +549,9 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[])
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
umask(0022);
|
umask(0022);
|
||||||
execvp(cmd, argv);
|
execv(cmd, argv);
|
||||||
/* execvp only returns if there was an error */
|
/* execv only returns if there was an error */
|
||||||
fprintf(stderr, _("call to execvp failed (%s)\n"), strerror(errno));
|
fprintf(stderr, _("call to execv failed (%s)\n"), strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
} else {
|
} else {
|
||||||
/* this code runs for the parent only (wait on the child) */
|
/* this code runs for the parent only (wait on the child) */
|
||||||
|
@ -621,10 +621,13 @@ int _alpm_ldconfig(alpm_handle_t *handle)
|
||||||
|
|
||||||
snprintf(line, PATH_MAX, "%setc/ld.so.conf", handle->root);
|
snprintf(line, PATH_MAX, "%setc/ld.so.conf", handle->root);
|
||||||
if(access(line, F_OK) == 0) {
|
if(access(line, F_OK) == 0) {
|
||||||
|
snprintf(line, PATH_MAX, "%ssbin/ldconfig", handle->root);
|
||||||
|
if(access(line, X_OK) == 0) {
|
||||||
char arg0[32];
|
char arg0[32];
|
||||||
char *argv[] = { arg0, NULL };
|
char *argv[] = { arg0, NULL };
|
||||||
strcpy(arg0, "ldconfig");
|
strcpy(arg0, "ldconfig");
|
||||||
return _alpm_run_chroot(handle, "ldconfig", argv);
|
return _alpm_run_chroot(handle, "/sbin/ldconfig", argv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
# pactest : run automated testing on the pacman binary
|
# pactest : run automated testing on the pacman binary
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 by Aurelien Foret <orelien@chez.com>
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -82,9 +81,6 @@ def create_parser():
|
||||||
parser.add_option("--manual-confirm", action = "store_true",
|
parser.add_option("--manual-confirm", action = "store_true",
|
||||||
dest = "manualconfirm", default = False,
|
dest = "manualconfirm", default = False,
|
||||||
help = "do not use --noconfirm for pacman calls")
|
help = "do not use --noconfirm for pacman calls")
|
||||||
parser.add_option("--scriptlet-shell", type = "string",
|
|
||||||
dest = "scriptletshell", default = "sh",
|
|
||||||
help = "specify shell used for install scriptlets")
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,7 +99,6 @@ def create_parser():
|
||||||
env.pacman["gdb"] = opts.gdb
|
env.pacman["gdb"] = opts.gdb
|
||||||
env.pacman["valgrind"] = opts.valgrind
|
env.pacman["valgrind"] = opts.valgrind
|
||||||
env.pacman["manual-confirm"] = opts.manualconfirm
|
env.pacman["manual-confirm"] = opts.manualconfirm
|
||||||
env.pacman["scriptlet-shell"] = opts.scriptletshell
|
|
||||||
|
|
||||||
if opts.testcases is None or len(opts.testcases) == 0:
|
if opts.testcases is None or len(opts.testcases) == 0:
|
||||||
print "no tests defined, nothing to do"
|
print "no tests defined, nothing to do"
|
||||||
|
|
|
@ -66,7 +66,7 @@ def run(self):
|
||||||
print t.description
|
print t.description
|
||||||
print "----------"*8
|
print "----------"*8
|
||||||
|
|
||||||
t.generate(self.pacman)
|
t.generate()
|
||||||
|
|
||||||
t.run(self.pacman)
|
t.run(self.pacman)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#! /usr/bin/python2
|
#! /usr/bin/python2
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 by Aurelien Foret <orelien@chez.com>
|
# Copyright (c) 2006 by Aurelien Foret <orelien@chez.com>
|
||||||
# Copyright (c) 2006-2012 Pacman Development Team <pacman-dev@archlinux.org>
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -103,18 +102,7 @@ def load(self):
|
||||||
else:
|
else:
|
||||||
raise IOError("file %s does not exist!" % self.name)
|
raise IOError("file %s does not exist!" % self.name)
|
||||||
|
|
||||||
def resolve_binary(self, binary):
|
def generate(self):
|
||||||
if os.path.isabs(binary):
|
|
||||||
return binary
|
|
||||||
|
|
||||||
for path in os.environ["PATH"].split(':'):
|
|
||||||
resolved = os.path.join(path, binary)
|
|
||||||
if os.path.exists(resolved):
|
|
||||||
return resolved
|
|
||||||
|
|
||||||
return binary
|
|
||||||
|
|
||||||
def generate(self, pacman):
|
|
||||||
print "==> Generating test environment"
|
print "==> Generating test environment"
|
||||||
|
|
||||||
# Cleanup leftover files from a previous test session
|
# Cleanup leftover files from a previous test session
|
||||||
|
@ -132,18 +120,13 @@ def generate(self, pacman):
|
||||||
etcdir = os.path.join(self.root, os.path.dirname(util.PACCONF))
|
etcdir = os.path.join(self.root, os.path.dirname(util.PACCONF))
|
||||||
bindir = os.path.join(self.root, "bin")
|
bindir = os.path.join(self.root, "bin")
|
||||||
sbindir = os.path.join(self.root, "sbin")
|
sbindir = os.path.join(self.root, "sbin")
|
||||||
scriptlet_shell = self.resolve_binary(pacman["scriptlet-shell"])
|
sys_dirs = [dbdir, cachedir, syncdir, tmpdir, logdir, etcdir, bindir, sbindir]
|
||||||
shelldir = os.path.join(self.root, os.path.dirname(scriptlet_shell)[1:])
|
|
||||||
sys_dirs = [dbdir, cachedir, syncdir, tmpdir, logdir, etcdir, bindir,
|
|
||||||
sbindir, shelldir]
|
|
||||||
for sys_dir in sys_dirs:
|
for sys_dir in sys_dirs:
|
||||||
if not os.path.isdir(sys_dir):
|
if not os.path.isdir(sys_dir):
|
||||||
vprint("\t%s" % sys_dir[len(self.root)+1:])
|
vprint("\t%s" % sys_dir[len(self.root)+1:])
|
||||||
os.makedirs(sys_dir, 0755)
|
os.makedirs(sys_dir, 0755)
|
||||||
# Only the dynamically linked binary is needed for fakechroot
|
# Only the dynamically linked binary is needed for fakechroot
|
||||||
shutil.copy("/bin/sh", bindir)
|
shutil.copy("/bin/sh", bindir)
|
||||||
if scriptlet_shell != "/bin/sh":
|
|
||||||
shutil.copy("/bin/sh", os.path.join(self.root, scriptlet_shell[1:]))
|
|
||||||
shutil.copy(os.path.join(util.SELFPATH, "ldconfig.stub"),
|
shutil.copy(os.path.join(util.SELFPATH, "ldconfig.stub"),
|
||||||
os.path.join(sbindir, "ldconfig"))
|
os.path.join(sbindir, "ldconfig"))
|
||||||
ld_so_conf = open(os.path.join(etcdir, "ld.so.conf"), "w")
|
ld_so_conf = open(os.path.join(etcdir, "ld.so.conf"), "w")
|
||||||
|
|
Loading…
Reference in New Issue