[pacman-dev] bacman

Allan McRae mcrae_allan at hotmail.com
Thu May 29 23:03:32 EDT 2008

Dan McGee wrote:
>> 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.
> We should just be able to source makepkg.conf, no need to sed it to
> death. Be sure we source ~/.makepkg.conf as well though if this script
> can be run as a user. Just look to makepkg to see the canonical way to
> do all this.

Nice catch. I had forgotten about the local user version.

> Man I wish there was a better way to get the pacman.conf stuff in.

Well, if both DBPath and CacheDir _can not_ have spaces in them, this 
can be simplified to (from earlier versions of the script):
eval $(awk '/CacheDir/ {print $1$2$3}' /etc/pacman.conf)

That is far less ugly but won't handle spaces in those paths. Now the 
question is, does pacman actually allow spaces in those path names?  I'm 
not familiar with that part of the pacman code.

More information about the pacman-dev mailing list