pkgdelta: fix improper passing of file argument

Looks like I hosed this pretty hard in 5a5e712c74.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Dave Reisner 2013-03-09 22:45:00 -05:00 committed by Allan McRae
parent 63f04177c3
commit 6c870953c5
1 changed files with 3 additions and 2 deletions

View File

@ -75,6 +75,7 @@ isnumeric() {
}
read_pkginfo() {
unset pkgver pkgname arch
while IFS='=' read -r field value; do
# skip comments and invalid lines
[[ $field = '#'* || -z $value ]] && continue
@ -82,10 +83,10 @@ read_pkginfo() {
# skip lines which aren't fields we care about
[[ $field != @(pkgver|pkgname|arch) ]] || continue
declare "$field=$value"
declare -g "${field% }=${value# }"
[[ $pkgname && $pkgver && $arch ]] && return 0
done
done < <(bsdtar -xOqf "$1" .PKGINFO 2>/dev/null)
error "$(gettext "Invalid package file '%s'.")" "$1"
return 1