Merge lp:~debfx/ubuntu/precise/pkgbinarymangler/dependency-cycle into lp:ubuntu/precise/pkgbinarymangler

Proposed by Felix Geyer
Status: Merged
Merged at revision: 237
Proposed branch: lp:~debfx/ubuntu/precise/pkgbinarymangler/dependency-cycle
Merge into: lp:ubuntu/precise/pkgbinarymangler
Diff against target: 74 lines (+46/-0)
3 files modified
debian/changelog (+10/-0)
pkgstripfiles (+1/-0)
test/run (+35/-0)
To merge this branch: bzr merge lp:~debfx/ubuntu/precise/pkgbinarymangler/dependency-cycle
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Dave Walker (community) Approve
Review via email: mp+90602@code.launchpad.net

Description of the change

  * pkgstripfiles, symlink_doc(): Don't create symlinks that would point to
    the same package. (LP: #923343)
  * test/run: Add test_doc_symlink_dependency_cycle() to make sure that
    pkgstripfiles works correctly when there is a dependency cycle inside
    a source package.

To post a comment you must log in.
Revision history for this message
Dave Walker (davewalker) wrote :

pkgstripfiles change looks good and simple.. the Test looks valid.. Happy to upload if you can confirm it's ready..

Thanks.

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

This looks fine to me, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-01-13 16:06:28 +0000
+++ debian/changelog 2012-01-29 13:50:30 +0000
@@ -1,3 +1,13 @@
1pkgbinarymangler (114) UNRELEASED; urgency=low
2
3 * pkgstripfiles, symlink_doc(): Don't create symlinks that would point to
4 the same package. (LP: #923343)
5 * test/run: Add test_doc_symlink_dependency_cycle() to make sure that
6 pkgstripfiles works correctly when there is a dependency cycle inside
7 a source package.
8
9 -- Felix Geyer <debfx@ubuntu.com> Sun, 29 Jan 2012 12:45:35 +0100
10
1pkgbinarymangler (113) precise; urgency=low11pkgbinarymangler (113) precise; urgency=low
212
3 * dh_translations: fixes previous issues harder (lp: #913085)13 * dh_translations: fixes previous issues harder (lp: #913085)
414
=== modified file 'pkgstripfiles'
--- pkgstripfiles 2011-12-12 11:19:19 +0000
+++ pkgstripfiles 2012-01-29 13:50:30 +0000
@@ -149,6 +149,7 @@
149 depfile="$r/../$dep/usr/share/doc/$dep/$f"149 depfile="$r/../$dep/usr/share/doc/$dep/$f"
150 fi150 fi
151151
152 [ "$dep" != "$PKGNAME" ] || continue
152 [ -f "$depfile" ] || continue153 [ -f "$depfile" ] || continue
153154
154 # special-case Debian changelog: as we truncate them they may155 # special-case Debian changelog: as we truncate them they may
155156
=== modified file 'test/run'
--- test/run 2011-12-12 09:41:52 +0000
+++ test/run 2012-01-29 13:50:30 +0000
@@ -967,6 +967,41 @@
967 self.assertEqual(c['chocolate']['./usr/share/doc/chocolate/test.c']['linkto'], '../vanilla/test.c')967 self.assertEqual(c['chocolate']['./usr/share/doc/chocolate/test.c']['linkto'], '../vanilla/test.c')
968 self.assertEqual(c['chocolate']['./usr/share/doc/chocolate/changelog.gz']['linkto'], '../vanilla/changelog.gz')968 self.assertEqual(c['chocolate']['./usr/share/doc/chocolate/changelog.gz']['linkto'], '../vanilla/changelog.gz')
969969
970 def test_doc_symlink_dependency_cycle(self):
971 '''doc symlinking: cyclic dependency'''
972
973 with open(os.path.join(self.pkgdir, 'debian', 'vanilla.docs'), 'w') as f:
974 f.write('test.c')
975 with open(os.path.join(self.pkgdir, 'debian', 'chocolate.docs'), 'w') as f:
976 f.write('test.c')
977 self.sed_control('/^Architecture:/ s/any/all/g')
978 self.sed_control('s/^Description: vanilla/Depends: chocolate\\n&/')
979 self.sed_control('s/^Description: chocolate/Depends: vanilla\\n&/')
980 orig_size = os.path.getsize(os.path.join(self.pkgdir, 'test.c'))
981
982 self.build()
983 c = self.deb_contents()
984
985 vanilla_link = c['vanilla']['./usr/share/doc/vanilla/test.c']['linkto']
986 chocolate_link = c['chocolate']['./usr/share/doc/chocolate/test.c']['linkto']
987
988 # exactly one of them has to be a symlink
989 self.assertTrue(vanilla_link is None or chocolate_link is None)
990 self.assertTrue(vanilla_link is not None or chocolate_link is not None)
991
992 if vanilla_link is None:
993 file_pkg = "vanilla"
994 link_pkg = "chocolate"
995 else:
996 file_pkg = "chocolate"
997 link_pkg = "vanilla"
998
999 self.assertEqual(c[file_pkg]['./usr/share/doc/%s/test.c' % (file_pkg,)]['linkto'], None)
1000 self.assertEqual(c[file_pkg]['./usr/share/doc/%s/test.c' % (file_pkg,)]['size'], orig_size)
1001 self.assertEqual(c[file_pkg]['./usr/share/doc/%s/changelog.gz' % (file_pkg,)]['linkto'], None)
1002 self.assertEqual(c[link_pkg]['./usr/share/doc/%s/test.c' % (link_pkg,)]['linkto'], '../%s/test.c' % (file_pkg,))
1003 self.assertEqual(c[link_pkg]['./usr/share/doc/%s/changelog.gz' % (link_pkg,)]['linkto'], '../%s/changelog.gz' % (file_pkg,))
1004
970 def test_doc_symlink_disable(self):1005 def test_doc_symlink_disable(self):
971 '''doc symlinking: Disabling with $NO_DOC_PKG_MANGLE'''1006 '''doc symlinking: Disabling with $NO_DOC_PKG_MANGLE'''
9721007

Subscribers

People subscribed via source and target branches

to all changes: