It seems I was beaten to send it...

Anyway, the only section I changed was this:

> #
> # Setting environmental variables
> #
> eval $(sed -nre 
> 's:[[:space:]]*(DBPath)[[:space:]]*=[[:space:]]*([[:print:]]*):\1="\2":p' 
> /etc/pacman.conf)
> pac_db="${DBPath:-/var/lib/pacman/}/local"
> eval $(sed -nre 
> 's:[[:space:]]*(CacheDir)[[:space:]]*=[[:space:]]*([[:print:]]*):\1="\2":p' 
> /etc/pacman.conf)
> pac_cache="${CacheDir:-/var/cache/pacman/pkg/}"
> pkg_name="$1"
> pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)"
> eval $(sed -nre 
> 's:[[:space:]]*(CARCH)[[:space:]]*=[[:space:]]*([[:print:]]*):\1=\2:p' 
> /etc/makepkg.conf)
> pkg_arch=${CARCH:-'unknown'}
> eval $(sed -nre 
> 's:[[:space:]]*(PKGDEST)[[:space:]]*=[[:space:]]*([[:print:]]*):\1=\2:p' 
> /etc/makepkg.conf)
> pkg_dest="${PKGDEST:-$PWD}"
> eval $(sed -nre 
> 's:[[:space:]]*(PACKAGER)[[:space:]]*=[[:space:]]*([[:print:]]*):\1=\2:p' 
> /etc/makepkg.conf)
> pkg_pkger=${PACKAGER:-'Unknown Packager'}
> pkg_namver="${pkg_dir##*/}"
>   

The mailing list doesn't like the length of those sed statements....   
The eval statement appears to only work until the first comments so I 
changed it so that each variable needs to be read in separately.

Also, those sed statements are monstrous...  They do allow spaces in 
path names though.  So the question is: Does pacman allow spaces in 
DBPath or CacheDir?  If not we can simply those statements.  It should 
not be needed for the reading of variables from makepkg.conf because 
they are bash variables and should be nicely quoted anyway.

Allan



_______________________________________________
pacman-dev mailing list
[email protected]
http://archlinux.org/mailman/listinfo/pacman-dev

Reply via email to