]> git.ipfire.org Git - thirdparty/systemd.git/blame - semaphoreci/gcc-compilation.sh
Merge pull request #12155 from yuwata/network-fix-and-extend-foo-over-udp-support
[thirdparty/systemd.git] / semaphoreci / gcc-compilation.sh
CommitLineData
841e1049
EV
1#!/bin/bash
2
3set -ex
4
59273a0c
MP
5# keep this in sync with setup.sh
6CONTAINER=${RELEASE:-buster}-${ARCH:-amd64}
7AUTOPKGTESTDIR=${SEMAPHORE_CACHE_DIR:-/tmp}/autopkgtest
8# semaphore cannot expose these, but useful for interactive/local runs
9ARTIFACTS_DIR=/tmp/artifacts
10
11# add current debian/ packaging
12git fetch --depth=1 https://salsa.debian.org/systemd-team/systemd.git master
13git checkout FETCH_HEAD debian
14
15# craft changelog
16UPSTREAM_VER=$(git describe | sed 's/^v//')
17cat << EOF > debian/changelog.new
18systemd (${UPSTREAM_VER}-0) UNRELEASED; urgency=low
19
20 * Automatic build for upstream test
21
22 -- systemd test <pkg-systemd-maintainers@lists.alioth.debian.org> $(date -R)
23
24EOF
25cat debian/changelog >> debian/changelog.new
26mv debian/changelog.new debian/changelog
27
28# clean out patches
29rm -rf debian/patches
30# disable autopkgtests which are not for upstream
31sed -i '/# NOUPSTREAM/ q' debian/tests/control
32# enable more unit tests
33sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true /' debian/rules
34# no orig tarball
35echo '1.0' > debian/source/format
36
37# build source package
38dpkg-buildpackage -S -I -I$(basename "$SEMAPHORE_CACHE_DIR") -d -us -uc -nc
39
40# now build the package and run the tests
41rm -rf "$ARTIFACTS_DIR"
42# autopkgtest exits with 2 for "some tests skipped", accept that
43$AUTOPKGTESTDIR/runner/autopkgtest --apt-upgrade --env DEB_BUILD_OPTIONS=noudeb --env TEST_UPSTREAM=1 ../systemd_*.dsc -o "$ARTIFACTS_DIR" -- lxc -s $CONTAINER || [ $? -eq 2 ]