[arch-general] makechrootpkg and multiple sources, a bug?

Magnus Therning magnus at therning.org
Sun Feb 20 12:04:16 EST 2011

On Sun, Feb 20, 2011 at 08:54:28PM +1000, Allan McRae wrote:
> On 20/02/11 20:35, Allan McRae wrote:
> >On 20/02/11 20:19, Magnus Therning wrote:
> >>On Sun, Feb 20, 2011 at 08:09:16PM +1000, Allan McRae wrote:
> >>>On 20/02/11 20:05, Magnus Therning wrote:
> >>>>On Sun, Feb 20, 2011 at 07:55:10PM +1000, Allan McRae wrote:
> >>>>>On 20/02/11 19:36, Magnus Therning wrote:
> >>>>>>I just tried building a package with more than one source file using
> >>>>>>makechrootpkg. It failed with this message:
> >>>>>>
> >>>>>>==> ERROR: Integrity checks (md5) differ in size from the source
> >>>>>>array.
> >>>>>
> >>>>>That is an error from makepkg.
> >>>>
> >>>>Indeed, but AFAICS it's caused by makechrootpkg not copying all the
> >>>>sources into the build chroot for makepkg to find.
> >>>>
> >>>
> >>>No... it cause by your PKGBUILD having more/less entries in the
> >>>sources array that the md5sums array.
> >>
> >>Please, read my initial email!
> >>
> >>My PKGBUILD is just fine, it builds out of the build chroot (using
> >>makepkg directly) and it builds when I modify makechrootpkg as I
> >>outlined.
> >>
> >>The source array is modified based on files in the dir holding the
> >>PKGBUILD, like this:
> >>
> >>if [[ -f my.patch ]]; then
> >>sources=(${sources[@] my.patch)
> >>fi
> >>
> >>So the build failure reported by makepkg *really* is caused by
> >>makechrootpkg not copying over all the source files.
> >>
> >>(Now it may be bad to modify the source array that way, but that's a
> >>different discussion altogether.)
> >>
> >
> >makechrootpkg sets SRCDEST and copies the source files there. Your
> >PKGBUILD assumes the sources are alongside the PKGBUILD. When run
> >with makechrootpkg, your PKGBUILD fails as the "[[ -f my.patch ]]"
> >fails as my.patch is not in the current directory, but rather in

Yes, I just never thought that the assumption would go wrong.  Out of
curiosity, why doesn't makechrootpkg just copy all the sources into
/build so that they are next to the PKGBUILD?

> >Try:
> >if [[ -f $SRCDIR/my.patch ]];
> Well, that would be wrong.  This probably works...
> if [[ -f ${SRCDEST:-.}/my.patch ]]

Nope, that doesn't work.  The setting of SRCDEST doesn't seem to get
all the way through to the PKGBUILD's build function :-(

I modified the little build script used by makechrootpkg
(/chrootbuild) to export SRCDEST, but that still didn't do it.  How
can I detect within a PKGBUILD that the build is invoked by
makechrootpkg in an elegant way?


Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus

I invented the term Object-Oriented, and I can tell you I did not have
C++ in mind.
     -- Alan Kay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20110220/0c0c6c32/attachment-0001.asc>

More information about the arch-general mailing list