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
|
||||
|
||||
- GNU bash
|
||||
- xbps >= 0.43.1
|
||||
- xbps >= 0.44
|
||||
|
||||
### Quick setup in Void
|
||||
|
||||
|
|
|
@ -145,15 +145,11 @@ chroot_sync_repos() {
|
|||
|
||||
if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then
|
||||
# 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
|
||||
if [ $? -eq 99 ]; then
|
||||
# userns not supported, fallback to uchroot
|
||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
||||
fi
|
||||
else
|
||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install -S
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$XBPS_CROSS_BUILD" ]; then
|
||||
|
@ -164,11 +160,10 @@ chroot_sync_repos() {
|
|||
cp -a $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \
|
||||
$XBPS_MASTERDIR/usr/$XBPS_CROSS_TRIPLET/var/db/xbps/keys
|
||||
# Make sure to sync index for remote repositories.
|
||||
if command -v xbps-uunshare &>/dev/null; then
|
||||
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
||||
xbps-uunshare $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
||||
-r /usr/$XBPS_CROSS_TRIPLET -S
|
||||
else
|
||||
if [ $? -eq 99 ]; then
|
||||
env XBPS_TARGET_ARCH=$XBPS_TARGET_ARCH \
|
||||
xbps-uchroot $XBPS_MASTERDIR /usr/sbin/xbps-install \
|
||||
-r /usr/$XBPS_CROSS_TRIPLET -S
|
||||
|
@ -212,7 +207,6 @@ chroot_handler() {
|
|||
esac
|
||||
|
||||
if [ "$action" = "chroot" ]; then
|
||||
if command -v xbps-uunshare &>/dev/null; then
|
||||
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
||||
rv=$?
|
||||
if [ $rv -eq 99 ]; then
|
||||
|
@ -220,11 +214,6 @@ chroot_handler() {
|
|||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
||||
rv=$?
|
||||
fi
|
||||
else
|
||||
# uunshare not available
|
||||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /bin/xbps-shell
|
||||
rv=$?
|
||||
fi
|
||||
else
|
||||
[ -n "$XBPS_CROSS_BUILD" ] && arg="$arg -a $XBPS_CROSS_BUILD"
|
||||
[ -n "$XBPS_KEEP_ALL" ] && arg="$arg -C"
|
||||
|
@ -240,7 +229,6 @@ chroot_handler() {
|
|||
[ -n "$XBPS_BINPKG_EXISTS" ] && arg="$arg -E"
|
||||
|
||||
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 \
|
||||
xbps-uunshare ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
||||
rv=$?
|
||||
|
@ -250,12 +238,6 @@ chroot_handler() {
|
|||
xbps-uchroot ${_chargs} $XBPS_MASTERDIR /void-packages/xbps-src $action $pkg
|
||||
rv=$?
|
||||
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
|
||||
|
||||
return $rv
|
||||
|
|
4
xbps-src
4
xbps-src
|
@ -337,7 +337,7 @@ read_pkg() {
|
|||
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_SRC_VERSION="113"
|
||||
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.
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue