From 67070389f3752f6f23d1fb0c06bd963464aa8bca Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 22 Aug 2024 16:10:58 +0200 Subject: Implement 'Pin: source-version ' As wondered about by Paride some minutes ago. --- test/integration/test-policy-pinning | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index dc3192fe9..99f193930 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -80,8 +80,9 @@ testglobalpolicy msgmsg 'Test with specific packages' +# Yeesh, the XB-Source stuff is hacky, hopefully this won't break. buildsimplenativepackage "coolstuff" "all" "1.0" "stable" -buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports" +buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports" "XB-Source: coolstuff (2.0~bpo1-source-version)" setupaptarchive @@ -434,6 +435,20 @@ testsuccessequal "coolstuff: 1.0 500 500 file:${tmppath}/aptarchive stable/main all Packages" aptcache policy coolstuff +echo "Package: coolstuff +Pin: source-version 2.0~bpo1-source-version +Pin-Priority: 1000" > rootdir/etc/apt/preferences +testsuccessequal "coolstuff: + Installed: 2.0~bpo1 + Candidate: 2.0~bpo1 + Version table: + 2.0~bpo2 100 + 100 file:${tmppath}/aptarchive backports/main all Packages + *** 2.0~bpo1 1000 + 100 ${tmppath}/rootdir/var/lib/dpkg/status + 1.0 500 + 500 file:${tmppath}/aptarchive stable/main all Packages" aptcache policy coolstuff + # Check for 0 echo "Package: coolstuff Pin: release n=backports -- cgit v1.2.3-70-g09d2