[pacman-dev] [PATCH] makepkg: fix log file names for arch=any packages
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- scripts/makepkg.sh.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 718b4e9..9a41417 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -151,18 +151,23 @@ clean_up() { rm -rf "$pkgdir" "$srcdir" if [[ -n $pkgbase ]]; then local fullver=$(get_full_version) + local logarch=$CARCH + if [[ $arch = "any" ]]; then + logarch="any" + fi + # Can't do this unless the BUILDSCRIPT has been sourced. if (( BUILDFUNC )); then - rm -f "${pkgbase}-${fullver}-${CARCH}-build.log"* + rm -f "${pkgbase}-${fullver}-${logarch}-build.log"* fi if (( CHECKFUNC )); then - rm -f "${pkgbase}-${fullver}-${CARCH}-check.log"* + rm -f "${pkgbase}-${fullver}-${logarch}-check.log"* fi if (( PKGFUNC )); then - rm -f "${pkgbase}-${fullver}-${CARCH}-package.log"* + rm -f "${pkgbase}-${fullver}-${logarch}-package.log"* elif (( SPLITPKG )); then for pkg in ${pkgname[@]}; do - rm -f "${pkgbase}-${fullver}-${CARCH}-package_${pkg}.log"* + rm -f "${pkgbase}-${fullver}-${logarch}-package_${pkg}.log"* done fi @@ -974,7 +979,13 @@ run_function() { local ret=0 if (( LOGGING )); then local fullver=$(get_full_version) - local BUILDLOG="${startdir}/${pkgbase}-${fullver}-${CARCH}-$pkgfunc.log" + + local logarch=$CARCH + if [[ $arch = "any" ]]; then + logarch="any" + fi + + local BUILDLOG="${startdir}/${pkgbase}-${fullver}-${logarch}-$pkgfunc.log" if [[ -f $BUILDLOG ]]; then local i=1 while true; do -- 1.7.10.4
On 20/06/12 07:56, Florian Pritz wrote:
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- scripts/makepkg.sh.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
Mentioned on IRC, but posting here to be on record. This does not handle split packages that have different architectures. Allan
On 06/20/2012 05:28 AM, Allan McRae wrote:
This does not handle split packages that have different architectures.
Split packages use pkgbase rather than pkgname[@] as the name for the logfile, so even if you override arch from within a package function my patch should work. Could someone else take a look? -- Florian Pritz -- {flo,bluewind}@server-speed.net
On 21/06/12 00:31, Florian Pritz wrote:
On 06/20/2012 05:28 AM, Allan McRae wrote:
This does not handle split packages that have different architectures.
Split packages use pkgbase rather than pkgname[@] as the name for the logfile, so even if you override arch from within a package function my patch should work.
Could someone else take a look?
On 21/06/12 00:31, Florian Pritz wrote:> On 06/20/2012 05:28 AM, Allan McRae wrote:
This does not handle split packages that have different architectures.
Split packages use pkgbase rather than pkgname[@] as the name for the logfile, so even if you override arch from within a package function my patch should work.
Could someone else take a look?
What should the log file names be for this PKGBUILD? pkgname=('foo' 'bar') pkgver=1 pkgrel=1 arch=('i686' 'x86_64') package_foo() { : } package_bar() { arch=('any') } What about for this one? pkgname=('foo' 'bar') pkgver=1 pkgrel=1 arch=('any') package_foo() { : } package_bar() { arch=('i686' 'x86_64') } Now... I actually like the actual build arch listed in the log file name. If I have an "arch=any" package that fails only on a certain architecture, it is handy to know what arch it was build on. So I see the current behaviour as a feature and not a bug. Allan
On Wed, Jun 20, 2012 at 10:56 AM, Allan McRae <allan@archlinux.org> wrote:
On 21/06/12 00:31, Florian Pritz wrote:
On 06/20/2012 05:28 AM, Allan McRae wrote:
This does not handle split packages that have different architectures.
Split packages use pkgbase rather than pkgname[@] as the name for the logfile, so even if you override arch from within a package function my patch should work.
Could someone else take a look?
On 21/06/12 00:31, Florian Pritz wrote:> On 06/20/2012 05:28 AM, Allan McRae wrote:
This does not handle split packages that have different architectures.
Split packages use pkgbase rather than pkgname[@] as the name for the logfile, so even if you override arch from within a package function my patch should work.
Could someone else take a look?
What should the log file names be for this PKGBUILD?
pkgname=('foo' 'bar') pkgver=1 pkgrel=1 arch=('i686' 'x86_64')
package_foo() { : }
package_bar() { arch=('any') }
What about for this one?
pkgname=('foo' 'bar') pkgver=1 pkgrel=1 arch=('any')
package_foo() { : }
package_bar() { arch=('i686' 'x86_64') }
Now... I actually like the actual build arch listed in the log file name. If I have an "arch=any" package that fails only on a certain architecture, it is handy to know what arch it was build on. So I see the current behaviour as a feature and not a bug.
Allan
I'm the one who first reported this makepkg behaviour on the pacman IRC channel. My initial problem was simply that it wasn't the filename I would expect. As Allan said, having the actual CARCH of the system that a package was built on might be useful for debugging so I don't mind if we keep the current behaviour. In case we want to change it, I did tested the proposed patch. For unsplitted 'any' arch package it works well: foo-1-1-any-build.log foo-1-1-any-package.log For Allan's first example: As we are building both 'x86_64' and 'any' packages and both package share common build (and check) logs, using $CARCH makes sense here. foo-1-1-x86_64-build.log foo-1-1-x86_64-package_bar.log foo-1-1-x86_64-package_foo.log For Allan's second example: We're basically back to square one with the roles reversed. It would be better to use $CARCH like in the first example. foo-1-1-any-build.log foo-1-1-any-package_bar.log foo-1-1-any-package_foo.log In conclusion, if we decide to change the current behavior, the best way to to do it, IMHO, would be: - use logarch="any" for unsplitted 'any' arch package or splitted package containing only 'any' arch packages. - use logarch=$CARCH in all the other cases. Eric
participants (3)
-
Allan McRae
-
Eric Bélanger
-
Florian Pritz