Fixes after tests on the battlefield

This commit is contained in:
Alexandre Aubin 2022-01-10 21:50:21 +01:00
parent ddc6307dd9
commit 93ef7cdf83
5 changed files with 44 additions and 29 deletions

2
.gitignore vendored
View file

@ -1,3 +1,3 @@
chroots/*
.chroots
config/keys/*
gitrepos/*

View file

@ -8,6 +8,6 @@ BUILD_DEB="$HOME_VINAIGRETTE/scripts/build_deb"
REPO_URL="forge.yunohost.org"
REPO_DIR="/var/www/repo/debian"
REPO_CONFIG=$REPO_DIR/config/distributions
REPO_CONFIG=$REPO_DIR/conf/distributions
REPO_ARCHS="$(grep "Architectures" $REPO_CONFIG | head -n 1 | awk -F: '{print $2}' | sed 's/source//g')"

View file

@ -4,14 +4,11 @@ readonly THISSCRIPT=$0
readonly DISTRIB=$1
readonly BRANCH=$2
readonly FOLDER=$3
readonly ARCHS=$4
source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/common.sh
#export DEBSIGN_KEYID
#export DEBFULLNAME
#export DEBEMAIL
# ##### #
# Usage #
# ##### #
@ -27,6 +24,7 @@ Arguments:
<distrib> buster or bullseye
<branch> stable, testing, or unstable
<folder> the folder in which to build...
<archs> list of archs to build (or empty for autodetect). For example: amd63,armhf
EOF
}
@ -46,9 +44,12 @@ function main()
boxed "Building ${PACKAGE} ${VERSION} ..."
if [[ -n "$ARCHS" ]]
then
archs="$(echo $ARCHS | tr ',' ' ')"
# Architecture-agnostic packages have 'architecture: all' in their control files
# others have 'architecture: any'
if grep -q "Architecture: all" $PKG_DIR/debian/control
elif grep -q "Architecture: all" $PKG_DIR/debian/control
then
archs="all"
else
@ -57,18 +58,25 @@ function main()
for arch in $archs
do
sendxmpppy "⏳ Starting build for ${package}/${version} for $DISTRIB/$BRANCH/$ARCH ..."
sendxmpppy "⏳ Starting build for ${PACKAGE}/${VERSION} for $DISTRIB/$BRANCH/$arch ..."
if ! build $arch
then
sendxmpppy "❌ Failed build for ${package}/${version} for $DISTRIB/$BRANCH/$ARCH ?!"
critical "Failed to build ${package}/${version} for $DISTRIB/$BRANCH/$ARCH"
sendxmpppy "❌ Failed build for ${PACKAGE}/${VERSION} for $DISTRIB/$BRANCH/$arch ?!"
critical "Failed to build ${PACKAGE}/${VERSION} for $DISTRIB/$BRANCH/$arch"
fi
if reprepro --waitforlock 6 -b $REPO_DIR -C $BRANCH include $DISTRIB ${ROOT_DIR}/${PACKAGE}_${VERSION}_$arch.changes
if [[ $arch == "all" ]]
then
sendxmpppy "✔️ Completed build for ${package}/${version} for $DISTRIB/$BRANCH/$ARCH."
changearch="amd64"
else
sendxmpppy "❌ Failed to include change of ${package}/${version} for $DISTRIB/$BRANCH/$ARCH ?!"
changearch=$arch
fi
if reprepro --waitforlock 6 -b $REPO_DIR -C $BRANCH include $DISTRIB ${ROOT_DIR}/${PACKAGE}_${VERSION}_$changearch.changes
then
sendxmpppy "✔️ Completed build for ${PACKAGE}/${VERSION} for $DISTRIB/$BRANCH/$arch."
else
sendxmpppy "❌ Failed to include change of ${PACKAGE}/${VERSION} for $DISTRIB/$BRANCH/$arch ?!"
fi
done
}
@ -78,14 +86,24 @@ function build()
{
local arch=$1
if [[ "$arch" == "all" ]]
local opts=""
opts+=" -d $DISTRIB"
opts+=" --no-run-lintian"
opts+=" --no-run-piuparts"
opts+=" --no-run-autopkgtest"
if [[ "$arch" != "all" ]]
then
local arch_opt=""
else
local arch_opt="--host=$arch"
opts+=" --host=$arch"
fi
sbuild $arch_opt -d $DISTRIB # --anything-failed-commands='%s'
if [[ -n "$DEBUG" ]]
then
opts+="--anything-failed-commands='%s'"
fi
sbuild $opts
}

View file

@ -1,11 +1,8 @@
#!/bin/bash
DIST=$1
PREINSTALL="eatmydata,ccache,build-essential,perl-openssl-defaults,debhelper,cmake,wget,devscripts,git,aptitude,debhelper,dh-python,python3-all,python3-yaml,python3-jinja2,python3-setuptools,python3-psutil,lua5.1,liblua5.1-0-dev,libidn11-dev,libssl-dev,txt2man,quilt,npm,nodejs"
mkdir -p /home/vinaigrette/.chroots/
# FIXME : to be replaced with
# sbuild-createchroot --include=eatmydata,ccache $DIST /some/location
# sbuild-createchroot --include=eatmydata,ccache --arch=$ARCH $DIST /some/location
# + check how to preinstall dependencies
sbuild-createchroot --include=$PREINSTALL $DIST /home/vinaigrette/.chroots/$DIST-all

View file

@ -73,7 +73,7 @@ function tweak_gevent-websocket()
function tweak_metronome()
{
readonly VERSION="$(dpkg-parsechangelog -S Version 2>/dev/null)+ynh$DISTRIB_N-1"
readonly VERSION="$(dpkg-parsechangelog -S Version 2>/dev/null)+ynh$DISTRIB_N"
}
function build()