Bug#694400: unblock: latex209/25.mar.1992-13

2012-12-06 Thread Norbert Preining
Dear release managers,

if there is anything I can do about the following unblock requests
please let me know.

THe package is now 10 days in unstable.

On Mo, 26 Nov 2012, Norbert Preining wrote:
 Package: release.debian.org
 Severity: normal
 User: release.debian@packages.debian.org
 Usertags: unblock
 
 Dear release managers,
 
 as a follow up to the many emails that went around the RC bug #669382
 I have now uploaded a fix for it that is radical, but it is the way
 to go, IMNHO.
 
 The problem with the mentioned bug was that mktexlsr was called in
 some unprotected ways. Normally packages use dh_installtex (from 
 tex-common) to auto-generate necessary maintainer script snippets.
 These packages are all fine.
 
 latex209 packages (-base, -bin) were in a state since long with hand
 written maintainer scripts, probably long before dh_installtex was
 conceived, but properly handling these case is tiresome.
 Furthermore, also the format handling (latex format based on the
 shipped files) was hand written and did not conform to the standards
 set forth in tex-common.
 
 After email contact with the current maintainer TSUCHIYA Masatoshi
 he agreed to hand over the package to the Debian TeX Group, and I have
 prepared a package that fixes this bug by the following actions:
 latex209 (25.mar.1992-13) unstable; urgency=low
 
   * Take over maintenance into the Debian TeX Group
   * fix RC bug (Closes: #669382) (create files that are not removed) by:
 - remove all maintainer scripts
 - create the necessary code with dh_installtex
 - add necessary build-dep on tex-common
   * add latex209-bin.preinst to fix up old conffile so that debconf does
 not ask unnecessary questions
 
  -- Norbert Preining prein...@debian.org  Tue, 13 Nov 2012 14:50:17 +0900
 
 
 Let us look at the actual code (dropping trivialities like the
 control changes to maintainers etc). We have to deal with two
 things:
 1* auto-generation of mktexlsr and format generation calls
 2* take over old postinst-generated configuration files without
necessarily bothering the admin
 
 
 First of all we dropped
   postinst, postrm
 for both packages and changed the rules files to include the necessary
 calls to dh_installtex:
 diff -Nru latex209-25.mar.1992/debian/rules latex209-25.mar.1992/debian/rules
 --- latex209-25.mar.1992/debian/rules 2012-05-18 14:45:45.0 +0900
 +++ latex209-25.mar.1992/debian/rules 2012-11-13 14:52:53.0 +0900
 @@ -22,7 +22,9 @@
   rm -f build-stamp
   dh_clean
  
 -build: build-stamp
 +build: build-arch build-indep
 +build-arch: build-stamp
 +build-indep: build-stamp
  build-stamp:
   touch $@
  
 @@ -46,6 +48,7 @@
   mv $(BASE)/splain.tex $(INI)
   mv $(BASE)/latex.ins $(DOC)
   cp -p readme.* $(DOC)
 + dh_installtex
  
  install-bin: prefix=$(CURDIR)/debian/latex209-bin/usr
  install-bin: DH_OPTIONS=-platex209-bin
 @@ -55,6 +58,8 @@
   dh_testroot
   mkdir -p $(BIN)
   cd $(BIN)  ln -s tex latex209
 + dh_installtex --priority=25 formatfile=debian/latex209.cnf \
 + --flavor=format:no_links
  
  install-src: prefix=$(CURDIR)/debian/latex209-src/usr
  install-src: DH_OPTIONS=-platex209-src
 
 
 The second call links to the new file debian/latex209.cnf. THis file
 was previously generated in the postinst and removed/renamed in the
 prerm scripts of the latex209-bin packages.
 diff -Nru latex209-25.mar.1992/debian/latex209.cnf 
 latex209-25.mar.1992/debian/latex209.cnf
 --- latex209-25.mar.1992/debian/latex209.cnf  1970-01-01 09:00:00.0 
 +0900
 +++ latex209-25.mar.1992/debian/latex209.cnf  2012-11-13 14:52:53.0 
 +0900
 @@ -0,0 +1,6 @@
 +#
 +# LaTeX 2.09
 +#
 +# format engine  pattern-filearguments
 +latex209 tex -   latex209.ini
 +
 
 
 Finally, we added one preinst script that tries to carry over information
 from the old package to the new package without asking unnecessary
 questions to the user:
 
 +#!/bin/sh -e
 +#
 +# latex209-bin preinst script
 +#
 +#
 +
 +# if the config file from previous versions is present and matches the
 +# md5sum, add the new dh_installtex header to make sure that no debconf
 +# questions are asked, otherwise just let the user decide.
 +#
 +
 +cnffile=/etc/texmf/fmt.d/25latex209.cnf
 +bakfile=/etc/texmf/fmt.d/25latex209.bak
 +correctmd=7c958ab4f8bf7a0080bc46c48d137bd1
 +
 +fix_it_up=0
 +
 +case $1 in
 +  upgrade|install)
 +old_version=$2
 +if [ -n $old_version ]  dpkg --compare-versions $old_version lt 
 25.mar.1992-12.6 ; then
 +  if [ -r $cnffile ] ; then
 +# if an old conffile is found and matches the md5 sum, we fix it up
 +# otherwise we leave it alone
 + oldmd=`md5sum $cnffile | sed -e 's/ .*//'`
 +if [ $oldmd = $correctmd ] ; then
 +  fix_it_up=1
 +fi
 +  elif [ -r $bakfile ] ; then
 +# if the backup file is found, and matches the md5 sum, we simply 
 delete
 +

