mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
Correct scriptlet usage pattern
The new pattern is as follows: . /path/to/scriptlet post_upgrade X Y This requires less frameworking in the install scripts (the three lines that shift and eval a function are nasty) Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
9781d0d637
commit
565d2eeed5
@ -33,8 +33,4 @@ post_remove() {
|
||||
/bin/true
|
||||
}
|
||||
|
||||
op=$1
|
||||
shift
|
||||
["$(type -t "$op")" = "function" ] && $op "$@"
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
||||
|
@ -511,9 +511,6 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* mark the scriptlet as executable */
|
||||
chmod(scriptfn, 0755);
|
||||
|
||||
/* chop off the root so we can find the tmpdir in the chroot */
|
||||
scriptpath = scriptfn + strlen(root) - 1;
|
||||
|
||||
@ -538,10 +535,10 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||
_alpm_log(PM_LOG_DEBUG, "executing %s script...\n", script);
|
||||
|
||||
if(oldver) {
|
||||
snprintf(cmdline, PATH_MAX, "%s %s %s %s",
|
||||
snprintf(cmdline, PATH_MAX, ". %s; %s %s %s",
|
||||
scriptpath, script, ver, oldver);
|
||||
} else {
|
||||
snprintf(cmdline, PATH_MAX, "%s %s %s",
|
||||
snprintf(cmdline, PATH_MAX, ". %s; %s %s",
|
||||
scriptpath, script, ver);
|
||||
}
|
||||
_alpm_log(PM_LOG_DEBUG, "%s\n", cmdline);
|
||||
|
Loading…
x
Reference in New Issue
Block a user