Package: dh-golang
Severity: wishlist
Tags: patch

Here is a patch that allows dh-golang to function together with dpkg
(libdpkg-perl) from wheezy.

Cheers,
-Hilko
>From 704a5fd3afaf85c002de653ecae0b1ead8713f7b Mon Sep 17 00:00:00 2001
From: Hilko Bengen <ben...@debian.org>
Date: Sat, 8 Aug 2015 18:37:52 +0200
Subject: [PATCH] make dh-golang compatible with wheezy-era dpkg

---
 script/dh_golang | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/script/dh_golang b/script/dh_golang
index 3799ff1..fad7998 100755
--- a/script/dh_golang
+++ b/script/dh_golang
@@ -12,6 +12,7 @@ use Dpkg; # not in core
 use Dpkg::Control; # not in core
 use Dpkg::Control::Info; # not in core
 use Dpkg::Deps; # not in core
+use Dpkg::Gettext; # not in core
 use Scalar::Util qw(blessed); # in core since v5.7.3
 use List::Util qw(first); # in core since v5.7.3
 
@@ -86,7 +87,12 @@ my $control = Dpkg::Control::Info->new();
 my $source = $control->get_source();
 my $build_depends = $source->{"Build-Depends"};
 if (defined($build_depends) && $build_depends ne '') {
-    my $facts = parse_status($Dpkg::ADMINDIR . "/status");
+    my $facts;
+    if ($Dpkg::VERSION >= 1.01) {
+        $facts = parse_status($Dpkg::ADMINDIR . "/status");
+    } else {
+        $facts = parse_status($Dpkg::admindir . "/status");
+    }
 
     sub flatten {
         my ($dep) = @_;
-- 
2.5.0

Reply via email to