Package: sbuild
Version: 0.64.0-1
Tags: patch

Dear maintainer,

I have a very local package whose source version is 0 because don't have proper version numbering yet while the software is under initial development (debian/rules adds a build timestamp to the binary package). It doesn't build with sbuild, because sbuild checks the result of Dpkg::Version->new for perl falseness, and "0" is false.

Attached is a super-trivial patch to check for undef instead, since that's what Dpkg::Version is documented as returning on error. I've tested that my package now builds, but setting the version in debian/changelog to "badversion" still causes sbuild to fail.

--
Geoffrey Thomas
gtho...@mokafive.com
From ffdb2d44754dd6d5f73da5e288928f0c30facff3 Mon Sep 17 00:00:00 2001
From: Geoffrey Thomas <gtho...@mokafive.com>
Date: Mon, 17 Jun 2013 18:44:15 -0700
Subject: [PATCH] sbuild: 0 is a valid version number

---
 bin/sbuild |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/sbuild b/bin/sbuild
index e12bf72..6711749 100755
--- a/bin/sbuild
+++ b/bin/sbuild
@@ -194,7 +194,7 @@ sub create_source_package ($) {
 
     my $dist = $pclog->{'Distribution'};
     my $pver = Dpkg::Version->new($version, check => 1);
-    if (!$pver) {
+    unless (defined $pver) {
 	Sbuild::Exception::Build->throw(
 	    error => "Bad version $version in $dsc/debian/changelog",
 	    failstage => "pack-source");
-- 
1.7.10.4

Reply via email to