[pacman-dev] CVS update of pacman-lib/scripts (repo-add)
Aaron Griffin
aaron at archlinux.org
Thu Feb 22 20:29:15 EST 2007
Date: Thursday, February 22, 2007 @ 20:29:15
Author: aaron
Path: /home/cvs-pacman/pacman-lib/scripts
Modified: repo-add (1.4 -> 1.5)
* Prepend all lists with _ for consistency
* Fixed IFS. It seems there's no easy way to get a newline IFS without setting
it like so:
IFS="
" #ewww gross
----------+
repo-add | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
Index: pacman-lib/scripts/repo-add
diff -u pacman-lib/scripts/repo-add:1.4 pacman-lib/scripts/repo-add:1.5
--- pacman-lib/scripts/repo-add:1.4 Tue Jan 30 19:38:13 2007
+++ pacman-lib/scripts/repo-add Thu Feb 22 20:29:14 2007
@@ -94,26 +94,27 @@
packager=""
csize=""
size=""
- groups=""
- depends=""
- backups=""
- licenses=""
+ _groups=""
+ _depends=""
+ _backups=""
+ _licenses=""
_replaces=""
_provides=""
_conflicts=""
OLDIFS="$IFS"
# IFS (field seperator) is only the newline character
- IFS=$(echo)
+ IFS="
+"
# read info from the zipped package
for i in $(tar xOf "$pkgfile" .PKGINFO | grep -v "^#" |sed 's|\(\w*\)\s*=\s*\(.*\)|\1="\2"|'); do
eval "${i}"
case "$i" in
- group=*) groups="$groups $group" ;;
- depend=*) depends="$depends $depend" ;;
- backup=*) backups="$backups $backup" ;;
- license=*) licenses="$licenses $license" ;;
+ group=*) _groups="$_groups $group" ;;
+ depend=*) _depends="$_depends $depend" ;;
+ backup=*) _backups="$_backups $backup" ;;
+ license=*) _licenses="$_licenses $license" ;;
replaces=*) _replaces="$_replaces $replaces" ;;
provides=*) _provides="$_provides $provides" ;;
conflicts=*) _conflicts="$_conflicts $conflicts" ;;
@@ -153,9 +154,9 @@
if [ -n "$pkgdesc" ]; then
echo -e "%DESC%\n$pkgdesc\n" >>desc
fi
- if [ -n "$groups" ]; then
+ if [ -n "$_groups" ]; then
echo "%GROUPS%" >>desc
- echo $groups | tr -s ' ' '\n' >>desc
+ echo $_groups | tr -s ' ' '\n' >>desc
echo "" >desc
fi
[ -n $csize ] && echo -e "%CSIZE%\n$csize\n" >>desc
@@ -171,9 +172,9 @@
done
[ -n "$url" ] && echo -e "%URL%\n$url\n" >>desc
- if [ -n "$licenses" ]; then
+ if [ -n "$_licenses" ]; then
echo "%LICENSE%" >>desc
- echo $licenses | tr -s ' ' '\n' >>desc
+ echo $_licenses | tr -s ' ' '\n' >>desc
echo "" >>desc
fi
[ -n "$arch" ] && echo -e "%ARCH%\n$arch\n" >>desc
@@ -189,9 +190,9 @@
# create depends entry
echo ":: creating 'depends' db entry"
- if [ -n "$depends" ]; then
+ if [ -n "$_depends" ]; then
echo "%DEPENDS%" >>depends
- echo $depends | tr -s ' ' '\n' >>depends
+ echo $_depends | tr -s ' ' '\n' >>depends
echo "" >>depends
fi
if [ -n "$_conflicts" ]; then
More information about the pacman-dev
mailing list