dpkg-dev: please add override for rejecting native/non-native version when building native/non-native source packages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dpkg (Debian) |
Won't Fix
|
Unknown
|
|||
dpkg (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Please add override for the below "bugfix".
Imported from Debian bug http://
Package: dpkg-dev
Version: 1.16.9
Severity: wishlist
Tags: patch
Please ensure that the package version matches its nativity state
in 3.0 (quilt/native) packages. Having dpkg-source allow to create
native packages with non-native versions and non-native packages with
native versions can be quite confusing, so better reject them directly.
(Attached patch does this for 3.0 (quilt) and 3.0 (native) packages,
where this change should be safe to be done and does not touch any legacy
source package formats).
From: "Bernhard R. Link" <email address hidden>
Date: Sat, 9 Feb 2013 14:59:00 +0100
Subject: [PATCH] Dpkg::Version,
Dpkg::
invalid version strings
Ensure that a 3.0 (quilt) package has a non-native version and that a
3.0 (native) package has a native version.
To get the information, extend Dpkg::Version with a is_native method to
check whether a version has a revision or not.
---
scripts/
scripts/
scripts/
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/scripts/
index ba6539a..32e3c1b 100644
--- a/scripts/
+++ b/scripts/
@@ -64,7 +64,9 @@ sub do_extract {
}
sub can_build {
- return 1;
+ my ($self, $dir) = @_;
+ my $v = Dpkg::Version-
+ return (!!$v->is_native(), _g("native package version may not have a revision"));
}
sub do_build {
diff --git a/scripts/
index f5875c1..8a6cc54 100644
--- a/scripts/
+++ b/scripts/
@@ -72,6 +72,8 @@ sub can_build {
my ($self, $dir) = @_;
my ($code, $msg) = $self->
return ($code, $msg) if $code eq 0;
+ my $v = Dpkg::Version-
+ return (0, _g("version does not contain a revision")) if $v->is_native();
my $quilt = $self->
$msg = $quilt-
return (0, $msg) if $msg;
diff --git a/scripts/
index 26ee154..042bd8e 100644
--- a/scripts/
+++ b/scripts/
@@ -145,6 +145,17 @@ sub revision {
return $self->
}
+=item $v->is_native()
+
+Returns true if the version is native, false if it has a revision.
+
+=cut
+
+sub is_native {
+ my $self = shift;
+ return $self->
+}
+
=item $v1 <=> $v2, $v1 < $v2, $v1 <= $v2, $v1 > $v2, $v1 >= $v2
Numerical comparison of various versions numbers. One of the two operands
--
1.7.10.4
-- System Information:
Debian Release: 7.0
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=
Shell: /bin/sh linked to /bin/dash
Versions of packages dpkg-dev depends on:
ii base-files 7.1
ii binutils 2.22-7.1
ii bzip2 1.0.6-4
ii libdpkg-perl 1.16.9
ii make 3.81-8.2
ii patch 2.6.1-3
ii xz-utils 5.1.1alpha+
Versions of packages dpkg-dev recommends:
ii build-essential 11.6
ii fakeroot 1.18.4-2
ii gcc [c-compiler] 4:4.7.2-1
ii gcc-4.6 [c-compiler] 4.6.3-15
ii gcc-4.7 [c-compiler] 4.7.2-5
ii gnupg 1.4.12-7
ii gpgv 1.4.12-7
ii libalgorithm-
Versions of packages dpkg-dev suggests:
ii debian-keyring 2012.11.15
-- no debconf information
summary: |
- dpkg-dev: please reject native/non-native version when building - native/non-native source packages + dpkg-dev: please add override for rejecting native/non-native version + when building native/non-native source packages |
description: | updated |
Changed in dpkg (Debian): | |
importance: | Undecided → Unknown |
status: | New → Fix Released |
Changed in dpkg (Debian): | |
status: | Unknown → Won't Fix |
Isn't it enough to just use the 1.0 format instead of 3.0? The restriction only applies to 3.0.