Require xbps>=0.44 for xbps-uunshare(8) to simplify code.
This commit is contained in:
parent
d694d022d1
commit
5c177c7b67
3 changed files with 19 additions and 37 deletions
|
@ -15,7 +15,7 @@ are isolated (among others).
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- GNU bash
|
- GNU bash
|
||||||
- xbps >= 0.43.1
|
- xbps >= 0.44
|
||||||
|
|
||||||
### Quick setup in Void
|
### Quick setup in Void
|
||||||
|
|
||||||
|
|
|
@ -145,15 +145,11 @@ chroot_sync_repos() {
|
||||||
|
|
||||||
if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then
|
if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then
|
||||||
# Make sure to sync index for remote repositories.
|
# Make sure to sync index for remote repositories.
|
||||||
if command -v xbps-uunshare &>/dev/null; then
|
|
||||||
xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
||||||
if [ $? -eq 99 ]; then
|
if [ $? -eq 99 ]; then
|
||||||
# userns not supported, fallback to uchroot
|
# userns not supported, fallback to uchroot
|
||||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$XBPS_CROSS_BUILD" ]; then
|
if [ -n "$XBPS_CROSS_BUILD" ]; then
|
||||||
|
@ -164,11 +160,10 @@ chroot_sync_repos() {
|
||||||
cp -a $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \
|
cp -a $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \
|
||||||
$XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys
|
$XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys
|
||||||
# Make sure to sync index for remote repositories.
|
# Make sure to sync index for remote repositories.
|
||||||
if command -v xbps-uunshare &>/dev/null; then
|
|
||||||
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
||||||
xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
||||||
-r /usr/$XBPS_CROSS_TRIPLET -S
|
-r /usr/$XBPS_CROSS_TRIPLET -S
|
||||||
else
|
if [ $? -eq 99 ]; then
|
||||||
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
||||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
||||||
-r /usr/$XBPS_CROSS_TRIPLET -S
|
-r /usr/$XBPS_CROSS_TRIPLET -S
|
||||||
|
@ -212,7 +207,6 @@ chroot_handler() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$action" = "chroot" ]; then
|
if [ "$action" = "chroot" ]; then
|
||||||
if command -v xbps-uunshare &>/dev/null; then
|
|
||||||
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
||||||
rv=$?
|
rv=$?
|
||||||
if [ $rv -eq 99 ]; then
|
if [ $rv -eq 99 ]; then
|
||||||
|
@ -220,11 +214,6 @@ chroot_handler() {
|
||||||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
||||||
rv=$?
|
rv=$?
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
# uunshare not available
|
|
||||||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
|
||||||
rv=$?
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
[ -n "$XBPS_CROSS_BUILD" ] && arg="$arg -a $XBPS_CROSS_BUILD"
|
[ -n "$XBPS_CROSS_BUILD" ] && arg="$arg -a $XBPS_CROSS_BUILD"
|
||||||
[ -n "$XBPS_KEEP_ALL" ] && arg="$arg -C"
|
[ -n "$XBPS_KEEP_ALL" ] && arg="$arg -C"
|
||||||
|
@ -240,7 +229,6 @@ chroot_handler() {
|
||||||
[ -n "$XBPS_BINPKG_EXISTS" ] && arg="$arg -E"
|
[ -n "$XBPS_BINPKG_EXISTS" ] && arg="$arg -E"
|
||||||
|
|
||||||
action="$arg $action"
|
action="$arg $action"
|
||||||
if command -v xbps-uunshare &>/dev/null; then
|
|
||||||
env -i PATH="/usr/bin:/usr/sbin:$PATH" HOME=/tmp IN_CHROOT=1 LANG=en_US.UTF-8 \
|
env -i PATH="/usr/bin:/usr/sbin:$PATH" HOME=/tmp IN_CHROOT=1 LANG=en_US.UTF-8 \
|
||||||
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
||||||
rv=$?
|
rv=$?
|
||||||
|
@ -250,12 +238,6 @@ chroot_handler() {
|
||||||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
||||||
rv=$?
|
rv=$?
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
# uunshare not available
|
|
||||||
env -i PATH="/usr/bin:/usr/sbin:$PATH" HOME=/tmp IN_CHROOT=1 LANG=en_US.UTF-8 \
|
|
||||||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
|
||||||
rv=$?
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $rv
|
return $rv
|
||||||
|
|
4
xbps-src
4
xbps-src
|
@ -337,7 +337,7 @@ read_pkg() {
|
||||||
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
|
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly XBPS_VERSION_REQ="0.43.1"
|
readonly XBPS_VERSION_REQ="0.44"
|
||||||
readonly XBPS_VERSION=$(xbps-uhelper -V|awk '{print $2}')
|
readonly XBPS_VERSION=$(xbps-uhelper -V|awk '{print $2}')
|
||||||
readonly XBPS_SRC_VERSION="113"
|
readonly XBPS_SRC_VERSION="113"
|
||||||
export XBPS_MACHINE=$(uname -m)
|
export XBPS_MACHINE=$(uname -m)
|
||||||
|
@ -384,7 +384,7 @@ readonly REQHOST_UTILS_BOOTSTRAP="gawk bash bison sed gcc g++ msgfmt makeinfo \
|
||||||
|
|
||||||
# Required utilities in host system for chroot ops.
|
# Required utilities in host system for chroot ops.
|
||||||
readonly REQHOST_UTILS="xbps-install xbps-query xbps-rindex xbps-uhelper \
|
readonly REQHOST_UTILS="xbps-install xbps-query xbps-rindex xbps-uhelper \
|
||||||
xbps-reconfigure xbps-remove xbps-create git"
|
xbps-reconfigure xbps-remove xbps-create xbps-uchroot xbps-uunshare git"
|
||||||
|
|
||||||
check_reqhost_utils
|
check_reqhost_utils
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue