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

Norbert Preining preining-guest at costa.debian.org
Thu Sep 29 17:25:55 UTC 2005


Author: preining-guest
Date: 2005-09-29 17:25:55 +0000 (Thu, 29 Sep 2005)
New Revision: 190

Added:
   tex-common/trunk/debian/config.in
   tex-common/trunk/debian/templates
Modified:
   tex-common/trunk/debian/changelog
   tex-common/trunk/debian/postinst.in
   tex-common/trunk/debian/rules
Log:
Manage ls-R files using debconf


Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog	2005-09-27 14:55:04 UTC (rev 189)
+++ tex-common/trunk/debian/changelog	2005-09-29 17:25:55 UTC (rev 190)
@@ -9,6 +9,7 @@
     unknown option [frank]
   * Modify postrm.in script to remove TEXMFSYSVAR and /var/cache/fonts
     (thus also removing left over files at purge time) [preining]
+  * manage ls-R files using debconf [preining] (Closes: #328291)
   * Let the debconf dependency be created by debhelper, thus allowing
     debconf-2.0 as an alternative
 

Added: tex-common/trunk/debian/config.in
===================================================================
--- tex-common/trunk/debian/config.in	2005-09-27 14:55:04 UTC (rev 189)
+++ tex-common/trunk/debian/config.in	2005-09-29 17:25:55 UTC (rev 190)
@@ -0,0 +1,76 @@
+#include variables
+#!/bin/sh -e
+# 
+# config maintainer script for the Debian <:=${PACKAGE}:> package.
+# $Id: config.in 114 2005-08-04 15:04:01Z frn $
+<:=@COPYRIGHT:>//
+
+# Give names to the commandline arguments
+action=$1
+installed_version=$2
+
+
+. <:=${CONFMODULE}:>
+db_version 2.0
+
+#
+# move the answers from tetex-bin to tex-common, if there are no answers
+# in the tex-common db
+maybe_move_answer_and_delete() {
+    $ans = $1
+    # did the user already see this question?
+    db_fget tex-common/$ans seen || true
+    if [ "$RET" = false ] ; then
+        # no, so if the user saw the tetex question, move the answer
+	# to the tex-common question and set the seen flag.
+	db_fget tetex-bin/$ans seen || true
+	if [ "$RET" = true ] ; then
+	    db_get tetex-bin/$ans || true
+	    db_set tex-common/$ans "$RET"
+	    db_fset tex-common/$ans seen true
+	    # now unregister the tetex question
+	    db_unregister tetex-bin/$ans || true
+	fi
+    fi
+}
+
+	
+## do the things we have to do for upgraders from old versions
+# it does not harm to do the checks also when $action is reconfigure.
+
+# suggest a user to rename old cnf files (copyright Atsuhito?)
+# (upgrade from woody, keep for etch?)
+if [ -d /etc/texmf/texmf.d ]; then
+    if ls /etc/texmf/texmf.d 2> /dev/null | egrep -vq '(\.cnf|\.dpkg-.*|~)$'; then
+	db_input medium tex-common/cnf_name || true
+	db_go || true
+    fi
+fi
+
+
+## do the things we have to do always
+db_input low tex-common/managedlsr || true
+db_go
+# we also unregister the tetex-bin/lsr-perms
+db_unregister tetex-bin/lsr-perms || true
+
+db_get tex-common/managedlsr && SELECTED_LSR="$RET"
+if [ ! -n "$SELECTED_LSR" ]; then
+    maybe_move_answer_and_delete groupname   
+    maybe_move_answer_and_delete groupperm
+    maybe_move_answer_and_delete userperm
+    db_beginblock
+    db_input low tex-common/groupname || true
+    db_input low tex-common/groupperm || true
+    db_input low tex-common/userperm || true
+    db_endblock
+fi
+
+db_go
+
+
+# Local Variables:
+# mode: shell-script
+# skeleton-pair: t
+# End:
+

Modified: tex-common/trunk/debian/postinst.in
===================================================================
--- tex-common/trunk/debian/postinst.in	2005-09-27 14:55:04 UTC (rev 189)
+++ tex-common/trunk/debian/postinst.in	2005-09-29 17:25:55 UTC (rev 190)
@@ -8,6 +8,7 @@
 ## Define static variables we need
 MKTMPDIR=<:=$MKTMPDIR:> # mktemp will create its files there
 UCF_FILES="<:=$TEX_COMMON_UCF_FILES:>"
+TEXMFSYSVAR="<:=$TEXMFSYSVAR:>"
 UCF="ucf --debconf-ok"
 #UCF="ucf -d --debconf-ok --verbose"
 FIRST_VERSION_WITH_UPGRADE_PATH=0.3
@@ -106,6 +107,47 @@
     update-updmap
     update-language
 
+#
+# set permission of ls-R files
+    db_get tex-common/managedlsr || true
+    if [ -n "$RET" ] ; then
+      MANAGEDLSR="$RET"
+      echo "Fixing permissions and group of ($MANAGEDLSR) ls-R as specified by debconf ..."
+
+      db_get tex-common/groupperm || true
+      if [ x"$RET" = x"true" ]; then
+        LSRPERMS=66
+      else
+        LSRPERMS=64
+      fi
+      db_get tex-common/userperm || true
+      if [ x"$RET" = x"true" ]; then
+        LSRPERMS="$LSRPERMS"6
+      else
+        LSRPERMS="$LSRPERMS"4
+      fi
+      db_get tex-common/groupname || true
+      LSRGROUP="$RET"
+      # work through the list, stolen from locales.postinst
+      list=`echo $MANAGEDLSR | sed -e 's/, /,/g'`
+      save_IFS=$IFS
+      IFS=,
+      for lsr in $list; do
+        case $lsr in 
+	  main) LSR=$TEXMFSYSVAR/ls-R-TEXMFMAIN ;;
+	  var)  LSR=$TEXMFSYSVAR/ls-R ;;
+	  local) LSR=$TEXMFSYSVAR/ls-R-LOCAL ;;
+	  cache) LSR=/var/cache/fonts/ls-R ;;
+	  *) echo "This should not happen: Don't know how to set this! $lsr" ;;
+	esac
+        chmod -v $LSRPERMS $LSR 2>/dev/null | fgrep changed || true
+	chgrp -v $LSRGROUP $LSR 2>/dev/null | fgrep changed || true
+      done
+      IFS=$save_IFS
+    else
+      echo "Fixing permissions of ls-R files ..."
+      chmod -v 644 $LSRS 2>/dev/null | fgrep changed || true
+    fi
     ;;
   *)
     ;;

