From 764548d00cbaaec3e8904de714ef30318a4c330a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Fri, 18 Dec 2020 16:22:32 -0300 Subject: [PATCH 1/2] xbps-src: source cross profiles in show-var when using -a switch. This allows the user to query for variables such as XBPS_CROSS_TRIPLET, which are only available in a cross-build context. --- xbps-src | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xbps-src b/xbps-src index 54016874010..83729a9c2c0 100755 --- a/xbps-src +++ b/xbps-src @@ -902,7 +902,11 @@ case "$XBPS_TARGET" in for f in ${XBPS_COMMONDIR}/environment/setup/*.sh; do source $f done - source ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh + if [ "$XBPS_CROSS_BUILD" ]; then + source ${XBPS_COMMONDIR}/cross-profiles/${XBPS_CROSS_BUILD}.sh + else + source ${XBPS_COMMONDIR}/build-profiles/${XBPS_MACHINE}.sh + fi eval value="\${$XBPS_TARGET_PKG}" echo $value ;; From 449315aa733d3f97d451830a3333576441281e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Fri, 18 Dec 2020 14:53:10 -0300 Subject: [PATCH 2/2] .github/workflows: add script to check that packages can still be installed. This will allow us to confirm the repository's staging state in CI. --- .github/workflows/build.yaml | 8 ++++++++ common/travis/check-install.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 common/travis/check-install.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index be2fd7969db..72f2b3811a3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -87,3 +87,11 @@ jobs: cd / "$here/common/travis/show_files.sh" "$BOOTSTRAP" "$ARCH" ) + + - name: Verify repository state + run: | + ( + here="$(pwd)" + cd / + "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH" + ) diff --git a/common/travis/check-install.sh b/common/travis/check-install.sh new file mode 100755 index 00000000000..d9725670002 --- /dev/null +++ b/common/travis/check-install.sh @@ -0,0 +1,28 @@ +#!/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)" + ROOTDIR="-r /usr/$triplet" +fi + +ADDREPO="--repository=$HOME/hostdir/binpkgs --repository=$HOME/hostdir/binpkgs/nonfree" + +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 \ + $ROOTDIR $ADDREPO \ + -Sny \ + "$subpkg" "$(xbps-uhelper getpkgname "$dep")" + if [ $? -eq 8 ]; then + /bin/echo -e "\x1b[31mFailed to install '$subpkg' and '$dep'\x1b[0m" + exit 1 + fi + done + done +done < /tmp/templates