[Pkg-jed-commit] r479 - jed/trunk/debian

Rafael Laboissiere rafael at alioth.debian.org
Wed Jan 10 09:54:01 CET 2007


Author: rafael
Date: 2007-01-10 09:54:01 +0100 (Wed, 10 Jan 2007)
New Revision: 479

Removed:
   jed/trunk/debian/jed-common.preinst
Modified:
   jed/trunk/debian/changelog
   jed/trunk/debian/control
   jed/trunk/debian/jed-common.config
Log:
This is a rather big commit, so I will try to explain it better than
the terse lines in debian/changelog.  The motivations for the changes
came from the fact that I was unable to run the config/preinst scripts
corectly for the jed-common package.  It seems to work now in the
case where there are old config files around, either untouched or
changed by the user.

The code in jed-common.config and jed-common.preinst (which was
already repetitive) was merged together and appears now only in
jed-common.config.  The jed-common.preinst script has been deleted,
and the debconf dependency restored (instead of pre-dependecy) for
jed-common.

By the way, these two scripts were apparently not synchronized:
jed-common.preinst dealt with 00debian.sl, jed.conf, 00site.sl and
99defaults.sl, while jed-common.config only dealt with the last two
files.  Besides, there was strange non ASCII characters in file
jed-common.preinst (line 25, in the md5sum command) in the place of a
hyphen ("-").  I presume that this character sneaked in the file from
using some UTF-8 enabled editor.  Also, at a given point it tried to
delete /etc/jed-init.d/defaults.sl instead of
/etc/jed-init.d/99defaults.sl.  Finally, the logic was wrong.  Anyway,
the script as it was could never work correctly.

In the new jed-common.config script, the files 00site.sl and
99defaults.sl are treated twice, considering the md5sums for both the
woody distribution and the last version in sarge/testing after which
those files were deprecated.  The logic is also changes to comply with
the advertised behavior (cf the debconf question itself).  One
important thing is the introduction of the necessary call to "db_fset
jed-common/rm-site-defaults seen false", which forces the question to
be asked in any case if one of the configuration files changed.


Modified: jed/trunk/debian/changelog
===================================================================
--- jed/trunk/debian/changelog	2007-01-10 00:02:24 UTC (rev 478)
+++ jed/trunk/debian/changelog	2007-01-10 08:54:01 UTC (rev 479)
@@ -2,12 +2,17 @@
 
   NOT YET RELEASED!
 
-  * po/sv.po: Adjusted msgid strings to correspond to those in
+  * debian/po/sv.po: Adjusted msgid strings to correspond to those in
     po/templates.pot, otherwise po2debconf will not include the sv
     translations [RL]
 
-  * po/pt_BR.po: Updated file [RL]
+  * debian/po/pt_BR.po: Updated file [RL]
 
+  * debian/jed-common.config: Made this debconf script works as expected [RL]
+  * debian/jed-common.preinst: Removed file [RL]
+  * debian/control: Since the preinst script is gone, moved debconf from
+    Pre-Depends to Depends for jed-common
+
  --
 
 jed (0.99.18-7) unstable; urgency=low

Modified: jed/trunk/debian/control
===================================================================
--- jed/trunk/debian/control	2007-01-10 00:02:24 UTC (rev 478)
+++ jed/trunk/debian/control	2007-01-10 08:54:01 UTC (rev 479)
@@ -5,8 +5,9 @@
 Uploaders: Rafael Laboissiere <rafael at debian.org>
 Standards-Version: 3.7.2
 Build-Depends-Indep: hevea
-Build-Depends: debhelper (>= 4.1.16), dpatch, libgpmg1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libslang2-dev, libxft-dev, libxt-dev, pkg-config
-
+Build-Depends: debhelper (>= 4.1.16), dpatch, libslang2-dev, libxft-dev,
+ libgpmg1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], libxt-dev,
+ pkg-config
 Package: jed
 Architecture: any
 Depends: ${shlibs:Depends}, jed-common (>= ${Source-Version})
@@ -73,8 +74,7 @@
 Replaces: jed-sl
 Conflicts: jed-sl, jed (<< ${Source-Version}), xjed (<< ${Source-Version})
 Recommends: jed | xjed
-Pre-Depends: debconf | debconf-2.0
-Depends: findutils (>= 4.1.20-6)
+Depends: findutils (>= 4.1.20-6), debconf | debconf-2.0
 Description: S-Lang runtime files for jed and xjed
  Jed is a small, fast and powerful text editor.
  .

Modified: jed/trunk/debian/jed-common.config
===================================================================
--- jed/trunk/debian/jed-common.config	2007-01-10 00:02:24 UTC (rev 478)
+++ jed/trunk/debian/jed-common.config	2007-01-10 08:54:01 UTC (rev 479)
@@ -4,22 +4,51 @@
 
 . /usr/share/debconf/confmodule
 
