[linux-base] 01/02: linux-check-removal: Set debconf title as it is not set automatically

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Mon Jun 6 15:39:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux-base.

commit c054a850795328fa88c487ad2d86bf7db51ffd79
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Mon Jun 6 16:37:49 2016 +0100

    linux-check-removal: Set debconf title as it is not set automatically
    
    debconf only generates a title automatically when used directly from a
    maintainer script.  Also, the automatic title says we are 'configuring' a
    package but we're not.
---
 bin/linux-check-removal     | 12 ++++++++++++
 debian/linux-base.templates |  4 ++++
 man/linux-check-removal.1   |  3 +++
 3 files changed, 19 insertions(+)

diff --git a/bin/linux-check-removal b/bin/linux-check-removal
index 1487850..5c41239 100755
--- a/bin/linux-check-removal
+++ b/bin/linux-check-removal
@@ -90,9 +90,17 @@ sub check {
 	$ENV{'DEBIAN_FRONTEND'} ne 'noninteractive') {
 	use Debconf::Client::ConfModule qw(:all);
 
+	my $title = 'linux-base/removing-title';
 	my $question = "linux-base/removing-running-kernel";
 	my ($ret, $seen, $answer);
 
+	# debconf only generates a title automatically when used directly
+	# from a maintainer script.  Also, the automatic title says we are
+	# 'configuring' a package but we're not.
+	($ret) = settitle($title);
+	if ($ret) {
+	    die "Failed to set title: $ret";
+	}
 	($ret) = fset($question, 'seen', 'false');
 	if ($ret) {
 	    die "Failed to reset seen flag for $question: $ret";
@@ -101,6 +109,10 @@ sub check {
 	if ($ret) {
 	    die "Failed to reset answer for $question: $ret";
 	}
+	($ret) = subst($question, 'package', $ENV{DPKG_MAINTSCRIPT_PACKAGE});
+	if ($ret) {
+	    die "Failed to substitute package name in title: $ret";
+	}
 	($ret) = subst($question, 'running', $running);
 	if ($ret) {
 	    die "Failed to substitute version in $question: $ret";
diff --git a/debian/linux-base.templates b/debian/linux-base.templates
index 77593c9..6b0a6a0 100644
--- a/debian/linux-base.templates
+++ b/debian/linux-base.templates
@@ -7,6 +7,10 @@
 # Even minor modifications require translation updates and such
 # changes should be coordinated with translators and reviewers.
 
+Template: linux-base/removing-title
+Type: title
+_Description: Removing ${package}
+
 Template: linux-base/removing-running-kernel
 Type: boolean
 Default: true
diff --git a/man/linux-check-removal.1 b/man/linux-check-removal.1
index be07ba3..c06a53d 100644
--- a/man/linux-check-removal.1
+++ b/man/linux-check-removal.1
@@ -30,6 +30,9 @@ running kernel but will always succeed
 Name of the preferred debconf front-end.  If set to
 \fInoninteractive\fR, debconf prompts are disabled and
 \fBlinux\-check\-removal\fR always quietly succeeds.
+.TP
+.I DPKG_MAINTSCRIPT_PACKAGE
+Name of the package to be removed, automatically set by dpkg.
 
 .SH AUTHOR
 \fBlinux\-check\-removal\fR and this manual page were written by Ben

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux-base.git



More information about the Kernel-svn-changes mailing list