From 1ce278f0352f14379824befc91040226d39aec4b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 24 Sep 2014 19:51:17 +0200 Subject: [PATCH] xbps-src: drop fakeroot; xbps-create(8) is our friend. - This should work for almost 90% current packages, as reported by OpenBSD/ports. - Packages that use install -o -g will get fixed progressively. - xbps-create(8) by default sets pkg files as 0:0, if any pkg needs special permissions those can be set via INSTALL scripts (for now). --- README.md | 1 - common/xbps-src/shutils/build_dependencies.sh | 10 +++------- common/xbps-src/shutils/common.sh | 7 ------- common/xbps-src/shutils/cross.sh | 2 +- common/xbps-src/shutils/pkgtarget.sh | 16 ++++++++-------- 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index b1d0cb0a70d..1d03716bb38 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ for the Void Linux distribution. To start using it first you'll need some external dependencies: - bash -- fakeroot (only required by the bootstrap target) - xbps >= 0.38 Make sure your user is added to the `xbuilder` group to be able to use `xbps-uchroot(8)`, diff --git a/common/xbps-src/shutils/build_dependencies.sh b/common/xbps-src/shutils/build_dependencies.sh index a8ae113b514..918e27b1609 100644 --- a/common/xbps-src/shutils/build_dependencies.sh +++ b/common/xbps-src/shutils/build_dependencies.sh @@ -101,13 +101,9 @@ install_pkg_from_repos() { tmplogf=$(mktemp) if [ -n "$cross" ]; then - $FAKEROOT_CMD $XBPS_INSTALL_XCMD -Ayd "$pkg" >$tmplogf 2>&1 + $XBPS_INSTALL_XCMD -Ayd "$pkg" >$tmplogf 2>&1 else - if [ -z "$CHROOT_READY" ]; then - $XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1 - else - $FAKEROOT_CMD $XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1 - fi + $XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1 fi rval=$? if [ $rval -ne 0 -a $rval -ne 17 ]; then @@ -235,7 +231,7 @@ install_pkg_deps() { iver=$($XBPS_UHELPER_CMD version "${pkgn}") if [ $? -eq 0 -a -n "$iver" ]; then echo " [host] ${_realpkg}: installed ${iver} (unresolved) removing..." - $FAKEROOT_CMD $XBPS_REMOVE_CMD -iyf $pkgn >/dev/null 2>&1 + $XBPS_REMOVE_CMD -iyf $pkgn >/dev/null 2>&1 fi else if [ -n "${_exact}" ]; then diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index a94a29e4642..ed1e87a9a0e 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -52,13 +52,6 @@ msg_red_nochroot() { msg_error() { msg_red "$@" - kill -INT $$; exit 1 -} - -msg_error_nochroot() { - [ -n "$NOCOLORS" ] || printf >&2 "\033[1m\033[31m" - printf >&2 "=> ERROR: $@" - [ -n "$NOCOLORS" ] || printf >&2 "\033[m" exit 1 } diff --git a/common/xbps-src/shutils/cross.sh b/common/xbps-src/shutils/cross.sh index aebf873003e..0846ca4503b 100644 --- a/common/xbps-src/shutils/cross.sh +++ b/common/xbps-src/shutils/cross.sh @@ -13,7 +13,7 @@ remove_pkg_cross_deps() { XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH xbps-remove -r /usr/$XBPS_CROSS_TRIPLET" fi - $FAKEROOT_CMD $XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1 + $XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1 if [ $? -ne 0 ]; then msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n" cat $tmplogf && rm -f $tmplogf diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh index 6ef322fcec9..d36240481bd 100644 --- a/common/xbps-src/shutils/pkgtarget.sh +++ b/common/xbps-src/shutils/pkgtarget.sh @@ -60,13 +60,13 @@ install_pkg() { [ "$target" = "build" ] && return 0 # Install pkgs into destdir. - $FAKEROOT_CMD $XBPS_LIBEXECDIR/xbps-src-doinstall.sh $sourcepkg $cross || exit 1 + $XBPS_LIBEXECDIR/xbps-src-doinstall.sh $sourcepkg $cross || exit 1 for subpkg in ${subpackages} ${sourcepkg}; do - $FAKEROOT_CMD $XBPS_LIBEXECDIR/xbps-src-doinstall.sh $subpkg $cross || exit 1 + $XBPS_LIBEXECDIR/xbps-src-doinstall.sh $subpkg $cross || exit 1 done for subpkg in ${subpackages} ${sourcepkg}; do - $FAKEROOT_CMD $XBPS_LIBEXECDIR/xbps-src-prepkg.sh $subpkg $cross || exit 1 + $XBPS_LIBEXECDIR/xbps-src-prepkg.sh $subpkg $cross || exit 1 done if [ "$XBPS_TARGET_PKG" = "$sourcepkg" ]; then @@ -75,7 +75,7 @@ install_pkg() { # If install went ok generate the binpkgs. for subpkg in ${subpackages} ${sourcepkg}; do - $FAKEROOT_CMD $XBPS_LIBEXECDIR/xbps-src-dopkg.sh $subpkg "$XBPS_REPOSITORY" "$cross" || exit 1 + $XBPS_LIBEXECDIR/xbps-src-dopkg.sh $subpkg "$XBPS_REPOSITORY" "$cross" || exit 1 done # pkg cleanup @@ -126,12 +126,12 @@ remove_pkg_autodeps() { tmplogf=$(mktemp) if [ -z "$CHROOT_READY" ]; then - $FAKEROOT_CMD xbps-reconfigure -r $XBPS_MASTERDIR -a >> $tmplogf 2>&1 - $FAKEROOT_CMD xbps-remove -r $XBPS_MASTERDIR -Ryo >> $tmplogf 2>&1 + xbps-reconfigure -r $XBPS_MASTERDIR -a >> $tmplogf 2>&1 + xbps-remove -r $XBPS_MASTERDIR -Ryo >> $tmplogf 2>&1 else remove_pkg_cross_deps - $FAKEROOT_CMD xbps-reconfigure -a >> $tmplogf 2>&1 - $FAKEROOT_CMD xbps-remove -Ryo >> $tmplogf 2>&1 + xbps-reconfigure -a >> $tmplogf 2>&1 + xbps-remove -Ryo >> $tmplogf 2>&1 fi if [ $? -ne 0 ]; then