[pacman-dev] makechrootpkg and $PKGDEST

bardo ilbardo at gmail.com
Fri Sep 4 20:25:11 EDT 2009


Is it my impression or there are some problems with $SRCDEST and
$PKGDEST? I didn't define any of these variables in both my
makepkg.conf, the guest one and the chroot one. In makechrootpkg,
lines 155-157, I see:

---------
source $uniondir/etc/makepkg.conf

[ -d "$uniondir/pkgdest" ] || mkdir "$uniondir/pkgdest"
if ! grep "PKGDEST=/pkgdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
    echo "Setting PKGDEST in makepkg.conf"
    echo "PKGDEST=/pkgdest" >> "$uniondir/etc/makepkg.conf"
fi

[ -d "$uniondir/srcdest" ] || mkdir "$uniondir/srcdest"
if ! grep "SRCDEST=/srcdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then
    echo "Setting SRCDEST in makepkg.conf"
    echo "SRCDEST=/srcdest" >> "$uniondir/etc/makepkg.conf"
fi
---------

So here the chroot's makepkg.conf gets sourced, and it shouldn't
inherit any of these variables, but they get forced (in the chroot) to
/pkgdest and /srcdest. Problem is, later (lines 240-248) the files
don't get moved to $WORKDIR as before, but they go to $PKGDEST, which
*should* be empty (because it's the guest system's pkgdest, which got
sourced before adding the variables there):

---------
        if [ -e $pkgfile ]; then
            if [ -n "$PKGDEST" ]; then
                echo "Moving completed ${_pkgname} package file to ${PKGDEST}"
                mv $pkgfile "${PKGDEST}"
            else
                echo "Moving completed ${_pkgname} package file to ${WORKDIR}"
                mv $pkgfile "${WORKDIR}"
            fi
        fi
---------

I don't understand because they go the /{src,pkg}dest, but it looks
like they shouldn't. Even more, there's no directory check on the
guest system, so guess what... if the dirs don't exist, the source and
dest files get renamed to /srcdest and /pkgdest respectively...

This looks like a bug to me, but given how many times I am wrong
(especially at 2 a.m.) I'd prefer to wait for some feedback before
opening one.


Corrado


More information about the pacman-dev mailing list