2020-12-18 18:53:10 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# check-install.sh
|
|
|
|
|
|
|
|
export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo
|
|
|
|
|
|
|
|
if [ "$1" != "$XBPS_TARGET_ARCH" ]; then
|
|
|
|
triplet="$(/hostrepo/xbps-src -a "$XBPS_TARGET_ARCH" show-var XBPS_CROSS_TRIPLET)"
|
2023-04-06 20:06:26 +02:00
|
|
|
CONFDIR="-C /usr/$triplet/etc/xbps.d"
|
|
|
|
else
|
|
|
|
CONFDIR="-C /etc/xbps.d"
|
2020-12-18 18:53:10 +01:00
|
|
|
fi
|
|
|
|
|
2023-04-06 20:06:26 +02:00
|
|
|
mkdir /check-install
|
|
|
|
|
|
|
|
mkdir -p /check-install/var/db/xbps/keys
|
|
|
|
cp /var/db/xbps/keys/* /check-install/var/db/xbps/keys/
|
|
|
|
|
2022-10-10 20:17:05 +02:00
|
|
|
ADDREPO="--repository=$HOME/hostdir/binpkgs/bootstrap
|
|
|
|
--repository=$HOME/hostdir/binpkgs
|
|
|
|
--repository=$HOME/hostdir/binpkgs/nonfree"
|
2023-04-06 20:06:26 +02:00
|
|
|
ROOTDIR="-r /check-install"
|
|
|
|
|
|
|
|
xbps-install $ROOTDIR $ADDREPO $CONFDIR -S
|
2020-12-18 18:53:10 +01:00
|
|
|
|
|
|
|
while read -r pkg; do
|
|
|
|
for subpkg in $(xsubpkg $pkg); do
|
|
|
|
/bin/echo -e "\x1b[32mTrying to install dependants of $subpkg:\x1b[0m"
|
|
|
|
for dep in $(xbps-query $ADDREPO -RX "$subpkg"); do
|
|
|
|
xbps-install \
|
2023-04-06 20:06:26 +02:00
|
|
|
$ROOTDIR $ADDREPO $CONFDIR \
|
|
|
|
-ny \
|
2020-12-18 18:53:10 +01:00
|
|
|
"$subpkg" "$(xbps-uhelper getpkgname "$dep")"
|
2023-03-13 02:00:14 +01:00
|
|
|
ret="$?"
|
|
|
|
if [ "$ret" -eq 8 ] || [ "$ret" -eq 11 ]; then
|
2020-12-18 18:53:10 +01:00
|
|
|
/bin/echo -e "\x1b[31mFailed to install '$subpkg' and '$dep'\x1b[0m"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done < /tmp/templates
|