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

Revert "popen does NOT require /bin/sh in a subchroot"

This reverts commit 9558639d80.

This change was wrong, popen does require /bin/sh in a subchroot.

1) pacman -S lilo -r root

Notice no error

2) rm root/bin/sh ; pacman -S lilo -r root

Notice an error :
error: scriptlet failed to execute correctly

Actually, we already get an explicit error here, when popen is run, so there
is no need to check for bin/sh explicitely.

Besides this check was problematic in some cases. For example, bash itself
has a scriptlet, but only post_install and post_upgrade, no pre_install and
pre_upgrade. However, since bash has a scriptlet, runscriptlet will also be
called before bash is installed. It won't do anything since the scriptlet
has no pre_install function. But if we keep the check, we will still get
"error : no /bin/sh".

Conflicts:

	lib/libalpm/trans.c

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2009-03-15 12:43:39 +01:00 committed by Dan McGee
parent 36863b968f
commit de97282fbd

View File

@ -443,13 +443,6 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
return(0);
}
/* NOTE: popen will use the PARENT's /bin/sh, not the chroot's */
if(access("/bin/sh", X_OK)) {
/* not found */
_alpm_log(PM_LOG_ERROR, _("No /bin/sh in parent environment, aborting scriptlet\n"));
return(0);
}
/* creates a directory in $root/tmp/ for copying/extracting the scriptlet */
snprintf(tmpdir, PATH_MAX, "%stmp/", root);
if(access(tmpdir, F_OK) != 0) {