[pacman-dev] [PATCH] Allow xdelta options to be set per package.

Nathan Jones nathanj at insightbb.com
Thu Nov 8 19:20:59 EST 2007


On Thu, Nov 08, 2007 at 03:50:12PM -0600, Dan McGee wrote:
> When I suggested this, I was thinking of the following type code that
> is already in makepkg (line 659):
>   # use ccache if it is requested (check buildenv and PKGBUILD opts)
>   if [ "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" !=
> "n" ]; then
>     [ -d /usr/lib/ccache/bin ] && export PATH="/usr/lib/ccache/bin:$PATH"
>   fi
> 
> Note that ccache is a BUILDENV var in makepkg.conf, but can still be
> denied in a PKGBUILD by using !ccache (for those packages that don't
> build correctly with it). I feel like a if clause just like the above
> would work for xdelta as well (and cut your patch from -1/+3 to
> -1/+1).

After looking at it some more, I don't think this if statement will work
for the xdelta option. This is because the ccache statement only allows
the option to be disabled, not enabled, in the PKGBUILD. Consider the
scenario where you have !ccache is makepkg.conf, but ccache in PKGBUILD:
ccache will _not_ be used. It seems possible to me that some people will
disable delta creation for most packages but enable it only for the
large ones.

It is still possible to turn my if statement into one line, but it will
be a long line :). I don't think it would be any better than the patch
I've already submitted.

Another option would be to do something like this: (untested)

local opt=$(check_option xdelta)
[ "$opt" = "?" ] && opt=$(check_buildenv xdelta)

if [ "$opt" != "y" ]; then
  return
fi

Or, check_buildenv could be changed to first look in the PKGBUILD
options, like check_option does.




More information about the pacman-dev mailing list