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 <user> -g <group>  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).
This commit is contained in:
Juan RP 2014-09-24 19:51:17 +02:00
parent b157085af7
commit 1ce278f035
5 changed files with 12 additions and 24 deletions

View file

@ -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)`,

View file

@ -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
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

View file

@ -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
}

View file

@ -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

View file

@ -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