Package: debhelper
Version: 9.20151225
Severity: wishlist
Tags: patch

Hi niels,

could you apply the following patch about allowing to run maintscript-helper 
dir2symlink

Will save me some time on imagemagick

>From 87feddf6cb42fbd94e5507dfd8a1c37efb1bf221 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bast...@gmail.com>
Date: Sun, 31 Jan 2016 21:50:20 +0100
Subject: [PATCH] Allow to run maintscript helper automatically
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Bastien ROUCARIÈS <roucaries.bast...@gmail.com>
---
 dh_installdocs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dh_installdocs b/dh_installdocs
index da7b517..8e9cf2c 100755
--- a/dh_installdocs
+++ b/dh_installdocs
@@ -163,6 +163,7 @@ sub ensure_docdir {
 
 init(options => {
 	"link-doc=s" => \$dh{LINK_DOC},
+	"previous-version=s" => \$dh{PREVIOUS_VERSION},
 });
 
 my $called_getpackages = 0;
@@ -173,6 +174,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	my $tmp=tmpdir($package);
 	my $file=pkgfile($package,"docs");
 	my $link_doc=($dh{LINK_DOC} && $dh{LINK_DOC} ne $package);
+	my $previous_version=$dh{PREVIOUS_VERSION};
 
 	if ($link_doc) {
 		getpackages('both') unless $called_getpackages++;
@@ -197,6 +199,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 			# directory a symlink, then you have to depend on
 			# the target.
 			addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (= \${binary:Version})");
+			# add maintscript helper
+			if ($previous_version) {
+				foreach my $script (qw{postinst preinst prerm postrm}) {
+					autoscript($package, $script, "maintscript-helper",
+					   "s!#PARAMS#!dir_to_symlink /usr/share/doc/$package $link_doc $previous_version!g");
+				}
+			}
 		}
 	}
 	else {
-- 
2.7.0.rc3

Reply via email to