[subversion-commit] SVN tetex commit + diffs: r323 - tex-common/trunk/debian

Frank Küster frank at costa.debian.org
Wed Nov 9 10:59:09 UTC 2005


Author: frank
Date: 2005-11-09 10:59:08 +0000 (Wed, 09 Nov 2005)
New Revision: 323

Modified:
   tex-common/trunk/debian/config.in
   tex-common/trunk/debian/postinst.in
Log:
- add untested code to cater for config running twice
- add missing quotes in config.in

Modified: tex-common/trunk/debian/config.in
===================================================================
--- tex-common/trunk/debian/config.in	2005-11-07 10:10:41 UTC (rev 322)
+++ tex-common/trunk/debian/config.in	2005-11-09 10:59:08 UTC (rev 323)
@@ -37,7 +37,22 @@
 db_unregister tex-common/userperm || true
 
 
-#
+# there was a bug in 0.9 that caused debconf answers to have no effect:
+# reset the seen flag
+if [ "$installed_version" = 0.9 ]; then
+  db_fset tex-common/managedlsr seen false || true
+  db_fset tex-common/groupname seen false || true
+fi
+
+# this script may be run twice: Once by dpkg-preconfigure, once again by
+# debconf when it is sourced in the postinst script.  We must do the
+# following only once, therefore we fiddle with a special flag
+db_fget tex-common/managedlsr firstpass || true
+
+if [ "$RET" != "true" ]; then
+  # we are in the first pass, set the flag and do the things
+  db_fset tex-common/managedlsr firstpass true
+
 # first we collect those ls-R files which are group writeable in gwritetrue
 # and those which are not group writeable in gwritefalse
 # furthermore we save the respective group and write permission in
@@ -90,7 +105,7 @@
       fi
     done
     db_set tex-common/groupname "$iscommongroup" || true
-    if [ -n $iscommongroup ] ; then
+    if [ -n "$iscommongroup" ] ; then
       #
       # here we could be more intelligent and check wether the choosen group
       # actually exist, and if not, reask again!
@@ -99,6 +114,7 @@
       db_go
     fi
 fi
+fi
 #
 # we do not care for user permissions in this setting!
 #

Modified: tex-common/trunk/debian/postinst.in
===================================================================
--- tex-common/trunk/debian/postinst.in	2005-11-07 10:10:41 UTC (rev 322)
+++ tex-common/trunk/debian/postinst.in	2005-11-09 10:59:08 UTC (rev 323)
@@ -98,42 +98,39 @@
 #
 # set permission of ls-R files
     db_get tex-common/managedlsr || true
-    if [ -n "$RET" ] ; then
-      falsegwritefiles=""
-      truegwritefiles=""
-      for i in var cache main ; do
-          if echo $RET | grep -q $i ; then
-	      truegwritefiles="$truegwritefiles $i"
-	  else
-	      falsegwritefiles="$falsegwritefiles $i"
-	  fi
-      done
+    falsegwritefiles=""
+    truegwritefiles=""
+    for i in var cache main ; do
+      if echo $RET | grep -q $i ; then
+	truegwritefiles="$truegwritefiles $i"
+      else
+	falsegwritefiles="$falsegwritefiles $i"
+      fi
+    done
+    for i in $truegwritefiles ; do
+      lsr=`select_lsrfile $i`
+      test -e $lsr || echo "$ls_R_magic" > $lsr 
+      chmod g+w $lsr
+    done
+    for i in $falsegwritefiles ; do
+      lsr=`select_lsrfile $i`
+      test -e $lsr || echo "$ls_R_magic" > $lsr 
+      chmod g-w $lsr
+    done
+    db_get tex-common/groupname || true
+    LSRGROUP="$RET"
+    if [ -n "$LSRGROUP" ] ; then
       for i in $truegwritefiles ; do
-          lsr=`select_lsrfile $i`
-	  test -e $lsr || echo "$ls_R_magic" > $lsr 
-	  chmod g+w $lsr
+	lsr=`select_lsrfile $i`
+	chgrp -v $LSRGROUP $lsr || true
       done
-      for i in $falsegwritefiles ; do
-          lsr=`select_lsrfile $i`
-	  test -e $lsr || echo "$ls_R_magic" > $lsr 
-	  chmod g-w $lsr
-      done
-      db_get tex-common/groupname || true
-      LSRGROUP="$RET"
-      if [ -n $LSRGROUP ] ; then
-        for i in $truegwritefiles ; do
-	    lsr=`select_lsrfile $i`
-	    chgrp -v $LSRGROUP $lsr || true
-	done
-      fi
-    else
-      #
-      # In this case when no ls-R files are managed by debconf
-      # we do nothing. The files get the correct permissions on new
-      # installation, because we ship them like this. And if a user
-      # changes some of the parameters, he is responsible for himself.
-      echo "Leaving permissions of ls-R files as they are ..."
     fi
+
+# the config script may be run twice: Once by dpkg-preconfigure, once
+# again by debconf when it is sourced in the postinst script.  On the
+# first pass, it sets a special flag, which must now be reset.
+    db_fset tex-common/managedlsr firstpass false || true
+
     ;;
   *)
     ;;




More information about the Pkg-tetex-commits mailing list