Merge lp:~james-w/pkgme/annoying-debuild into lp:pkgme

Proposed by James Westby
Status: Merged
Approved by: Jonathan Lange
Approved revision: 107
Merged at revision: 107
Proposed branch: lp:~james-w/pkgme/annoying-debuild
Merge into: lp:pkgme
Diff against target: 63 lines (+35/-0)
2 files modified
pkgme/package_files.py (+13/-0)
pkgme/tests/test_package_files.py (+22/-0)
To merge this branch: bzr merge lp:~james-w/pkgme/annoying-debuild
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+108363@code.launchpad.net

Commit message

Write out a debian/source/format that is explicit that the package is native.

Description of the change

Hi,

This fixes bug 1007344 by making it explicit in a debian/source/format file
that the package is intended to be native. This should stop debuild from
prompting the user and causing the failure.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

For both my use-cases this makes it work. Good work!

Revision history for this message
Daniel Holbach (dholbach) wrote :

Not sure if I should be reviewing the code as well, but it looks great to me.

Revision history for this message
Jonathan Lange (jml) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pkgme/package_files.py'
2--- pkgme/package_files.py 2012-03-30 16:04:51 +0000
3+++ pkgme/package_files.py 2012-06-01 15:30:30 +0000
4@@ -229,6 +229,19 @@
5 default_package_file_group.add_file_cls(Control)
6
7
8+class SourceFormat(DebianPackageFile):
9+
10+ elements = []
11+
12+ filename = "source/format"
13+
14+ def get_contents(self):
15+ return "3.0 (native)\n"
16+
17+
18+default_package_file_group.add_file_cls(SourceFormat)
19+
20+
21 class Desktop(TemplatePackageFile):
22
23 # See http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
24
25=== modified file 'pkgme/tests/test_package_files.py'
26--- pkgme/tests/test_package_files.py 2012-03-30 16:04:51 +0000
27+++ pkgme/tests/test_package_files.py 2012-06-01 15:30:30 +0000
28@@ -36,6 +36,7 @@
29 Desktop,
30 PackageFile,
31 PackageFileGroup,
32+ SourceFormat,
33 Rules,
34 TemplatePackageFile,
35 )
36@@ -392,6 +393,27 @@
37 ControlStanzaHasField(1, "Description", description))
38
39
40+class SourceFormatTests(PackageFileTestCase):
41+
42+ cls = SourceFormat
43+
44+ def get_default_args(self):
45+ return {}
46+
47+ def test_path(self):
48+ package_file = self.get_object()
49+ self.assertEqual(
50+ os.path.join(DEBIAN_DIR, "source/format"), package_file.path)
51+
52+ def test_contents(self):
53+ package_file = self.get_object()
54+ self.assertEqual("3.0 (native)\n", package_file.get_contents())
55+
56+ def test_overwrite(self):
57+ package_file = self.get_object()
58+ self.assertEqual(True, package_file.overwrite)
59+
60+
61 class DesktopFileTests(PackageFileTestCase):
62
63 cls = Desktop

Subscribers

People subscribed via source and target branches

to all changes: