[arch-general] makechrootpkg and multiple sources, a bug?
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. After a bit of poking around in the makechrootpkg script I made the following change: --- makechrootpkg.orig 2011-02-20 09:22:30.130744179 +0000 +++ makechrootpkg 2011-02-20 09:22:44.494796349 +0000 @@ -173,7 +173,7 @@ for f in ${source[@]}; do basef=$(echo $f | sed 's|::.*||' | sed 's|^.*://.*/||g') if [ -f "$basef" ]; then - cp "$basef" "$copydir/srcdest/" + cp "$basef" "$copydir/build/" elif [ -f "$SRCDEST/$basef" ]; then cp "$SRCDEST/$basef" "$copydir/srcdest/" fi After this the package built just fine. I'm doubting myself in this though, because it seems like such an obvious bug, especially since the PKGBUILD is copied into $copydir/build/ just a few lines above this change. Also, should the copy in the elif-branch be changed too? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@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
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. Allan
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. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@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
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. Allan
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.) /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term. -- Alan Kay
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 $SRCDIR. Try: if [[ -f $SRCDIR/my.patch ]]; Also, the real issue is that you always have the md5sum for my.patch in your md5sum array when it should be added in the same if statement. Allan
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 $SRCDIR.
Try: if [[ -f $SRCDIR/my.patch ]];
Well, that would be wrong. This probably works... if [[ -f ${SRCDEST:-.}/my.patch ]] Allan
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 $SRCDIR.
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? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@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
On 02/20/2011 07:04 PM, Magnus Therning wrote:
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
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?
/M
i don't understand why you want to split like that the sources array. Just declare it once and get over it. sources=(link1 my.patch) makepkg -g >> PKGBUILD -- Ionuț
On Sun, Feb 20, 2011 at 07:06:51PM +0200, Ionuț Bîru wrote:
On 02/20/2011 07:04 PM, Magnus Therning wrote:
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
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?
/M
i don't understand why you want to split like that the sources array. Just declare it once and get over it.
sources=(link1 my.patch)
makepkg -g >> PKGBUILD
There are good reasons for it. I'm not talking about one PKGBUILD here, but rather about 200, all of which are automatically generated. Some of the 200 packages do need minor changes though, and earlier that was done by manually modifying the output. I'm now making some changes to the transformer so that it can pull those changes in via patches instead. Using this type of modifications to the sources array makes it easy to use an almost completely generic PKGBUILD. Hopefully that explains why I'm pushing this. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@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
participants (3)
-
Allan McRae
-
Ionuț Bîru
-
Magnus Therning