From a573160e1568b048e2221b4fcca141e1c22e2cea Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 7 Feb 2020 22:24:00 +0000 Subject: [PATCH] Tweak build chain to support buster builds --- config/config | 2 +- config/distributions | 14 ++++++++++++++ config/rebuildd.conf | 2 +- config/rebuildd.default | 2 +- daily-build | 17 ++++++++++------- images/make-images | 19 +++++++++++-------- init.sh | 2 +- scripts/build_deb | 4 ++-- scripts/pbuilder/hooks/E01apt-preferences | 16 ---------------- scripts/repo/include-changes | 8 ++++++++ 10 files changed, 49 insertions(+), 37 deletions(-) delete mode 100644 scripts/pbuilder/hooks/E01apt-preferences diff --git a/config/config b/config/config index 4c894b0..f566ccd 100644 --- a/config/config +++ b/config/config @@ -10,7 +10,7 @@ REPO_URL="forge.yunohost.org" # Codenames, components and architectures -AVAILABLE_CODENAMES="stretch" +AVAILABLE_CODENAMES="stretch buster" AVAILABLE_COMPONENTS="stable testing unstable extra" AVAILABLE_ARCH="amd64 i386 armel armhf arm64" diff --git a/config/distributions b/config/distributions index 85d5df1..452ca34 100644 --- a/config/distributions +++ b/config/distributions @@ -11,3 +11,17 @@ SignWith: 59A3E6FF Tracking: all includechanges keepsources Log: logfile --changes --via=include /home/vinaigrette/scripts/repo/process-include + +Origin: YunoHost +Label: YunoHost for Buster +Suite: stable +Codename: buster +Version: 10.0 +Architectures: i386 amd64 armel armhf arm64 source +Components: stable testing unstable extra +AlsoAcceptFor: buster-stable buster-testing buster-unstable stable testing unstable +Description: YunoHost repository for Debian Buster +SignWith: 59A3E6FF +Tracking: all includechanges keepsources +Log: logfile + --changes --via=include /home/vinaigrette/scripts/repo/process-include diff --git a/config/rebuildd.conf b/config/rebuildd.conf index 2af0422..f5ece72 100644 --- a/config/rebuildd.conf +++ b/config/rebuildd.conf @@ -6,7 +6,7 @@ kill_timeout = 90 source_cmd = /home/vinaigrette/scripts/rebuildd/get-sources ${d} ${p} ${v} build_cmd = /home/vinaigrette/scripts/rebuildd/build-binaries ${d} ${p} ${v} ${a} post_build_cmd = /home/vinaigrette/scripts/rebuildd/upload-binaries ${d} ${p} ${v} ${a} ${j} -dists = stretch +dists = stretch buster work_dir = /var/cache/rebuildd/build database_uri = sqlite:///var/lib/rebuildd/rebuildd.db build_more_recent = 1 diff --git a/config/rebuildd.default b/config/rebuildd.default index 4b56bc6..4506779 100644 --- a/config/rebuildd.default +++ b/config/rebuildd.default @@ -4,5 +4,5 @@ PBUILDER_BIN=/usr/sbin/pbuilder PBUILDER_CACHE_PATH="/var/cache/pbuilder" PBUILDER_MIRROR=https://ftp.debian.org/debian ARCHS="amd64 i386 armel armhf arm64" -DISTS="stretch" +DISTS="stretch buster" ENABLE_BUILDER_MAINT=1 diff --git a/daily-build b/daily-build index 386224c..0d0aedb 100755 --- a/daily-build +++ b/daily-build @@ -2,7 +2,7 @@ readonly THISSCRIPT=$0 readonly BRANCH_NIGHTLY="unstable" -readonly DISTRIB="stretch" +readonly DISTRIBS="buster" readonly TIMETAG="$(date +%Y%m%d%H%M)" readonly PACKAGES="moulinette SSOwat yunohost yunohost-admin" readonly FORCE="false" @@ -21,11 +21,13 @@ function main() for PACKAGE in $PACKAGES; do + for DISTRIB in $DISTRIBS; + do + echo "-------------------------------------" + echo "Looking for update in ${PACKAGE} for ${DISTRIB}... " - echo "-------------------------------------" - echo "Looking for update in ${PACKAGE} ... " - - build_if_needed $PACKAGE + build_if_needed $PACKAGE $DISTRIB + done done echo "-------------------------------------" @@ -35,6 +37,7 @@ function main() function build_if_needed() { local PACKAGE=$1 + local DISTRIB=$2 cd $GIT_REPOS/$PACKAGE @@ -43,13 +46,13 @@ function build_if_needed() # Check if there's a branch named distrib-branch (e.g. stretch-unstable) # By default, keep just 'branch' BRANCH_NIGHTLY_GIT="$BRANCH_NIGHTLY" - if git branch --list | tr '*' ' ' | awk '{print $1}' | grep -q "^$DISTRIB-$BRANCH_NIGHTLY$" + if git branch -ar | grep -q origin/$DISTRIB-$BRANCH_NIGHTLY then BRANCH_NIGHTLY_GIT="$DISTRIB-$BRANCH_NIGHTLY" fi # If the branch name is an alias to another branch, "resolve" the alias - if grep -q "ref: " .git/refs/heads/$BRANCH_NIGHTLY_GIT + if grep -q "ref: " .git/refs/heads/$BRANCH_NIGHTLY_GIT 2>/dev/null then BRANCH_NIGHTLY_GIT=$(cat .git/refs/heads/$BRANCH_NIGHTLY_GIT | tr '/' ' ' | awk '{print $4}') fi diff --git a/images/make-images b/images/make-images index 0ec3616..c455570 100755 --- a/images/make-images +++ b/images/make-images @@ -1,8 +1,10 @@ #!/bin/bash -readonly DISTRIB=stretch +# For some reason, building images for buster from stretch requires libdebian-installer4 0.119 instead of 0.110, c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904699 ... installed it by manually downloading and dpkg -i the .deb +readonly DISTRIB=buster readonly INIT_DIR=$PWD -readonly ARCHS="amd64 i386 armhf armel arm64" +readonly ARCHS="amd64" +#readonly ARCHS="amd64 i386 armhf armel arm64" function main() { @@ -27,18 +29,19 @@ function build_image() cp /usr/bin/qemu-aarch64-static $CHROOT/usr/bin/ cp /etc/resolv.conf $CHROOT/etc/resolv.conf - chroot $CHROOT apt-get update - chroot $CHROOT apt-get dist-upgrade - chroot $CHROOT apt-get install -y build-essential debhelper cmake wget devscripts + chroot $CHROOT apt update + chroot $CHROOT apt dist-upgrade + chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts if [ "$ARCH" == "amd64" ]; then - chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_4.x + #chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_4.x + chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_6.x chroot $CHROOT bash /tmp/setup_nodejs - chroot $CHROOT apt-get install -y nodejs + chroot $CHROOT apt install -y nodejs fi - chroot $CHROOT apt-get clean + chroot $CHROOT apt clean cd $CHROOT tar -czf $INIT_DIR/${DISTRIB}-${ARCH}.tgz ./* diff --git a/init.sh b/init.sh index 0d87bfd..a8d6538 100755 --- a/init.sh +++ b/init.sh @@ -53,7 +53,7 @@ cat $VINAIGRETTE_HOME/config/sources.list > /etc/apt/sources.list.d/vinaigrette. sed -i "s/__REPO_URL__/$REPO_URL/g" /etc/nginx/sites-enabled/repo.conf sed -i "s/__REPO_URL__/$REPO_URL/g" /etc/apt/sources.list.d/vinaigrette.list -echo "deb https://deb.nodesource.com/node_4.x stretch main" >> /etc/apt/sources.list +echo "deb https://deb.nodesource.com/node_6.x stretch main" >> /etc/apt/sources.list echo "127.0.0.1 $REPO_URL" >> /etc/hosts service nginx reload diff --git a/scripts/build_deb b/scripts/build_deb index 17805d3..eef21dc 100755 --- a/scripts/build_deb +++ b/scripts/build_deb @@ -26,7 +26,7 @@ Usage: $THISSCRIPT Arguments: - stretch (can only build for stretch, no jessie) + stretch or buster stable, testing, or unstable the folder in which to build... EOF @@ -50,7 +50,7 @@ function main() function validate_arguments() { - [[ $DISTRIB =~ ^stretch$ ]] || critical "Invalid distribution $DISTRIB" + [[ $DISTRIB =~ ^stretch|buster$ ]] || critical "Invalid distribution $DISTRIB" [[ $BRANCH =~ ^testing|stable|unstable$ ]] || critical "Invalid branch $BRANCH" [[ ! -z "$FOLDER" ]] || critical "Need a folder in which to build" } diff --git a/scripts/pbuilder/hooks/E01apt-preferences b/scripts/pbuilder/hooks/E01apt-preferences deleted file mode 100644 index cf74d9e..0000000 --- a/scripts/pbuilder/hooks/E01apt-preferences +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -if $(cat "/etc/apt/sources.list" | grep -q "wheezy-backports"); then - echo "Adding pin preferences for wheezy-backports" - cat > "/etc/apt/preferences.d/wheezy-backports" << EOF -Package: dh-python dh-systemd devscripts -Pin: release a=wheezy-backports -Pin-Priority: 999 -EOF -else - if [ -f /etc/apt/preferences.d/wheezy-backports ]; then - rm -vf /etc/apt/preferences.d/wheezy-backports - fi -fi diff --git a/scripts/repo/include-changes b/scripts/repo/include-changes index eb03c1e..beeaade 100755 --- a/scripts/repo/include-changes +++ b/scripts/repo/include-changes @@ -7,6 +7,14 @@ changes_file=$3 source /home/vinaigrette/config/config source /home/vinaigrette/scripts/package_helpers.sh +# Fucking ugly manual patch because when building packages for buster, the Binary: field is missing... +if ! grep -q "Binary:" $changes_file +then + # We take is from the .dsc file + DSC=$(echo $changes_file | sed 's/_source.changes/.dsc/g') + echo $(grep "Binary:" $DSC) >> $changes_file +fi + sudo reprepro -C $distribution -V -b $REPO_DIR include $codename $changes_file RET=$?