On Thu, Aug 26, 2010 at 10:14 AM, Juergen Hoetzel <juergen@archlinux.org> wrote:
Signed-off-by: Juergen Hoetzel <juergen@archlinux.org> --- scripts/makepkg.sh.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 17fd5de..66e1225 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -372,7 +372,7 @@ download_file() { run_pacman() { local cmd printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@" - if (( ! ASROOT )) && [[ ! $1 =~ ^-(T|Qq)$" ]]; then + if (( ! ASROOT )) && [[ ! $1 =~ "^-(T|Qq)$" ]]; then if [ "$(type -p sudo)" ]; then cmd="sudo $cmd" else --
The fix loops obviously correct, but now the logic is all busted. The regex is not working and it is always prompting me for a password when using the -T operation to check deps. See the following: $ foobar='-T'; [[ "$foobar" =~ '^-(T|Qq)$' ]] && echo 'matches' $ foobar='-T'; [[ "$foobar" =~ '-(T|Qq)' ]] && echo 'matches' $ foobar='-T'; [[ "$foobar" =~ '^-T$' ]] && echo 'matches' $ foobar='-T'; [[ "$foobar" =~ '-T' ]] && echo 'matches' matches It turns out hte regex should *not* be quoted at all, from #bash: < geirha> toofishes: The regex must not be quoted I've made an alternate patch to do this instead and it will be on master. -Dan