[pacman-dev] [PATCH 2/2 v2] Save path to $PACMAN, to avoid losing access due to --syncdeps
Unmangled version: https://github.com/vadmium/pacman-arch/commit/3992a1d.patch
--- scripts/makepkg.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0f266df..9c6c0ae 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2728,7 +2728,12 @@ if (( NODEPS || (NOBUILD && !DEP_BIN ) )); then if (( NODEPS )); then warning "$(gettext "Skipping dependency checks.")" fi -elif type -p "$PACMAN" >/dev/null; then +elif output="$(command -v "$PACMAN")"; then + # Save full path in case the --syncdeps operation resets the $PATH by + # invoking /etc/profile. If $PACMAN refers to a command in ~/bin/ it + # could become inaccessible. + PACMAN="$output" + if (( RMDEPS && ! INSTALL )); then original_pkglist=($(run_pacman -Qq)) # required by remove_dep fi -- 1.8.0
On 11 November 2012 23:21, Allan McRae <allan@archlinux.org> wrote:
Hi Allan, do you really use that alias inside “makepkg”? Where do you have that alias defined? I can’t see how it could get inside the script, unless there’s some magic way of exporting aliases or something. A quick read of the Bash man page suggests that ~/.bashrc, ~/.profile, etc are only read for interactive (or non-interactive login) mode. If it is a problem though, would using the “which” command as you originally suggested be better? Does this project already depend on the “which” command?
On 12/11/12 09:54, Allan McRae wrote:
So... I have decided that this is completely the wrong place to do this. My proposed patch is following. Allan
participants (2)
-
Allan McRae
-
Martin Panter