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

Norbert Preining preining-guest at costa.debian.org
Tue Feb 14 10:34:55 UTC 2006


Author: preining-guest
Date: 2006-02-14 10:34:54 +0000 (Tue, 14 Feb 2006)
New Revision: 512

Modified:
   tex-common/trunk/debian/config.in
   tex-common/trunk/debian/postinst.in
   tex-common/trunk/debian/templates
Log:
no lsr handling, but cache handling


Modified: tex-common/trunk/debian/config.in
===================================================================
--- tex-common/trunk/debian/config.in	2006-02-13 22:44:01 UTC (rev 511)
+++ tex-common/trunk/debian/config.in	2006-02-14 10:34:54 UTC (rev 512)
@@ -35,99 +35,40 @@
 # and unregister old tex-common questions, they are not needed anymore
 db_unregister tex-common/groupperm || true
 db_unregister tex-common/userperm || true
+db_unregister tex-common/managedlsr || true
 
+# we set the groupname seen flag to false in any case since now it has
+# a completely new meaning
+db_fset tex-common/groupname seen false || 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
+db_fget tex-common/managecache firstrundone || 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
+  db_fset tex-common/managecache firstrundone 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
-# ${i}group
-gwritetrue=""
-gwritefalse=""
-lsrfile_exists=""
-for i in var cache main ; do
-    eval ${i}group=""
-    lsr=`select_lsrfile $i`
-    if [ -r $lsr ] ; then
-        lsrfile_exists="true"
-    	tmp=`ls -l $lsr | awk '{print$4}'`
-	eval ${i}group=$tmp
-	if ls -l $lsr | grep -q ^.....w ; then
-	    gwritetrue="$gwritetrue $i"
-	else
-	    gwritefalse="$gwritefalse $i"
-	fi
-    fi
-done
-#
-# now we save the list of group writeable ls-R files to tex-common/managedlsr
-# (but only if we found any.  On a fresh install, we'll show the default.')
-if [ "$lsrfile_exists" = "true" ]; then
-    db_set tex-common/managedlsr $gwritetrue || true
-fi
-#
-# and ask the user to check if this selection is ok
-db_input low tex-common/managedlsr || true
-db_go
-
-#
-# get the answer of the users, ie what files should really be group writeable
-db_get tex-common/managedlsr && SELECTED_LSR="$RET" || true
-if [ -n "$SELECTED_LSR" ]; then
-    #
-    # we check wether all the group writeable files belong to the same group,
-    # but we do this for the old setting, so that one can add group-writable files.
-    # if yes, we suggest this group and ask the groupname question,
-    # otherwise we ignore this and do *not* play around with groups.
-  #
-  # if no ls-R files exist, or none were group-writable, we also ask the groupname question:
-  if [ "$lsrfile_exists" != "true" ] || [ -z "$gwritetrue" ]; then
-    iscommongroup=none
+  # check wether the directory /var/cache/fonts is group writeable and
+  # for which group
+  PERMS=$(stat --format="%a" /var/cache/fonts)
+  GROUP=$(stat --format="%G" /var/cache/fonts)
+  if [ $PERMS = 2775 ] ; then
+    db_set tex-common/managecache true || true
+    db_set tex-common/groupname "$GROUP" || true
   else
-    iscommongroup=-1
-    for i in $gwritetrue ; do
-      eval tmp=\$${i}group
-      if [ "X$iscommongroup" = "X-1" ] ; then
-	 iscommongroup=$tmp
-      else
-         if [ ! $tmp = $iscommongroup ] ; then
-	    iscommongroup=""
-	 fi
-      fi
-    done
-    # $iscommongroup will be empty only if there were 2 or 3 group-writable
-    # ls-R files belonging to different groups.
-    db_set tex-common/groupname "$iscommongroup" || true
+    db_set tex-common/managecache false || true
   fi
+  db_input low tex-common/managecache || true
+  db_go
 
-  if [ -n "$iscommongroup" ] ; then
-      #
-      # here we could be more intelligent and check wether the choosen group
-      # actually exist, and if not, reask again!
-      #
+  db_get tex-common/managecache || true
+  if [ "$RET" = true ]; then
     db_input low tex-common/groupname || true
     db_go
   fi
 fi
