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:
parent
b157085af7
commit
1ce278f035
|
@ -6,7 +6,6 @@ for the Void Linux distribution.
|
||||||
To start using it first you'll need some external dependencies:
|
To start using it first you'll need some external dependencies:
|
||||||
|
|
||||||
- bash
|
- bash
|
||||||
- fakeroot (only required by the bootstrap target)
|
|
||||||
- xbps >= 0.38
|
- xbps >= 0.38
|
||||||
|
|
||||||
Make sure your user is added to the `xbuilder` group to be able to use `xbps-uchroot(8)`,
|
Make sure your user is added to the `xbuilder` group to be able to use `xbps-uchroot(8)`,
|
||||||
|
|
|
@ -101,13 +101,9 @@ install_pkg_from_repos() {
|
||||||
|
|
||||||
tmplogf=$(mktemp)
|
tmplogf=$(mktemp)
|
||||||
if [ -n "$cross" ]; then
|
if [ -n "$cross" ]; then
|
||||||
$FAKEROOT_CMD $XBPS_INSTALL_XCMD -Ayd "$pkg" >$tmplogf 2>&1
|
$XBPS_INSTALL_XCMD -Ayd "$pkg" >$tmplogf 2>&1
|
||||||
else
|
else
|
||||||
if [ -z "$CHROOT_READY" ]; then
|
$XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1
|
||||||
$XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1
|
|
||||||
else
|
|
||||||
$FAKEROOT_CMD $XBPS_INSTALL_CMD -Ayd "$pkg" >$tmplogf 2>&1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
rval=$?
|
rval=$?
|
||||||
if [ $rval -ne 0 -a $rval -ne 17 ]; then
|
if [ $rval -ne 0 -a $rval -ne 17 ]; then
|
||||||
|
@ -235,7 +231,7 @@ install_pkg_deps() {
|
||||||
iver=$($XBPS_UHELPER_CMD version "${pkgn}")
|
iver=$($XBPS_UHELPER_CMD version "${pkgn}")
|
||||||
if [ $? -eq 0 -a -n "$iver" ]; then
|
if [ $? -eq 0 -a -n "$iver" ]; then
|
||||||
echo " [host] ${_realpkg}: installed ${iver} (unresolved) removing..."
|
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
|
fi
|
||||||
else
|
else
|
||||||
if [ -n "${_exact}" ]; then
|
if [ -n "${_exact}" ]; then
|
||||||
|
|
|
@ -52,13 +52,6 @@ msg_red_nochroot() {
|
||||||
|
|
||||||
msg_error() {
|
msg_error() {
|
||||||
msg_red "$@"
|
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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"
|
XBPS_REMOVE_XCMD="env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH xbps-remove -r /usr/$XBPS_CROSS_TRIPLET"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$FAKEROOT_CMD $XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1
|
$XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n"
|
msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n"
|
||||||
cat $tmplogf && rm -f $tmplogf
|
cat $tmplogf && rm -f $tmplogf
|
||||||
|
|
|
@ -60,13 +60,13 @@ install_pkg() {
|
||||||
[ "$target" = "build" ] && return 0
|
[ "$target" = "build" ] && return 0
|
||||||
|
|
||||||
# Install pkgs into destdir.
|
# 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
|
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
|
done
|
||||||
for subpkg in ${subpackages} ${sourcepkg}; do
|
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
|
done
|
||||||
|
|
||||||
if [ "$XBPS_TARGET_PKG" = "$sourcepkg" ]; then
|
if [ "$XBPS_TARGET_PKG" = "$sourcepkg" ]; then
|
||||||
|
@ -75,7 +75,7 @@ install_pkg() {
|
||||||
|
|
||||||
# If install went ok generate the binpkgs.
|
# If install went ok generate the binpkgs.
|
||||||
for subpkg in ${subpackages} ${sourcepkg}; do
|
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
|
done
|
||||||
|
|
||||||
# pkg cleanup
|
# pkg cleanup
|
||||||
|
@ -126,12 +126,12 @@ remove_pkg_autodeps() {
|
||||||
tmplogf=$(mktemp)
|
tmplogf=$(mktemp)
|
||||||
|
|
||||||
if [ -z "$CHROOT_READY" ]; then
|
if [ -z "$CHROOT_READY" ]; then
|
||||||
$FAKEROOT_CMD xbps-reconfigure -r $XBPS_MASTERDIR -a >> $tmplogf 2>&1
|
xbps-reconfigure -r $XBPS_MASTERDIR -a >> $tmplogf 2>&1
|
||||||
$FAKEROOT_CMD xbps-remove -r $XBPS_MASTERDIR -Ryo >> $tmplogf 2>&1
|
xbps-remove -r $XBPS_MASTERDIR -Ryo >> $tmplogf 2>&1
|
||||||
else
|
else
|
||||||
remove_pkg_cross_deps
|
remove_pkg_cross_deps
|
||||||
$FAKEROOT_CMD xbps-reconfigure -a >> $tmplogf 2>&1
|
xbps-reconfigure -a >> $tmplogf 2>&1
|
||||||
$FAKEROOT_CMD xbps-remove -Ryo >> $tmplogf 2>&1
|
xbps-remove -Ryo >> $tmplogf 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
Loading…
Reference in New Issue