Package: dpkg-dev
Version: 1.16.0.3
Severity: normal
Tags: patch

Attached is a patch to add the distribution to the .dsc

This is currently only available in the changelog or the
.changes.  However, tools like sbuild, which need to build
in a distribution-specific chroot can't work out what the
distribution is without unpacking the source tree and
inspecting the changelog (which is impractical for a
number of reasons, least of all efficiency).  This requires
that sbuild be told the distribution by the user, and there
can sometimes be problems as a result e.g. uploading
experimental packages to unstable due to using "-d unstable"
out of habit.

This isn't an issue for buildds, because they know the
distribution they are building for; this is intended for
developers doing manual or semi-automated builds.  Because
sbuild consumes .dscs as its input for building, having
the nominal distribution in the dsc will mean that the
distribution will not require specifying under normal
sbuild usage, which will decrease the changes of
accidental uploads to the wrong distribution.  It also
makes backporting easier--sbuild will default to building
in the correct stable/oldstable chroot.


Regards,
Roger

-- System Information:
Debian Release: 6.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.27-kvm-i386-20110114 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From f0ae4f4f2d49d918a3fb80e53074d3954941d944 Mon Sep 17 00:00:00 2001
From: Roger Leigh <rle...@debian.org>
Date: Tue, 14 Jun 2011 11:20:13 +0100
Subject: [PATCH] dpkg-source: Add distribution to output fields

Signed-off-by: Roger Leigh <rle...@debian.org>
---
 scripts/Dpkg/Control/Fields.pm |    4 ++--
 scripts/dpkg-source.pl         |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/Dpkg/Control/Fields.pm b/scripts/Dpkg/Control/Fields.pm
index 0183281..0e6090a 100644
--- a/scripts/Dpkg/Control/Fields.pm
+++ b/scripts/Dpkg/Control/Fields.pm
@@ -291,8 +291,8 @@ our %FIELD_ORDER = (
         qw(Section Priority Multi-Arch Homepage Description Tag Task)
     ],
     CTRL_PKG_SRC() => [
-        qw(Format Source Binary Architecture Version Origin Maintainer
-        Uploaders Homepage Standards-Version Vcs-Browser
+        qw(Format Source Binary Architecture Version Origin Distribution
+       Maintainer  Uploaders Homepage Standards-Version Vcs-Browser
         Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg Vcs-Mtn
         Vcs-Svn), &field_list_src_dep(), qw(Package-List),
         @checksum_fields, qw(Files)
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index 8d23806..01d4aee 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -306,6 +306,8 @@ if ($options{'opmode'} =~ 
/^(-b|--print-format|--(before|after)-build)$/) {
            my ($ok, $error) = version_check($v);
             error($error) unless $ok;
            $fields->{$_} = $v;
+       } elsif (m/^Distribution$/) {
+           $fields->{$_} = $v;
        } elsif (m/^Maintainer$/i) {
             # Do not replace the field coming from the source entry
        } else {
-- 
1.7.5.4

Reply via email to