From f6a08062293953d7ec01414192fe28330d5c3f94 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 8 May 2010 09:46:23 +0200 Subject: [PATCH] xbps-src: piping with tee(1) and groupping command is not possible sometimes... --- xbps-src/shutils/build_funcs.sh | 7 +++---- xbps-src/shutils/buildvars_funcs.sh | 5 +++-- xbps-src/shutils/chroot.sh.in | 8 ++++---- xbps-src/shutils/configure_funcs.sh | 19 ++++++++----------- xbps-src/shutils/pkgtarget_funcs.sh.in | 12 ++++++------ 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index 73d5b018af2..1a5797efd36 100644 --- a/xbps-src/shutils/build_funcs.sh +++ b/xbps-src/shutils/build_funcs.sh @@ -72,10 +72,9 @@ build_src_phase() # # Build package via make. # - { ${make_cmd} ${makejobs} ${make_build_args} \ - ${make_build_target} \ - 2>&1 | tee ${wrksrc}/.xbps_make_build.log; } || \ - msg_error "$pkgname: build phase failed! check $wrksrc/.xbps_make_build.log" + ${make_cmd} ${makejobs} ${make_build_args} \ + ${make_build_target} || + msg_error "$pkgname: build phase failed!" fi # Run post_build func. diff --git a/xbps-src/shutils/buildvars_funcs.sh b/xbps-src/shutils/buildvars_funcs.sh index 73245484ae5..087060a3a04 100644 --- a/xbps-src/shutils/buildvars_funcs.sh +++ b/xbps-src/shutils/buildvars_funcs.sh @@ -33,9 +33,10 @@ set_build_vars() if [ -z "$in_chroot" ]; then SAVE_LDLIBPATH=$LD_LIBRARY_PATH if [ -d /usr/lib/libfakeroot ]; then - LDLIBPATH="/usr/lib/libfakeroot" + LD_LIBRARY_PATH="/usr/lib/libfakeroot:$XBPS_MASTERDIR/usr/lib" + else + LD_LIBRARY_PATH="$XBPS_MASTERDIR/usr/lib" fi - LD_LIBRARY_PATH="$LDLIBPATH:$XBPS_MASTERDIR/usr/lib:$LD_LIBRARY_PATH" PKG_CONFIG="$XBPS_MASTERDIR/usr/bin/pkg-config" PKG_CONFIG_LIBDIR="$XBPS_MASTERDIR/usr/lib/pkgconfig" LDFLAGS="-L$XBPS_MASTERDIR/usr/lib" diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index a0aba64d579..9f42bf470fe 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -237,8 +237,8 @@ xbps_chroot_handler() create_busybox_links install_xbps_utils - { MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ - @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount; } + MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ + @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount [ $? -ne 0 ] && return $? if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then @@ -266,8 +266,8 @@ xbps_chroot_handler() fi msg_normal "Exiting from the chroot on $XBPS_MASTERDIR." - { MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ - @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount; } + MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ + @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount return $? } diff --git a/xbps-src/shutils/configure_funcs.sh b/xbps-src/shutils/configure_funcs.sh index c1e7bcfdd86..309fecad314 100644 --- a/xbps-src/shutils/configure_funcs.sh +++ b/xbps-src/shutils/configure_funcs.sh @@ -1,5 +1,5 @@ #- -# Copyright (c) 2008-2009 Juan Romero Pardines. +# Copyright (c) 2008-2010 Juan Romero Pardines. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -29,7 +29,7 @@ # configure_src_phase() { - local f lver + local f lver error=0 [ -z $pkgname ] && return 1 @@ -83,17 +83,15 @@ configure_src_phase() # # Packages using GNU autoconf # - { ${configure_script} --prefix=/usr --sysconfdir=/etc \ + ${configure_script} --prefix=/usr --sysconfdir=/etc \ --infodir=/usr/share/info --mandir=/usr/share/man \ - ${configure_args} 2>&1 \ - | tee ${wrksrc}/.xbps_configure.log; } || \ - msg_error "$pkgname: configure failed! check ${wrksrc}/.xbps_configure.log" + ${configure_args} || error=$? ;; configure) # # Packages using custom configure scripts. # - ${configure_script} ${configure_args} + ${configure_script} ${configure_args} || error=$? ;; perl-module|perl_module) # @@ -101,8 +99,7 @@ configure_src_phase() # They are all handled by the helper perl-module.sh. # . $XBPS_HELPERSDIR/perl-module.sh - { perl_module_build $pkgname; } \ - 2>&1 | tee ${wrksrc}/.xbps_configure.log + perl_module_build $pkgname || error=$? ;; *) # @@ -113,8 +110,8 @@ configure_src_phase() ;; esac - if [ "$build_style" != "perl_module" -a "$?" -ne 0 ]; then - msg_error "building $pkg (configure phase)." + if [ "$build_style" != "perl_module" -a "$error" -ne 0 ]; then + msg_error "$pkgname: configure stage failed!" fi # Run post_configure func. diff --git a/xbps-src/shutils/pkgtarget_funcs.sh.in b/xbps-src/shutils/pkgtarget_funcs.sh.in index b2b4e782836..650557fcd0f 100644 --- a/xbps-src/shutils/pkgtarget_funcs.sh.in +++ b/xbps-src/shutils/pkgtarget_funcs.sh.in @@ -82,25 +82,25 @@ install_pkg() if [ ! -f "$XBPS_EXTRACT_DONE" ]; then . $XBPS_SHUTILSDIR/extract_funcs.sh - extract_distfiles + extract_distfiles || return $? fi if [ ! -f "$XBPS_CONFIGURE_DONE" ]; then . $XBPS_SHUTILSDIR/configure_funcs.sh - configure_src_phase + configure_src_phase || return $? fi if [ ! -f "$XBPS_BUILD_DONE" ]; then . $XBPS_SHUTILSDIR/build_funcs.sh - build_src_phase + build_src_phase || return $? fi # Install pkg into destdir. - { env xbps_machine=${xbps_machine} MASTERDIR=${_MASTERDIR} \ + env xbps_machine=${xbps_machine} MASTERDIR=${_MASTERDIR} \ dontrm_builddir=${dontrm_builddir} \ ${fakeroot_cmd} ${fakeroot_cmd_args} \ @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-doinst-helper \ - ${curpkgn}; } || exit $? + ${curpkgn} || return $? # Always write metadata to package's destdir. . $XBPS_SHUTILSDIR/metadata.sh @@ -110,7 +110,7 @@ install_pkg() # Stow package into masterdir. . $XBPS_SHUTILSDIR/stow_funcs.sh - stow_pkg_handler stow + stow_pkg_handler stow || return $? } #