Skip to content

Commit c67fef7

Browse files
authored
fix(pkg): pkg_deb changelog argument handling (#1051)
1 parent e885fe1 commit c67fef7

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

pkg/private/deb/deb.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _pkg_deb_impl(ctx):
116116
fail("Neither description_file nor description attribute was specified")
117117

118118
if ctx.attr.changelog:
119-
args.append("--changelog" + "@" + ctx.file.changelog.path)
119+
args.add("--changelog", "@" + ctx.file.changelog.path)
120120
files.append(ctx.file.changelog)
121121

122122
# Built using can also be specified by a file or inlined (but is not mandatory)

tests/deb/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pkg_deb(
7474
name = "test_deb",
7575
breaks = ["oldbrokenpkg"],
7676
built_using = "some_test_data (0.1.2)",
77+
changelog = "changelog",
7778
conffiles = [
7879
"/etc/nsswitch.conf",
7980
"/etc/other",

tests/deb/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fizzbuzz (4.5.6) trusty; urgency=low
2+
3+
* Add changelog coverage.
4+
5+
-- Some One <someone@somewhere.com> Thu, 01 Jan 1970 00:00:00 +0000

tests/deb/pkg_deb_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def test_description(self):
173173

174174
def test_control_files(self):
175175
expected = [
176+
{'name': './changelog', 'mode': 0o644},
176177
{'name': './conffiles', 'mode': 0o644},
177178
{'name': './config', 'mode': 0o755},
178179
{'name': './control', 'mode': 0o644},
@@ -189,6 +190,16 @@ def test_conffiles(self):
189190
conffiles,
190191
'/etc/nsswitch.conf\n/etc/other\n')
191192

193+
def test_changelog(self):
194+
changelog = self.deb_file.get_deb_ctl_file('changelog')
195+
self.assertEqual(
196+
changelog,
197+
'fizzbuzz (4.5.6) trusty; urgency=low\n'
198+
'\n'
199+
' * Add changelog coverage.\n'
200+
'\n'
201+
' -- Some One <someone@somewhere.com> Thu, 01 Jan 1970 00:00:00 +0000\n')
202+
192203
def test_config(self):
193204
config = self.deb_file.get_deb_ctl_file('config')
194205
self.assertEqual(config, '# test config file\n')

0 commit comments

Comments
 (0)