On Thu, Oct 29, 2009 at 06:09:29PM -0500, Manoj Srivastava wrote:
> Package: memtest86
> Version: 3.5-2
> Severity: serious
> User: lintian-ma...@debian.org
> Usertags: read-in-maintainer-script
> 
>  This maintainer script appears to use read to get information from the
>  user. Prompting in maintainer scripts must be done by communicating through a
>  program such as debconf which conforms to the Debian Configuration management
>  specification, version 2 or higher.
>  
>  Refer to Debian Policy Manual section 3.9.1 (Prompting in maintainer scripts)
>  for details.
>  
> ,----[ 3.9.1 Prompting in maintainer scripts ]
> | Package maintainer scripts may prompt the user if necessary. Prompting must 
> be
> | done by communicating through a program, such as debconf, which conforms to 
> the
> | Debian Configuration Management Specification, version 2 or higher.
> | 
> | Packages which are essential, or which are dependencies of essential 
> packages,
> | may fall back on another prompting method if no such interface is available 
> when
> | they are executed.
> | 
> | The Debian Configuration Management Specification is included in the
> | debconf_specification files in the debian-policy package. 
> `----

Attached is a patch that fixes this problem and bug 523114 (the patch is not
very small since I had to fix some other bugs in the package, see the
changelog).

A package built with the above patch is available on mentors,
http://mentors.debian.net/debian/pool/main/m/memtest86/memtest86_3.5-2.1.dsc.

regards,
iustin
diff -urN /tmp/memtest86-3.5/debian/changelog memtest86-3.5/debian/changelog
--- /tmp/memtest86-3.5/debian/changelog	2009-12-04 15:35:25.000000000 +0100
+++ memtest86-3.5/debian/changelog	2009-12-04 16:08:22.425296367 +0100
@@ -1,3 +1,17 @@
+memtest86 (3.5-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Replace manual propt with debconf (Closes: #553291).
+  * Change grub-pc entry from 'linux' to 'linux16' (similar to the fix
+    for #539907).
+  * Fix "please source grub-mkconfig_lib instead of deprecated update-
+    grub_lib in /etc/grub.d/20_memtest86" (apply same patch as in #522345)
+    (Closes: #523114)
+  * Due to the above changes, conflict with old version of grub-pc and
+    grub-common that don't support these.
+
+ -- Iustin Pop <iu...@k1024.org>  Fri, 04 Dec 2009 16:07:31 +0100
+
 memtest86 (3.5-2) unstable; urgency=low
 
   * Sync'd packaging with memtest86+ 2.11-3.
diff -urN /tmp/memtest86-3.5/debian/config memtest86-3.5/debian/config
--- /tmp/memtest86-3.5/debian/config	1970-01-01 01:00:00.000000000 +0100
+++ memtest86-3.5/debian/config	2009-12-04 15:08:22.348991249 +0100
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+db_input medium shared/memtest86-run-lilo || true
+db_go || true
+
+#DEBHELPER#
diff -urN /tmp/memtest86-3.5/debian/control memtest86-3.5/debian/control
--- /tmp/memtest86-3.5/debian/control	2009-12-04 15:35:25.000000000 +0100
+++ memtest86-3.5/debian/control	2009-12-04 16:09:33.511956385 +0100
@@ -2,14 +2,15 @@
 Section: misc
 Priority: optional
 Maintainer: Yann Dirson <dir...@debian.org>
-Build-Depends: debhelper (>> 5), dh-buildinfo
+Build-Depends: debhelper (>> 5), dh-buildinfo, po-debconf
 Homepage: http://www.memtest86.com/
 Standards-Version: 3.8.0
 
 Package: memtest86
 Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 lpia hurd-i386
 Depends: ${misc:Depends}
-Suggests: hwtools, memtester, kernel-patch-badram, memtest86+, grub2 (>=1.95+20070515-1) | grub (>= 0.95+cvs20040624), mtools
+Suggests: hwtools, memtester, kernel-patch-badram, memtest86+, grub2 (>=1.96+20090523-1) | grub (>= 0.95+cvs20040624), mtools
+Conflicts: grub-pc (<< 1.96+20090523-1), grub-common (<< 1.96+20090523-1)
 Description: thorough real-mode memory tester
  Memtest86 scans your RAM for errors.
  .
diff -urN /tmp/memtest86-3.5/debian/grub memtest86-3.5/debian/grub
--- /tmp/memtest86-3.5/debian/grub	2009-12-04 15:35:25.000000000 +0100
+++ memtest86-3.5/debian/grub	2009-12-04 15:32:56.172176130 +0100
@@ -1,13 +1,13 @@
 #!/bin/sh
 set -e
 
-. /usr/lib/grub/update-grub_lib
+. /usr/lib/grub/grub-mkconfig_lib
 if test -e /boot/memtest86.bin ; then
   MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86.bin" )
   echo "Found memtest86 image: $MEMTESTPATH" >&2
   cat << EOF
 menuentry "Memory test (memtest86)" {
-	linux	$MEMTESTPATH
+	linux16	$MEMTESTPATH
 }
 EOF
 fi
diff -urN /tmp/memtest86-3.5/debian/po/POTFILES.in memtest86-3.5/debian/po/POTFILES.in
--- /tmp/memtest86-3.5/debian/po/POTFILES.in	1970-01-01 01:00:00.000000000 +0100
+++ memtest86-3.5/debian/po/POTFILES.in	2009-12-04 15:08:22.382324153 +0100
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff -urN /tmp/memtest86-3.5/debian/po/templates.pot memtest86-3.5/debian/po/templates.pot
--- /tmp/memtest86-3.5/debian/po/templates.pot	1970-01-01 01:00:00.000000000 +0100
+++ memtest86-3.5/debian/po/templates.pot	2009-12-04 15:08:22.388987325 +0100
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <em...@address>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: memtest...@packages.debian.org\n"
+"POT-Creation-Date: 2009-12-02 22:23+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <em...@address>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Run lilo automatically after upgrade (if found)?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"If lilo is installed and its configuration file contains the memtest86/"
+"memtest86+ image, then it should be re-run in order to allow booting the new "
+"image."
+msgstr ""
diff -urN /tmp/memtest86-3.5/debian/postinst memtest86-3.5/debian/postinst
--- /tmp/memtest86-3.5/debian/postinst	2009-12-04 15:35:25.000000000 +0100
+++ memtest86-3.5/debian/postinst	2009-12-04 15:11:03.635637983 +0100
@@ -1,23 +1,20 @@
 #!/bin/sh
 set -e
 
-# offer to run LILO
-# (adapted from snippet by chr....@gmx.net)
-if [ -x /sbin/lilo ] && [ -r /etc/lilo.conf ] &&
-	[ "${DEBIAN_FRONTEND}" != "noninteractive" ] &&
+. /usr/share/debconf/confmodule
+
+if [ "$1" = configure ]; then
+    db_get shared/memtest86-run-lilo
+    if [ "$RET" = true ] &&
+	[ -x /sbin/lilo ] && [ -r /etc/lilo.conf ] &&
 	grep "image.*=.*/boot/memtest86.bin" /etc/lilo.conf >/dev/null
-then
-    echo "You seem to have an entry for memtest86 in /etc/lilo.conf."
-    printf "Run lilo now [y/N]? "
-    read c
-    if [ "$c" = "y" ] || [ "$c" = "Y" ]
     then
 	lilo
     fi
-fi
 
-if [ "$1" = "configure" ] && [ -x "`which update-grub2 2>/dev/null`" ] ; then
-    update-grub2
+    if [ -x "`which update-grub2 2>/dev/null`" ] ; then
+	update-grub2
+    fi
 fi
 
 #DEBHELPER#
diff -urN /tmp/memtest86-3.5/debian/rules memtest86-3.5/debian/rules
--- /tmp/memtest86-3.5/debian/rules	2009-12-04 15:35:25.000000000 +0100
+++ memtest86-3.5/debian/rules	2009-12-04 15:08:22.418991016 +0100
@@ -46,7 +46,7 @@
 binary-arch: build install
 	dh_testdir
 	dh_testroot
-#	dh_installdebconf
+	dh_installdebconf
 	dh_installdocs README
 	dh_buildinfo
 	dh_installexamples debian/lilo.conf debian/grub-menu.lst
diff -urN /tmp/memtest86-3.5/debian/templates memtest86-3.5/debian/templates
--- /tmp/memtest86-3.5/debian/templates	1970-01-01 01:00:00.000000000 +0100
+++ memtest86-3.5/debian/templates	2009-12-04 15:08:22.428987032 +0100
@@ -0,0 +1,7 @@
+Template: shared/memtest86-run-lilo
+Type: boolean
+Default: false
+_Description: Run lilo automatically after upgrade (if found)?
+ If lilo is installed and its configuration file contains the
+ memtest86/memtest86+ image, then it should be re-run in order to
+ allow booting the new image.

Reply via email to