summaryrefslogtreecommitdiffstats
path: root/debian/tests/upstream
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/upstream')
-rwxr-xr-xdebian/tests/upstream21
1 files changed, 21 insertions, 0 deletions
diff --git a/debian/tests/upstream b/debian/tests/upstream
index 3736f39..7d81f29 100755
--- a/debian/tests/upstream
+++ b/debian/tests/upstream
@@ -3,6 +3,26 @@
set -e
set -x
+RELEASE=$(
+ . /etc/os-release;
+ if [ "$ID" = "ubuntu" ]; then
+ echo "$VERSION_CODENAME"
+ elif [ "$ID" = "debian" ]; then
+ if [ -n "$VERSION_ID" ] && [ -n "$VERSION_CODENAME" ]; then
+ echo "$VERSION_CODENAME"
+ else
+ debian_version="$(cat /etc/debian_version)"
+ if [ "${debian_version#*/}" = sid ]; then
+ if [ "$VERSION_CODENAME" = sid ] || grep -q -r sid /etc/apt/sources.list* || grep -q -r unstable /etc/apt/sources.list*; then
+ echo "unstable"
+ else
+ echo "$VERSION_CODENAME"
+ fi
+ fi
+ fi
+ fi
+)
+
cleanup () {
if [ -f "${workdir}/btrfs/build/meson-logs/testlog.txt" ]; then
cp "${workdir}/btrfs/build/meson-logs/testlog.txt" "$AUTOPKGTEST_ARTIFACTS"
@@ -61,6 +81,7 @@ PackageCacheDirectory=$workdir/cache
[Distribution]
PackageManagerTrees=/etc/apt/preferences.d/:/etc/apt/preferences.d/
+${RELEASE:+"Release=${RELEASE}"}
[Content]
Environment=NO_BUILD=1 NO_SYNC=1 ARTIFACT_DIRECTORY="$AUTOPKGTEST_ARTIFACTS" TEST_SAVE_JOURNAL=fail TEST_SHOW_JOURNAL=warning