summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-02-19 04:20:17 +0100
committerDan McGee <dan@archlinux.org>2009-02-19 04:20:17 +0100
commit1c4633ea2cbc01cfd7929509724951615827c482 (patch)
tree5a0f505caca856b6772e83e8234659334a5851c7 /scripts
parent6c4d702cb10f9bc5da23b6511f09f4b4a07a4281 (diff)
parente7daa59f845f073511c632a972215d047f292f25 (diff)
downloadpacman-1c4633ea2cbc01cfd7929509724951615827c482.tar.gz
pacman-1c4633ea2cbc01cfd7929509724951615827c482.tar.xz
Merge branch 'maint'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/repo-add.sh.in29
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 6b10527d..b4ae7d35 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -141,19 +141,22 @@ db_write_entry()
"
# read info from the zipped package
- local line
- for line in $(bsdtar -xOf "$pkgfile" .PKGINFO | \
- grep -v "^#" | sed 's|\(\w*\)\s*=\s*\(.*\)|\1="\2"|'); do
- eval "$line"
- case "$line" in
- group=*) _groups="$_groups$group\n" ;;
- depend=*) _depends="$_depends$depend\n" ;;
- backup=*) _backups="$_backups$backup\n" ;;
- license=*) _licenses="$_licenses$license\n" ;;
- replaces=*) _replaces="$_replaces$replaces\n" ;;
- provides=*) _provides="$_provides$provides\n" ;;
- conflict=*) _conflicts="$_conflicts$conflict\n" ;;
- optdepend=*) _optdepends="$_optdepends$optdepend\n" ;;
+ local line var val
+ for line in $(bsdtar -xOf "$pkgfile" .PKGINFO |
+ grep -v '^#' | sed 's|\(\w*\)\s*=\s*\(.*\)|\1 \2|'); do
+ # bash awesomeness here- var is always one word, val is everything else
+ var=${line%% *}
+ val=${line#* }
+ declare $var="$val"
+ case "$var" in
+ group) _groups="$_groups$group\n" ;;
+ depend) _depends="$_depends$depend\n" ;;
+ backup) _backups="$_backups$backup\n" ;;
+ license) _licenses="$_licenses$license\n" ;;
+ replaces) _replaces="$_replaces$replaces\n" ;;
+ provides) _provides="$_provides$provides\n" ;;
+ conflict) _conflicts="$_conflicts$conflict\n" ;;
+ optdepend) _optdepends="$_optdepends$optdepend\n" ;;
esac
done