Modified: tex-common/trunk/debian/rules
===================================================================
--- tex-common/trunk/debian/rules	2005-09-27 14:55:04 UTC (rev 189)
+++ tex-common/trunk/debian/rules	2005-09-29 17:25:55 UTC (rev 190)
@@ -14,7 +14,7 @@
 teTeX_buildfiles=debian/common.variables debian/common.functions.in
 
 # create maintainer scripts etc.
-EPERL_FILES := debian/common.functions debian/postinst debian/postrm
+EPERL_FILES := debian/common.functions debian/postinst debian/postrm debian/config
 eperl_sourcefiles=debian/variables debian/COPYRIGHT.scripts debian/postinst.functions \
    debian/common.variables debian/common.functions debian/postrm.functions 
 
@@ -95,6 +95,7 @@
 binary-arch: build install
 	dh_testdir
 	dh_testroot
+	dh_installdebconf 
 	dh_installchangelogs 
 	dh_installdocs
 	dh_installexamples

Added: tex-common/trunk/debian/templates
===================================================================
--- tex-common/trunk/debian/templates	2005-09-27 14:55:04 UTC (rev 189)
+++ tex-common/trunk/debian/templates	2005-09-29 17:25:55 UTC (rev 190)
@@ -0,0 +1,67 @@
+Template: tex-common/managedlsr
+Type: multiselect
+Choices: main, cache, local, var
+Default: cache, local
+Description: Select the ls-R file which should be managed by debconf
+ 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 four different locations for TeX files
+ on a Debian system:
+  - main: usually /usr/share/texmf, contains only files installed
+    by debian packages.
+  - local: usually /usr/local/share/texmf, contains local additions
+  - var: usually /var/lib/texmf, contains generated files from the
+    TeX system like format files.
+  - cache: usually /var/cache/fonts, contains generated fonts.
+ You can select from these four locations those whose ls-R file should
+ be managed by debconf.
+ .
+ We suggest selecting cache and local (these are the defaults)
+ and allowing a selected user group to modify these ls-R files
+ out 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.
+ .
+ Some users may have the right to add files to the local texmf tree, so
+ they should also be allowed to change the ls-R file.
+ .
+ Accepting this option will allow you to easily manage the permissions of
+ those ls-R files using debconf. Otherwise you will have to manually
+ ensure that they get useful but safe permissions.
+
+Template: tex-common/groupname
+Type: string
+Default: users
+Description: Which group should own the ls-R files?
+ Modification of ls-R files can be restricted to the members of one group
+ which owns them.  To take advantage of this, add the users to the group of
+ your choice, and enter that group name here.  The default group, 'users', is
+ appropriate for most systems.
+
+Template: tex-common/groupperm
+Type: boolean
+Default: true
+Description: Allow group members to modify ls-R files?
+ Accepting this option will allow members of the owning group to modify the
+ ls-R files.
+
+Template: tex-common/userperm
+Type: boolean
+Default: false
+Description: Allow all users to modify ls-R files?
+ Accepting this option will allow all users to modify ls-R files.  This is
+ generally not a good idea for security reasons; you should instead
+ restrict such access to members of one group.
+
+Template: tex-common/cnf_name
+Type: note
+Description: Change of name of files in /etc/texmf/texmf.d/
+ texmf.cnf has previously been generated by update-texmf from all files
+ in /etc/texmf/texmf.d/. Now update-texmf is changed and only reads
+ files with extension '.cnf'
+ .
+ So if you had any private file in /etc/texmf/texmf.d/, then you should add
+ '.cnf' to its name; for example, 22mymacro => 22mymacro.cnf
+




More information about the Pkg-tetex-commits mailing list