-fi
-#
-# we do not care for user permissions in this setting!
-#
 
 # Local Variables:
 # mode: shell-script

Modified: tex-common/trunk/debian/postinst.in
===================================================================
--- tex-common/trunk/debian/postinst.in	2006-02-13 22:44:01 UTC (rev 511)
+++ tex-common/trunk/debian/postinst.in	2006-02-14 10:34:54 UTC (rev 512)
@@ -117,41 +117,22 @@
     update-updmap
     update-language
 
-#
-# set permission of ls-R files
-    db_get tex-common/managedlsr || true
-    falsegwritefiles=""
-    truegwritefiles=""
-    for i in var cache main ; do
-      if echo $RET | grep -q $i ; then
-	truegwritefiles="$truegwritefiles $i"
-      else
-	falsegwritefiles="$falsegwritefiles $i"
+    #
+    # do the config stuff
+    db_get tex-common/managecache || true
+    if [ $RET = true ] ; then
+      db_get tex-common/groupname || true
+      GROUP="$RET"
+      if [ -n "$GROUP" ] ; then
+        find /var/cache/fonts -type d -print0 | xargs -0r chmod 02755
+	find /var/cache/fonts -type d -print0 | xargs -0r chown "root:$GROUP"
       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`
-	chgrp -v $LSRGROUP $lsr || true
-      done
     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
+    # 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/managecache firstrundone false || true
 
     ;;
   *)

Modified: tex-common/trunk/debian/templates
===================================================================
--- tex-common/trunk/debian/templates	2006-02-13 22:44:01 UTC (rev 511)
+++ tex-common/trunk/debian/templates	2006-02-14 10:34:54 UTC (rev 512)
@@ -1,40 +1,22 @@
-Template: tex-common/managedlsr
-Type: multiselect
-Choices: main, cache, var
-Default: cache
-_Description: Select the ls-R file which should be writable by their respective group.
- There are many files installed in a typical TeX system. To speed up the
- search of these files a list of available files is stored in a file called
- ls-R. There are three different locations for TeX files on a Debian system:
-  - main: usually /usr/share/texmf, contains only files installed
-    by debian packages.
-  - var: usually /var/lib/texmf, contains generated files from the
-    TeX system like format files.
-  - cache: usually /var/cache/fonts, contains generated fonts.
+Template: tex-common/managecache
+Type: boolean
+Default: true
+_Description: Manage the permissions of the TeX font cache with debconf.
+ A TeX system may have to generate new font data (pixel data, metric,
+ sources) on the fly. These files can be saved into the TeX font cache
+ in /var/cache/fonts and later reused.
  .
- You can select from these three locations those whose ls-R files should
- be group writable. Group write permissions for deselected ls-R will
- be removed.
- .
- We suggest selecting cache (this is the defaults) and allowing
- a selected user group to modify these ls-R files, because of the following
- reasons:
- .
- A lot of font files have to be generated before they can be used by xdvi,
- dvips etc. These files are stored in /var/cache/fonts, so that they do not
- need to be regenerated every time.  Usually, these files are created on-the-fly 
- when needed.  Since the directory is group-writable, the ls-R file should
- be the same
+ If you accept, you can specify a group name and *all* directories under
+ /var/cache/fonts will get ownership root:<groupname> and permission
+ bits 2755 (i.e. writeable for the group <groupname> and sticky bit set).
 
 Template: tex-common/groupname
 Type: string
 Default: users
-_Description: Which group should own the ls-R files?
- You can choose a specific group which the previously selected ls-R files
- should belong to. If you do not enter a group name here, the group
- ownership of the selected files will not be touched at all. If you
- have selected 'cache' in the previous question, we would suggest to select
- the group 'users' here.
+_Description: Which group should own the TeX font cache.
+ You can choose a specific group which will own all directories under and
+ including the TeX font cache /var/cache/fonts. These directories will 
+ get permission bits 2755. We suggest to select the group 'users' here.
 
 Template: tex-common/cnf_name
 Type: note




More information about the Pkg-tetex-commits mailing list