-if [ -e /etc/jed-init.d/00site.sl ] ||
-   [ -e /etc/jed-init.d/99defaults.sl ]; then
+# Files 00site.sl and 99defaults.sl are duplicated below because we
+# consider the version released in woody as well as the latest version in
+# testing before these values were deprecated
+file_0=/etc/jed-init.d/00site.sl
+file_1=$file_0
+file_2=/etc/jed-init.d/99defaults.sl
+file_3=$file_2
+file_4=/etc/jed-init.d/00debian.sl
+file_5=/etc/jed.conf
 
-    # the md5sums posted by Rafael on pkg-jed-devel at l.a.d.o
-    if ( [ -e /etc/jed-init.d/00site.sl ] &&
-         echo '2e00fef46fcee03fe504cea3b58510b6  /etc/jed-init.d/00site.sl' |
-         md5sum -c 2>/dev/null ) ||
-       ( [ -e /etc/jed-init.d/99defaults.sl ] &&
-         echo '1514586554dfe5aefcee84aa967fb01b  /etc/jed-init.d/99default.sl' |
-         md5sum -c 2>/dev/null )
-    then
-        db_input medium jed-common/rm-site-defaults || true
-    else
-       # they aren't modified
-       db_set jed-common/rm-site-defaults true
+# md5sums from jed-0.99.9-14 (woody)
+md5sum_0=38af7aa6498bfd7be927aa52c6c46585
+md5sum_1=91a5aee61e23906dcfffd24904d7ef62
+
+# md5sums posted by Rafael Laboissiere on pkg-jed-devel at l.a.d.o
+md5sum_2=38af7aa6498bfd7be927aa52c6c46585
+md5sum_3=1514586554dfe5aefcee84aa967fb01b
+
+# md5sum from jed-common 0.99.16-5 (sarge)
+md5sum_4=5bf498a3703c5330e3acea00d0fa7a87
+md5sum_5=5f0954b045b6b81f1ef0ba545d42c000
+
+changed=false
+
+for n in 0 1 2 3 4 5 ; do
+    eval "file=\$file_$n ; md5sum=\$md5sum_$n"
+    if [ -e $file ] ; then
+        if echo "$md5sum  $file" | md5sum -c >/dev/null 2>&1 ; then
+	    rm -f $file
+	else
+	    changed=true
+	fi
     fi
+done
+
+echo $changed
+
+if $changed = true ; then
+    db_fset jed-common/rm-site-defaults seen false
+    db_input medium jed-common/rm-site-defaults || true
+    db_go
+    db_get jed-common/rm-site-defaults
+    if [ "$RET" = true ] ; then
+        for n in 0 1 2 3 4 5 ; do
+            eval "rm -f \$file_$n"
+	done
+    fi    
 fi
-
-db_go || true

Deleted: jed/trunk/debian/jed-common.preinst
===================================================================
--- jed/trunk/debian/jed-common.preinst	2007-01-10 00:02:24 UTC (rev 478)
+++ jed/trunk/debian/jed-common.preinst	2007-01-10 08:54:01 UTC (rev 479)
@@ -1,54 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
-    install|upgrade)
-        . /usr/share/debconf/confmodule
-
-	file_0=/etc/jed-init.d/00site.sl
-        file_1=/etc/jed-init.d/99default.sl
-        file_2=/etc/jed-init.d/00debian.sl
-        file_3=/etc/jed.conf
-
-        # the md5sums posted by Rafael on pkg-jed-devel at l.a.d.o
-        md5sum_0=2e00fef46fcee03fe504cea3b58510b6
-        md5sum_1=1514586554dfe5aefcee84aa967fb01b
-        # md5sum from jed-common 0.99.16‐5 aka Sarge
-        md5sum_2=5bf498a3703c5330e3acea00d0fa7a87
-        md5sum_3=5f0954b045b6b81f1ef0ba545d42c000
-
-        prompt=false
-        for i in 0 1 2 3; do
-            eval "file=\$file_$i; md5sum=\$md5sum_$i"
-            if [ -e $file ]; then
-                if echo "$md5sum   $file" | md5sum ‐c >/dev/null 2>&1; then
-                    prompt=true
-                else
-                    rm $file
-                fi
-            fi
-        done
-
-        if $prompt; then
-            db_input medium jed-common/rm-site-defaults || true
-            db_go || true
-            db_get jed-common/rm-site-defaults
-            if [ "$RET" = true ]; then
-            	rm -f /etc/jed-init.d/00site.sl /etc/jed-init.d/defaults.sl
-            fi
-        fi
-    ;;
-
-    abort-upgrade)
-    ;;
-
-    *)
-        echo "preinst called with unknown argument \`$1'" >&2
-        exit 0
-    ;;
-esac
-
-#DEBHELPER#
-
-exit 0




More information about the Pkg-jed-commit mailing list