Bug#694400: unblock: latex209/25.mar.1992-13

2012-11-25 Thread Norbert Preining
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock

Dear release managers,

as a follow up to the many emails that went around the RC bug #669382
I have now uploaded a fix for it that is radical, but it is the way
to go, IMNHO.

The problem with the mentioned bug was that mktexlsr was called in
some unprotected ways. Normally packages use dh_installtex (from 
tex-common) to auto-generate necessary maintainer script snippets.
These packages are all fine.

latex209 packages (-base, -bin) were in a state since long with hand
written maintainer scripts, probably long before dh_installtex was
conceived, but properly handling these case is tiresome.
Furthermore, also the format handling (latex format based on the
shipped files) was hand written and did not conform to the standards
set forth in tex-common.

After email contact with the current maintainer TSUCHIYA Masatoshi
he agreed to hand over the package to the Debian TeX Group, and I have
prepared a package that fixes this bug by the following actions:
latex209 (25.mar.1992-13) unstable; urgency=low

  * Take over maintenance into the Debian TeX Group
  * fix RC bug (Closes: #669382) (create files that are not removed) by:
- remove all maintainer scripts
- create the necessary code with dh_installtex
- add necessary build-dep on tex-common
  * add latex209-bin.preinst to fix up old conffile so that debconf does
not ask unnecessary questions

 -- Norbert Preining prein...@debian.org  Tue, 13 Nov 2012 14:50:17 +0900


Let us look at the actual code (dropping trivialities like the
control changes to maintainers etc). We have to deal with two
things:
1* auto-generation of mktexlsr and format generation calls
2* take over old postinst-generated configuration files without
   necessarily bothering the admin


First of all we dropped
postinst, postrm
for both packages and changed the rules files to include the necessary
calls to dh_installtex:
diff -Nru latex209-25.mar.1992/debian/rules latex209-25.mar.1992/debian/rules
--- latex209-25.mar.1992/debian/rules   2012-05-18 14:45:45.0 +0900
+++ latex209-25.mar.1992/debian/rules   2012-11-13 14:52:53.0 +0900
@@ -22,7 +22,9 @@
rm -f build-stamp
dh_clean
 
-build: build-stamp
+build: build-arch build-indep
+build-arch: build-stamp
+build-indep: build-stamp
 build-stamp:
touch $@
 
@@ -46,6 +48,7 @@
mv $(BASE)/splain.tex $(INI)
mv $(BASE)/latex.ins $(DOC)
cp -p readme.* $(DOC)
+   dh_installtex
 
 install-bin: prefix=$(CURDIR)/debian/latex209-bin/usr
 install-bin: DH_OPTIONS=-platex209-bin
@@ -55,6 +58,8 @@
dh_testroot
mkdir -p $(BIN)
cd $(BIN)  ln -s tex latex209
+   dh_installtex --priority=25 formatfile=debian/latex209.cnf \
+   --flavor=format:no_links
 
 install-src: prefix=$(CURDIR)/debian/latex209-src/usr
 install-src: DH_OPTIONS=-platex209-src


The second call links to the new file debian/latex209.cnf. THis file
was previously generated in the postinst and removed/renamed in the
prerm scripts of the latex209-bin packages.
diff -Nru latex209-25.mar.1992/debian/latex209.cnf 
latex209-25.mar.1992/debian/latex209.cnf
--- latex209-25.mar.1992/debian/latex209.cnf1970-01-01 09:00:00.0 
+0900
+++ latex209-25.mar.1992/debian/latex209.cnf2012-11-13 14:52:53.0 
+0900
@@ -0,0 +1,6 @@
+#
+# LaTeX 2.09
+#
+# format   engine  pattern-filearguments
+latex209   tex -   latex209.ini
+


Finally, we added one preinst script that tries to carry over information
from the old package to the new package without asking unnecessary
questions to the user:

+#!/bin/sh -e
+#
+# latex209-bin preinst script
+#
+#
+
+# if the config file from previous versions is present and matches the
+# md5sum, add the new dh_installtex header to make sure that no debconf
+# questions are asked, otherwise just let the user decide.
+#
+
+cnffile=/etc/texmf/fmt.d/25latex209.cnf
+bakfile=/etc/texmf/fmt.d/25latex209.bak
+correctmd=7c958ab4f8bf7a0080bc46c48d137bd1
+
+fix_it_up=0
+
+case $1 in
+  upgrade|install)
+old_version=$2
+if [ -n $old_version ]  dpkg --compare-versions $old_version lt 
25.mar.1992-12.6 ; then
+  if [ -r $cnffile ] ; then
+# if an old conffile is found and matches the md5 sum, we fix it up
+# otherwise we leave it alone
+   oldmd=`md5sum $cnffile | sed -e 's/ .*//'`
+if [ $oldmd = $correctmd ] ; then
+  fix_it_up=1
+fi
+  elif [ -r $bakfile ] ; then
+# if the backup file is found, and matches the md5 sum, we simply 
delete
+# it, as it will be reinstatiated by dpkg
+   oldmd=`md5sum $bakfile | sed -e 's/ .*//'`
+if [ $oldmd = $correctmd ] ; then
+  rm $bakfile
+else
+  mv $bakfile $cnffile
+fi
+  fi
+  
+  if [ $fix_it_up = 1 ] ; then
+echo '#