From a86b30ba059e5c4509b3dd25d514d5f515e04b26 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 23 Mar 2015 16:05:17 +0100 Subject: [PATCH] xbps-src: fix remaining issues with -N and -a. --- common/xbps-src/libexec/build.sh | 5 ++--- common/xbps-src/shutils/chroot.sh | 28 ++++++++++++++-------------- common/xbps-src/shutils/cross.sh | 10 ++-------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/common/xbps-src/libexec/build.sh b/common/xbps-src/libexec/build.sh index 9d8a3335274..6bae7d93749 100755 --- a/common/xbps-src/libexec/build.sh +++ b/common/xbps-src/libexec/build.sh @@ -29,10 +29,9 @@ show_pkg_build_options check_pkg_arch $XBPS_CROSS_BUILD if [ -z "$XBPS_CROSS_PREPARE" ]; then - install_cross_pkg $XBPS_CROSS_BUILD || exit $? - prepare_cross_sysroot $XBPS_CROSS_BUILD || exit $? + install_cross_pkg $XBPS_CROSS_BUILD + prepare_cross_sysroot $XBPS_CROSS_BUILD fi - # Install dependencies from binary packages if [ "$PKGNAME" != "$TARGET_PKG" -o -z "$XBPS_SKIP_DEPS" ]; then install_pkg_deps $PKGNAME $TARGET_PKG pkg $XBPS_CROSS_BUILD $XBPS_CROSS_PREPARE || exit $? diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index a1490fbb3cc..f6801429133 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -136,11 +136,11 @@ chroot_sync_repos() { # Copy host repos to the cross root. if [ -n "$XBPS_CROSS_BUILD" ]; then - rm -rf $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/etc/xbps.d - mkdir -p $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/etc/xbps.d + rm -rf $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d + mkdir -p $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d cp ${XBPS_MASTERDIR}/etc/xbps.d/*.conf \ - $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/etc/xbps.d - rm -f $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/etc/xbps.d/*-x86_64.conf + $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d + rm -f $XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d/*-x86_64.conf fi if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then @@ -154,19 +154,19 @@ chroot_sync_repos() { if [ -n "$XBPS_CROSS_BUILD" ]; then # Copy host keys to the target rootdir. - if [ ! -d $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys ]; then - mkdir -p $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys - fi + mkdir -p $XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys cp -a $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \ - $XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys + $XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys # Make sure to sync index for remote repositories. - env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \ - xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install \ - -r /usr/$XBPS_CROSS_TRIPLET -S - if [ $? -eq 99 ]; then + if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \ - xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install \ - -r /usr/$XBPS_CROSS_TRIPLET -S + xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install \ + -r $XBPS_CROSS_BASE -S + if [ $? -eq 99 ]; then + env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \ + xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install \ + -r $XBPS_CROSS_BASE -S + fi fi fi diff --git a/common/xbps-src/shutils/cross.sh b/common/xbps-src/shutils/cross.sh index f04bdbb9888..317ff795b36 100644 --- a/common/xbps-src/shutils/cross.sh +++ b/common/xbps-src/shutils/cross.sh @@ -27,12 +27,6 @@ prepare_cross_sysroot() { [ -z "$cross" -o "$cross" = "" ] && return 0 - if [ ! -d ${XBPS_CROSS_BASE}/var/db/xbps/keys ]; then - mkdir -p ${XBPS_CROSS_BASE}/var/db/xbps/keys - cp ${XBPS_MASTERDIR}/var/db/xbps/keys/*.plist \ - ${XBPS_CROSS_BASE}/var/db/xbps/keys - fi - # Check for cross-vpkg-dummy available for the target arch, otherwise build it. pkg_available cross-vpkg-dummy $cross if [ $? -eq 0 ]; then @@ -41,7 +35,7 @@ prepare_cross_sysroot() { errlog=$(mktemp) msg_normal "Installing $cross cross pkg: cross-vpkg-dummy ...\n" - $XBPS_INSTALL_XCMD -r $XBPS_CROSS_BASE -SAyd cross-vpkg-dummy &>$errlog + $XBPS_INSTALL_XCMD -SAyd cross-vpkg-dummy &>$errlog rval=$? if [ $rval -ne 0 -a $rval -ne 17 ]; then msg_red "failed to install cross-vpkg-dummy (error $rval)\n" @@ -60,13 +54,13 @@ install_cross_pkg() { [ -z "$cross" -o "$cross" = "" ] && return 0 # Check if the cross compiler pkg is available in repos, otherwise build it. - msg_normal "Installing $cross cross compiler: cross-${XBPS_CROSS_TRIPLET} ...\n" pkg_available cross-${XBPS_CROSS_TRIPLET} rval=$? if [ $rval -eq 0 ]; then $XBPS_LIBEXECDIR/build.sh cross-${XBPS_CROSS_TRIPLET} cross-${XBPS_CROSS_TRIPLET} pkg || return $rval fi + msg_normal "Installing $cross cross compiler: cross-${XBPS_CROSS_TRIPLET} ...\n" errlog=$(mktemp) $XBPS_INSTALL_CMD -Syd cross-${XBPS_CROSS_TRIPLET} &>$errlog rval=$?