[pacman-dev] [PATCH] makepkg: canonicalize paths from environmental variables

Allan McRae allan at archlinux.org
Sun Oct 3 23:24:15 EDT 2010


On 01/10/10 01:29, Xavier wrote:
> Allan McRae wrote:
>>
>> No.  It also affects the location of the tarfile.   e.g. PKGDEST="."
>> puts the tar file in $pkgdir because we create the tarball location
>> using $PKGDEST while in $pkgdir:
>>
>> cd $pkgdir
>> ...
>> pkg_file="$PKGDEST/${nameofpkg}-${pkgver}-${pkgrel}-${PKGARCH}${PKGEXT}"
>> ...
>>
>
> ok but do we need to be in $pkgdir ?
> IIRC this is exactly what I had to change in repo-add (the current working dir).
> The problem is always the same : if we change dir, then relative paths become
> broken.
> Looking at the create_package function, it seems we just need to add a few
> $pkgdir/ here and there.
>

I was looking at the makeworld script in ABS and noticed it has a nice 
way of dealing with this:

 > PKGDEST="."
 > cd $PKGDEST
 > PKGDEST=$(pwd)
 > cd - &>/dev/null
 > echo $PKGDEST
/home/allan

Now that is what I call a simple solution to implementing 
readlink/realpath in bash!  I'll adjust my patch.

Allan


More information about the pacman-dev mailing list