[Dev] [PATCH] libremakepkg: fix building packages requring a rw startdir

Luke Shumaker lukeshu at lukeshu.com
Sun Jun 2 14:09:50 GMT 2019


On Wed, 29 May 2019 07:59:38 -0400,
bill-auger wrote:
> On Wed, 29 May 2019 12:12:15 +0200 Andreas wrote:
> > Could someone explain to me why we want to break this
> > behaviour?
> 
> i think only luke would know first hand - he explained the
> rationale; but its not clear what particular use case it was
> intended to support, or some bug it was intended to fix
> 
>   "- We mount the temporary directory containing the extracted
> source package files read-only, to be sure that makepkg doesn't
> modify the PKGBUILD. This is necessary because --holdver only
> disables pkgver() if it's a VCS package."

The guarantee I was trying to make is that the sources in the source
tarball match what is used to build the package, and can be used to
build the package.  Many packages from AUR do something silly like

    pkgver() { date +'%Y%m%d'; }

With that, it isn't possible to re-build the same package version,
even though you have the sourceball.  The pkgver() function should
always generate the same version from the same sources; if the version
doesn't change, then it doesn't try to edit the PKGBUILD.  So this is
trying to enforce that it doesn't change *again* after the sourceball
is created.

The issue is that apparently `makepkg --allsource` doesn't run
`pkgver()`.  IMO, the correct fix is to modify `download_sources()` to
do something to make sure that `pkgver()` gets run.  Until that is
patched, it could be worked around by running `makepkg -o` before
runnig libremakepkg (that's not a bad idea anyway--you should glance
over the changes for a VCS package before updating it :) )

As for linux-libre modifying the install script in `$startdir`; it
should be doing that in `$srcdir`; and I don't have a big problem with
saying "fix the PKGBUILD" in that case.

-- 
Happy hacking,
~ Luke Shumaker



More information about the Dev mailing list