[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#328291: [Norbert Preining] Re: debconf, tex-common and the management of ls-R and .cnf files



delivered to the wrong bug...

--- Begin Message ---
Hi Frank, hi all!

On Mon, 26 Sep 2005, Norbert Preining wrote:
> To remind us: We should move the config.in from tetex-bin to tex-common.
> (and probably the template file, too).

I suggest the following two things: The debconf questions are moved to
tex-common/*, and answers if already stored in the debconf database, are
taken over to the relevant tex-common questions.

Second: I propose a new question:
-----------------------------
Template: tex-common/onlycachefonts
Type: boolean
Default: true
_Description: Apply debconf rules on ls-R files only to /var/cache/fonts/ls-R
 Files under /var/cache/fonts are generated on the fly by all the users
 in case a font is missing. Therefore it is good to allow the update of 
 /var/cache/fonts/ls-R by a specified group. If you select yes here, only
 this ls-R file is managed by debconf, all the other get save permissions
 and can only be modified by root. If you choose no, all the ls-R files'
 permission are managed by debconf.
----------------------------

To my mind only /var/cache/fonts/ls-R should actually have `liberal'
permissions, while the other ls-R files should not be touchable by
anybody else the root.

I have implemented the take over as follows:
. Copy the template file from tetex-bin and change all the tetex/ to
  tex-common/
. add the above template

and then use the attached config script. 

Please comment on it! I probably have missed something (first time
debconf-er).

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining AT logic DOT at>             Università di Siena
sip:preining@at43.tuwien.ac.at                             +43 (0) 59966-690018
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
MASSACHUSETTS (pl.n.)
Those items and particles which people who, after blowing their noses,
are searching for when they look into their hankies.
			--- Douglas Adams, The Meaning of Liff
#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() {
    $ans = $1
    db_get tex-common/$ans || true
    if [ x"$RET" = x ] ; then
	# nothing already saved to tex-common debconf
	db_get tetex-bin/$ans || true
	if [ ! x"$RET" = x ] ; then
	    # but there is an answer in tetex debconf
	    db_set tex-common/$ans "$RET"
	fi
    fi
}
maybe_move_answer lsr-perms
maybe_move_answer groupname
maybe_move_answer groupperm
maybe_move_answer userperm

	
## 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

# ls-R handling (taken from old config script, copyright?)
db_input low tex-common/lsr-perms || true
db_go

db_get tex-common/lsr-perms
if [ x"$RET" = x"true" ]; then
    db_beginblock
    db_input low tex-common/onlycachefonts || true
    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:


--- End Message ---

-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer

Reply to: