[Piuparts-devel] [Git][debian/piuparts][master] 6 commits: Start 1.4.1 development

Nicolas Dandrimont (@olasd) gitlab at salsa.debian.org
Sat Mar 23 09:10:57 GMT 2024



Nicolas Dandrimont pushed to branch master at Debian / piuparts


Commits:
8afb49d8 by Nicolas Dandrimont at 2024-03-15T10:04:53+01:00
Start 1.4.1 development

- - - - -
04e2c7d4 by Nicolas Dandrimont at 2024-03-15T11:15:12+01:00
tests: Update unittest asserts to non-deprecated versions

Closes: #1061749

- - - - -
1b9a3843 by Helmut Grohne at 2024-03-18T14:42:10+01:00
also fix /bin/sync diversion for bookworm

dpkg-divert will rename a file regardless of whether it is installed by
a package. When coreutils ships /bin/sync in bookworm, the first of the
two diversions would still move it away. In bookworm we'd end up with
/bin/sync being diverted to /bin/sync.usr-is-merged but actually moved
to /usr/bin/sync.distrib. Hence debsums would fail later. Work around
this by manually implementing the rename part.

- - - - -
85045c69 by Nicolas Dandrimont at 2024-03-19T09:40:07+01:00
Merge branch 'helmutg/fix-sync-diversion-for-bookworm' into develop

- - - - -
54fe1b69 by Nicolas Dandrimont at 2024-03-23T10:04:56+01:00
gbp: only use the bare version for debian tags

- - - - -
2a649c34 by Nicolas Dandrimont at 2024-03-23T10:06:34+01:00
Prepare changelog for 1.4.1 upload

- - - - -


7 changed files:

- custom-scripts/scripts/post_setup_force-unsafe-io
- debian/changelog
- + debian/gbp.conf
- tests/test_dependencyparser.py
- tests/test_piuparts.py
- tests/test_pkgsummary.py
- tests/unittests.py


Changes:

=====================================
custom-scripts/scripts/post_setup_force-unsafe-io
=====================================
@@ -19,7 +19,16 @@ fi
 
 if [ ! -h /bin/sync ]
 then
-	dpkg-divert --rename /usr/bin/sync
-	dpkg-divert --rename --divert /bin/sync.usr-is-merged /bin/sync
+	if test -e /usr/bin/sync; then
+		if dpkg -S /usr/bin/sync >/dev/null 2>&1; then
+			mv /usr/bin/sync /usr/bin/sync.distrib
+		else
+			mv /bin/sync /bin/sync.distrib.usr-is-merged
+		fi
+		dpkg-divert --add --no-rename --divert /usr/bin/sync.distrib /usr/bin/sync
+	# else
+	# 	We're probably unmerged-/usr and a single diversion will do.
+	fi
+	dpkg-divert --add --no-rename --divert /bin/sync.distrib.usr-is-merged /bin/sync
 	ln -sv true /bin/sync
 fi


=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+piuparts (1.4.1) unstable; urgency=medium
+
+  [ Nicolas Dandrimont ]
+  * tests: Update unittest asserts to non-deprecated versions (Closes: #1061749)
+  * gbp: only use the bare version for debian tags
+
+  [ Helmut Grohne ]
+  * also fix /bin/sync diversion for bookworm
+
+ -- Nicolas Dandrimont <olasd at debian.org>  Sat, 23 Mar 2024 10:06:28 +0100
+
 piuparts (1.4) unstable; urgency=medium
 
   [ Nicolas Dandrimont ]


=====================================
debian/gbp.conf
=====================================
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-tag=%(version)s


=====================================
tests/test_dependencyparser.py
=====================================
@@ -18,16 +18,16 @@ class DependencyParserTests(unittest.TestCase):
 
     def testEmpty(self):
         deps, names = self.parse("")
-        self.failUnlessEqual(deps, [])
+        self.assertEqual(deps, [])
 
     def testSingle(self):
         deps, names = self.parse("foo")
-        self.failUnlessEqual(names, [["foo"]])
+        self.assertEqual(names, [["foo"]])
 
     def testTwo(self):
         deps, names = self.parse("foo, bar")
-        self.failUnlessEqual(names, [["foo"], ["bar"]])
+        self.assertEqual(names, [["foo"], ["bar"]])
 
     def testAlternatives(self):
         deps, names = self.parse("foo, bar | foobar")
-        self.failUnlessEqual(names, [["foo"], ["bar", "foobar"]])
+        self.assertEqual(names, [["foo"], ["bar", "foobar"]])


=====================================
tests/test_piuparts.py
=====================================
@@ -102,51 +102,51 @@ class IsBrokenSymlinkTests(unittest.TestCase):
         shutil.rmtree(self.testdir)
 
     def testRelativeBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "relative-broken"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "relative-broken"))
 
     def testRelativeBrokenToSymlink(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "relative-broken-to-symlink"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "relative-broken-to-symlink"))
 
     def testAbsoluteBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "absolute-broken"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "absolute-broken"))
 
     def testAbsoluteBrokenToSymlink(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "absolute-broken-to-symlink"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "absolute-broken-to-symlink"))
 
     def testTrailingSlashBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-broken"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-broken"))
 
     def testSelfLoopBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "selfloop"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "selfloop"))
 
     def testExpandingSelfLoopBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "explode"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "explode"))
 
     def testAbsoluteSelfLoopBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "absolute-selfloop"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "absolute-selfloop"))
 
     def testSubdirSelfLoopBroken(self):
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/selfloop"))
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/selfloop1"))
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop"))
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop1"))
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop2"))
-        self.failUnless(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop3"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/selfloop"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/selfloop1"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop1"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop2"))
+        self.assertTrue(is_broken_symlink(self.testdir, self.testdir, "dir/subdir/selfloop3"))
 
     def testRelativeWorks(self):
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "relative-works"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "relative-works"))
 
     def testRelativeWorksToSymlink(self):
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "relative-works-to-symlink"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "relative-works-to-symlink"))
 
     def testAbsoluteWorks(self):
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "absolute-works"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "absolute-works"))
 
     def testAbsoluteWorksToSymlink(self):
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "absolute-works-to-symlink"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "absolute-works-to-symlink"))
 
     def testTrailingSlashWorks(self):
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-works"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "trailing-slash-works"))
 
     def testMultiLevelNestedSymlinks(self):
         # target/first-link -> ../target/second-link -> ../target
@@ -154,7 +154,7 @@ class IsBrokenSymlinkTests(unittest.TestCase):
         os.mkdir(os.path.join(self.testdir, "target"))
         self.symlink("../target", "target/second-link")
         self.symlink("../target/second-link", "target/first-link")
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "target/first-link"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "target/first-link"))
 
     def testMultiLevelNestedAbsoluteSymlinks(self):
         # first-link -> /second-link/final-target
@@ -164,4 +164,4 @@ class IsBrokenSymlinkTests(unittest.TestCase):
         os.mkdir(os.path.join(self.testdir, "final-dir/final-target"))
         self.symlink("/second-link/final-target", "first-link")
         self.symlink("/final-dir", "second-link")
-        self.failIf(is_broken_symlink(self.testdir, self.testdir, "first-link"))
+        self.assertFalse(is_broken_symlink(self.testdir, self.testdir, "first-link"))


=====================================
tests/test_pkgsummary.py
=====================================
@@ -14,7 +14,7 @@ class PkgSummaryTests(unittest.TestCase):
         states = sorted([y for x in finfo for y in finfo[x].states])
         nodups = sorted(list(set(states)))
 
-        self.assertTrue("successfully-tested" in states)
+        self.assertIn("successfully-tested", states)
         self.assertEqual(states, nodups)
 
     def testSummGetFlag(self):
@@ -93,7 +93,7 @@ class PkgSummaryAddTests(unittest.TestCase):
     def testSummAddInvalid(self):
         pkgsummary.add_summary(self.summ, "dist", "pkg", "-", 0, "http://foo")
         print(self.summ["packages"]["pkg"]["dist"][2])
-        self.assertTrue("http" in self.summ["packages"]["pkg"]["dist"][2])
+        self.assertIn("http", self.summ["packages"]["pkg"]["dist"][2])
 
     def testSummMerge(self):
         pkgsummary.add_summary(self.summ, "dist", "pkg", "X", 0, "http://foo")


=====================================
tests/unittests.py
=====================================
@@ -54,7 +54,7 @@ class PackagesDbTests(unittest.TestCase):
 
     def testNoPackages(self):
         p = self.reserve("")
-        self.failUnlessEqual(p, None)
+        self.assertEqual(p, None)
 
     def testNoDeps(self):
         p = self.reserve(
@@ -63,8 +63,8 @@ Package: foo
 Version: 1.0-1
 """
         )
-        self.failIfEqual(p, None)
-        self.failUnlessEqual(p["Package"], "foo")
+        self.assertNotEqual(p, None)
+        self.assertEqual(p["Package"], "foo")
 
 
 if __name__ == "__main__":



View it on GitLab: https://salsa.debian.org/debian/piuparts/-/compare/0885ccb2676f34e63c5ac89112a1672b0a95e7d1...2a649c34149df81d3706b7c5b83acefb91c461ff

-- 
View it on GitLab: https://salsa.debian.org/debian/piuparts/-/compare/0885ccb2676f34e63c5ac89112a1672b0a95e7d1...2a649c34149df81d3706b7c5b83acefb91c461ff
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/piuparts-devel/attachments/20240323/7d3a76af/attachment-0001.htm>


More information about the Piuparts-devel mailing list