removepkg: Make removepkg completion work with root other than /

This commit is contained in:
Igor Murzov 2011-05-21 17:50:57 +04:00 committed by Igor Murzov
parent e82fef047a
commit 8641a8c817

View File

@ -47,7 +47,9 @@ _removepkg()
return 0
fi
COMPREPLY=( $( cd /var/log/packages; compgen -f -- "$cur" ) )
local root=${ROOT:-/}
COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1 ; \
compgen -f -- "$cur" ) )
} &&
complete -F _removepkg removepkg