Control: tags -1 patch
Control: severity -1 important

Hi!

On Sun, 2014-05-18 at 07:36:59 +0200, Guillem Jover wrote:
> Package: debsigs
> Version: 0.1.17
> Severity: wishlist

> The debsigs program accesses .deb archives directly, but it does not seem
> to support data.tar, data.tar.xz, data.tar.bz2 (deprecated),
> data.tar.lzma (deprecated), control.tar and control.tar.xz
> members, as supported by latest dpkg-deb, and as documented by deb(5).
> 
> (You might decide to skip adding support for the deprecated members,
> although there might be such packages in the wild, so if it's not
> inconvinient adding support would be nice.)
> 
> I'm trying to get the table of deb archive support in
> https://wiki.debian.org/Teams/Dpkg/DebSupport> to be greener, so that
> we can enable some of those features in the future in the archive.
> 
> There are sample packages that you can use for testing purposes in the
> <git://git.debian.org/git/dpkg/pkg-tests.git> repostiory, in the
> t-deb-format directory, and can be generated with «make test-case»
> inside that directory. Note that this will create a set of valid and
> bogus packages for testing purposes.

Attached a patch implementing this. I've bumped the severity as the
dpkg-deb compression got switched recently, so debsigs fails with all
newly built packages, rendering it pretty much unusable with new
binaries.

Thanks,
Guillem
From 6e3ad209ac90167f4547fd6676081f672e104f51 Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Tue, 10 Jun 2014 22:11:39 +0200
Subject: [PATCH] debsigs: Add support for all available deb members

This adds support for control.tar, control.tar.xz, data.tar,
data.tar.xz, data.tar.bz2 and data.tar.lzma.

Closes: #748530
---
 debian/changelog | 8 ++++++++
 debsigs          | 7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 3129f7f..66032c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debsigs (0.1.17-0.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Add support for control.tar, control.tar.xz, data.tar, data.tar.xz,
+    data.tar.bz2 and data.tar.lzma. Closes: #748530
+
+ -- Guillem Jover <[email protected]>  Tue, 10 Jun 2014 21:59:41 +0200
+
 debsigs (0.1.17) unstable; urgency=low
 
   * Switch to Git and point the Vcs-* fields to Gitorious.
diff --git a/debsigs b/debsigs
index b1778f3..9ff01e5 100644
--- a/debsigs
+++ b/debsigs
@@ -27,6 +27,7 @@ use Debian::debsigs::debsigsmain;
 use Debian::debsigs::forktools ':all';
 use Debian::debsigs::gpg;
 use Getopt::Long;
+use List::Util qw(first);
 use IO::File;
 use POSIX ":sys_wait_h";
 
@@ -89,7 +90,11 @@ sub cmd_sign($) {
   }
 
   my $arobj = new Debian::debsigs::arf($file);
-  my ($arfd,$arpid) = $arobj->getfiles("debian-binary", "control.tar.gz", "data.tar.gz");
+  my @armembers = $arobj->contents();
+  my $member_ctrl = first { /^control\.tar(?:\.gz|\.xz)?$/ } @armembers;
+  my $member_data = first { /^data\.tar(?:\.gz|\.xz|\.bz2|\.lzma)?$/ } @armembers;
+
+  my ($arfd,$arpid) = $arobj->getfiles("debian-binary", $member_ctrl, $member_data);
   my $dir = mktempdir();
   my $sigfile = new IO::File(">$dir/_gpg$sign") or die
     "Couldn't open: $!";
-- 
2.0.0

Reply via email to