mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Allow specifying shell for running scriptlets
Some distributions insist on using bash specific commands in their install scripts under the assumption that "sh" is a symlink to bash. This can causes issues if (e.g.) their users what to change sh to point at another shell, such as dash, that does not support these features. Add a configure option to explicitly set the shell being used to run install scripts. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
20a16f55b3
commit
3ba5391839
@ -89,6 +89,12 @@ AC_ARG_WITH(buildscript,
|
|||||||
AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]),
|
AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]),
|
||||||
[BUILDSCRIPT=$withval], [BUILDSCRIPT=PKGBUILD])
|
[BUILDSCRIPT=$withval], [BUILDSCRIPT=PKGBUILD])
|
||||||
|
|
||||||
|
# Help line for changing shell used to run install scriptlets
|
||||||
|
AC_ARG_WITH(scriptlet-shell,
|
||||||
|
AS_HELP_STRING([--with-scriptlet-shell=shell],
|
||||||
|
[set the shell used to run install scriptlets]),
|
||||||
|
[SCRIPTLET_SHELL=$withval], [SCRIPTLET_SHELL=sh])
|
||||||
|
|
||||||
# Help line for using OpenSSL
|
# Help line for using OpenSSL
|
||||||
AC_ARG_WITH(openssl,
|
AC_ARG_WITH(openssl,
|
||||||
AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]),
|
AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]),
|
||||||
@ -338,6 +344,9 @@ AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman sourc
|
|||||||
# Set makepkg build script name
|
# Set makepkg build script name
|
||||||
AC_SUBST(BUILDSCRIPT)
|
AC_SUBST(BUILDSCRIPT)
|
||||||
AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg])
|
AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg])
|
||||||
|
# Set shell used by install scriptlets
|
||||||
|
AC_SUBST(SCRIPTLET_SHELL)
|
||||||
|
AC_DEFINE_UNQUOTED([SCRIPTLET_SHELL], "$SCRIPTLET_SHELL", [The shell used to run install scriptlets])
|
||||||
|
|
||||||
# Configuration files
|
# Configuration files
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
|
@ -277,7 +277,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
|
|||||||
const char *script, const char *ver, const char *oldver, int is_archive)
|
const char *script, const char *ver, const char *oldver, int is_archive)
|
||||||
{
|
{
|
||||||
char cmdline[PATH_MAX];
|
char cmdline[PATH_MAX];
|
||||||
char *argv[] = { "sh", "-c", cmdline, NULL };
|
char *argv[] = { SCRIPTLET_SHELL, "-c", cmdline, NULL };
|
||||||
char *tmpdir, *scriptfn = NULL, *scriptpath;
|
char *tmpdir, *scriptfn = NULL, *scriptpath;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
Loading…
Reference in New Issue
Block a user