summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-01-02 13:27:02 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-01-02 16:20:01 +0100
commitf6459e646f6fa45c34d1f13f37173ea4b92ffd5f (patch)
tree1bcb678317ceb6cb6fcaab41621003b6daaf5828 /test
parente21ba62847687b5dc655b28ef7dd67d6eb7336e2 (diff)
properly parse comments in apt_preferences and deb822-style sources
apt_preferences and deb822-style sources used the specialized class pkgUserTagSection to deal with comments before/after a given stanza, but it couldn't deal with comments in the stanza at all. codesearch suggests that nobody else does and a vastely superior way of working with potentially commented files is implemented now, so we can officially discourage the use of the old incomplete hack class.
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-sources-deb8222
-rwxr-xr-xtest/integration/test-policy-pinning25
2 files changed, 27 insertions, 0 deletions
diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822
index 5b22eaa80..fd275f978 100755
--- a/test/integration/test-apt-sources-deb822
+++ b/test/integration/test-apt-sources-deb822
@@ -15,10 +15,12 @@ BASE='# some comment
#Types: meep
Types: deb
+#Types: deb-src
URIs: http://ftp.debian.org/debian
Suites: stable
Components: main
Description: summay
+# comments are ignored
and the long part'
msgcleantest() {
diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning
index 635dcb874..8f4850c4d 100755
--- a/test/integration/test-policy-pinning
+++ b/test/integration/test-policy-pinning
@@ -315,3 +315,28 @@ Pin-Priority: 0
testfailureequal "Reading package lists...
E: No priority (or zero) specified for pin" \
aptget install -s coolstuff -o PinPriority=0
+
+# Check with comments
+echo "#Package: coolstuff
+#Pin: release n=backports
+#Pin-Priority: 0
+
+# Test
+
+Package: coolstuff
+Pin: release n=backports
+#Pin: release n=unstable
+#Pin-Priority: 999
+Pin-Priority: 999
+#Pin-Priority: 999" > rootdir/etc/apt/preferences
+
+testsuccessequal "coolstuff:
+ Installed: 2.0~bpo1
+ Candidate: 2.0~bpo2
+ Version table:
+ 2.0~bpo2 999
+ 100 file:${tmppath}/aptarchive backports/main all Packages
+ *** 2.0~bpo1 100
+ 100 ${tmppath}/rootdir/var/lib/dpkg/status
+ 1.0 500
+ 500 file:${tmppath}/aptarchive stable/main all Packages" aptcache policy coolstuff