[lintian] 04/04: Allow control.tar and control.tar.xz
This is an automated email from the git hooks/post-receive script.
broucaries-guest pushed a commit to branch master
in repository lintian.
commit ffbe5521297c5a25e121ae425c57670e07316a81
Author: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
Date: Sun Nov 30 22:15:18 2014 +0100
Allow control.tar and control.tar.xz
Signed-off-by: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
---
checks/deb-format.desc | 12 ++++++++++++
checks/deb-format.pm | 13 +++++++++++++
t/debs/deb-format-control-xz/Makefile | 19 +++++++++++++++++++
t/debs/deb-format-control-xz/control | 11 +++++++++++
t/debs/deb-format-control-xz/desc | 4 ++++
t/debs/deb-format-control-xz/tags | 1 +
t/debs/deb-format-no-compress/desc | 1 +
t/debs/deb-format-no-compress/tags | 2 ++
8 files changed, 63 insertions(+)
diff --git a/checks/deb-format.desc b/checks/deb-format.desc
index 8fc81a8..418305e 100644
--- a/checks/deb-format.desc
+++ b/checks/deb-format.desc
@@ -69,6 +69,18 @@ Info: The data portion of this binary package uses a deprecated compression
be used as a substitute, depending on the wanted properties: gzip for
maximum compatibility and speed, and xz for maximum compression ratio.
+Tag: uses-no-compression-for-control-tarball
+Severity: important
+Certainty: certain
+Ref: deb(5)
+Info: The control portion of this binary package uses a non compressed
+ format. Although dpkg will support extracting such binary packages
+ since dpkg 1.10.24, creating them is not advised except in special
+ cases.
+ .
+ Except if data is non compressible use gzip for
+ maximum compatibility and speed, and xz for maximum compression ratio.
+
Tag: uses-no-compression-for-data-tarball
Severity: important
Certainty: certain
diff --git a/checks/deb-format.pm b/checks/deb-format.pm
index 7431374..e0b750a 100644
--- a/checks/deb-format.pm
+++ b/checks/deb-format.pm
@@ -128,6 +128,19 @@ sub run {
"second (official) member $ctrl_member",
'not control.tar.(gz|xz)');
$failed = 1;
+ } elsif ($ctrl_member eq 'control.tar') {
+ tag 'uses-no-compression-for-control-tarball';
+ # NB: We deliberately do not allow "data.tar",
+ # since various tools seems to be unable to cope
+ # with them particularly dak
+ # see https://wiki.debian.org/Teams/Dpkg/DebSupport
+ tag 'malformed-deb-archive','newer uncompressed control.tar';
+ } elsif ($ctrl_member eq 'control.tar.xz') {
+ # NB: We deliberately do not allow "data.tar",
+ # since various tools seems to be unable to cope
+ # with them particularly dak
+ # see https://wiki.debian.org/Teams/Dpkg/DebSupport
+ tag 'malformed-deb-archive','newer compressed control.tar.xz';
}
}
diff --git a/t/debs/deb-format-control-xz/Makefile b/t/debs/deb-format-control-xz/Makefile
new file mode 100644
index 0000000..10d1d3d
--- /dev/null
+++ b/t/debs/deb-format-control-xz/Makefile
@@ -0,0 +1,19 @@
+name = deb-format-control-xz
+
+# Done by hand, create-deb cannot do this and it would
+# be "too much effort" to make it be able to do it.
+all:
+ echo '2.0' > debian-binary
+ mkdir -p usr/share/doc/$(name)
+ install -m 0644 copyright changelog usr/share/doc/$(name)
+ gzip -9n usr/share/doc/$(name)/changelog
+ tar cfJ data.tar.xz usr
+ chown 0:0 control
+ chmod 644 control
+ md5sum usr/share/doc/$(name)/* > md5sums
+ tar cfJ control.tar.xz control md5sums
+ ar rc $(name).deb \
+ debian-binary control.tar.xz data.tar.xz
+clean:
+ rm -f *.tar.xz *.deb md5sums debian-binary
+ rm -rf usr
\ No newline at end of file
diff --git a/t/debs/deb-format-control-xz/control b/t/debs/deb-format-control-xz/control
new file mode 100644
index 0000000..fd0c956
--- /dev/null
+++ b/t/debs/deb-format-control-xz/control
@@ -0,0 +1,11 @@
+Package: deb-format-control-xz
+Version: 1.0
+Architecture: all
+Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
+Section: devel
+Priority: extra
+Description: Test package with control.tar.xz
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
diff --git a/t/debs/deb-format-control-xz/desc b/t/debs/deb-format-control-xz/desc
new file mode 100644
index 0000000..a0ae37a
--- /dev/null
+++ b/t/debs/deb-format-control-xz/desc
@@ -0,0 +1,4 @@
+Testname: deb-format-control-xz
+Sequence: 6000
+Version: 1.0
+Description: Test package with control.tar.xz
diff --git a/t/debs/deb-format-control-xz/tags b/t/debs/deb-format-control-xz/tags
new file mode 100644
index 0000000..2b7fd56
--- /dev/null
+++ b/t/debs/deb-format-control-xz/tags
@@ -0,0 +1 @@
+E: deb-format-control-xz: malformed-deb-archive newer compressed control.tar.xz
diff --git a/t/debs/deb-format-no-compress/desc b/t/debs/deb-format-no-compress/desc
index e5d92c6..18ae8e1 100644
--- a/t/debs/deb-format-no-compress/desc
+++ b/t/debs/deb-format-no-compress/desc
@@ -3,4 +3,5 @@ Sequence: 6000
Version: 1.0
Description: Test package with no compression
Test-For:
+ uses-no-compression-for-control-tarball
uses-no-compression-for-data-tarball
diff --git a/t/debs/deb-format-no-compress/tags b/t/debs/deb-format-no-compress/tags
index 7c3ebe0..c474c6b 100644
--- a/t/debs/deb-format-no-compress/tags
+++ b/t/debs/deb-format-no-compress/tags
@@ -1,2 +1,4 @@
+E: deb-format-no-compress: malformed-deb-archive newer uncompressed control.tar
E: deb-format-no-compress: malformed-deb-archive newer uncompressed data.tar
+E: deb-format-no-compress: uses-no-compression-for-control-tarball
E: deb-format-no-compress: uses-no-compression-for-data-tarball
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: