Author: frn Date: 2006-07-12 14:21:27 +0000 (Wed, 12 Jul 2006) New Revision: 1494
Modified: tetex-base/trunk/debian/changelog tetex-base/trunk/debian/common.functions.in tetex-bin/trunk/debian/changelog tetex-bin/trunk/debian/common.functions.in tex-common/trunk/debian/changelog tex-common/trunk/debian/common.functions.in Log: Change create_tetex_formats() in common.functions.in to run fmtutil-sys in a temporary directory; otherwise, it may use files lying in the current directory, which can cause bad surprises (cf. bug #377581). Also replace `command args ...` with $(command args ...) everywhere in the file. In addition to what I mentioned in http://lists.debian.org/debian-tetex-maint/2006/02/msg00222.html, using the $(...) syntax allows one to use paren matching to see in a glimpse that the backquote construct is correct. Very pleasant, IMHO. This file is updated simultaneously in the three source packages: tex-common, tetex-base and tetex-bin. Modified: tetex-base/trunk/debian/changelog =================================================================== --- tetex-base/trunk/debian/changelog 2006-07-12 09:43:21 UTC (rev 1493) +++ tetex-base/trunk/debian/changelog 2006-07-12 14:21:27 UTC (rev 1494) @@ -3,6 +3,9 @@ * Fix broken links in /usr/share/texmf-tetex/doc/index.html and mention tetex-doc-nonfree. Thanks to Hilmar Preusse for the patch (closes: #377744). [florent] + * Refresh common.functions.in. + create_tetex_formats() now runs fmtutil-sys in a temporary directory + (closes: #377581). [florent] -- Florent Rougon <[EMAIL PROTECTED]> Wed, 12 Jul 2006 11:41:06 +0200 Modified: tetex-base/trunk/debian/common.functions.in =================================================================== --- tetex-base/trunk/debian/common.functions.in 2006-07-12 09:43:21 UTC (rev 1493) +++ tetex-base/trunk/debian/common.functions.in 2006-07-12 14:21:27 UTC (rev 1494) @@ -37,35 +37,42 @@ create_tetex_formats(){ options="$@" - tempfile=`mktemp -t tetex.postinst.XXXXXXXX` - echo "Running fmtutil-sys. This may take some time. ..." + printf "Running fmtutil-sys. This may take some time... " # for jadetex safety (see #352391 and friends), remove old latex formats if [ "$options" = "--all" ]; then for file in latex.fmt latex.efmt latex.log pdflatex.fmt pdflatex.efmt pdflatex.log; do rm -f $TEXMFSYSVARDIR/web2c/$file done fi - if fmtutil-sys $options > $tempfile; then - rm -f $tempfile + + # Working in a temporary directory avoids bad suprises caused by TeX first + # looking for input files in the current directory (see bug #377581). + tempdir=$(mktemp -d -t tetex.format_creation.XXXXXXXX) || exit 1 + curdir="$PWD"; cd "$tempdir" + + if fmtutil-sys $options >fmtutil-sys.log; then + cd "$curdir" + rm -r "$tempdir" + echo "done." else echo - echo "fmtutil failed. Output has been stored in" - echo "$tempfile" + echo "fmtutil-sys failed. Output has been stored in:" + echo " $tempdir/fmtutil-sys.log" echo "Please include this file if you report a bug." exit 1 fi } create_fontmaps(){ - tempfile=`mktemp -t tetex.updmap.XXXXXXXX` - echo -n "Running updmap-sys. This may take some time. ..." + tempfile=$(mktemp -t tetex.updmap.XXXXXXXX) + printf "Running updmap-sys. This may take some time... " if updmap-sys 2> $tempfile; then rm -f $tempfile - echo " done." + echo "done." else echo - echo "updmap failed. Output has been stored in" - echo "$tempfile" + echo "updmap-sys failed. Output has been stored in:" + echo " $tempfile" echo "Please include this file if you report a bug." exit 1 fi @@ -88,9 +95,9 @@ CONFSTATEDIR=<:=$confstatedir:> NO_CONFIG_PREFIX=<:=$no_config_prefix:> PCONFSTATEDIR=$CONFSTATEDIR/$PACKAGE - SAVED_CONFIG_FILE=$PCONFSTATEDIR/`basename $CONFIG_FILE` - NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.`basename $CONFIG_FILE` - TEMP_CONFIG_FILE="$PCONFSTATEDIR/`basename $CONFIG_FILE`.tmp" + SAVED_CONFIG_FILE=$PCONFSTATEDIR/$(basename $CONFIG_FILE) + NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.$(basename $CONFIG_FILE) + TEMP_CONFIG_FILE="$PCONFSTATEDIR/$(basename $CONFIG_FILE).tmp" case $1 in --preinst) @@ -262,7 +269,7 @@ dpkg_md5sum(){ file=$1 - md5sum=`grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' '` + md5sum=$(grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -271,7 +278,7 @@ ucf_md5sum(){ file=$1 - md5sum=`grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' '` + md5sum=$(grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -588,28 +595,28 @@ preinst_remove_or_move(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`dpkg_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(dpkg_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file fi } preinst_remove_or_move_ucf(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`ucf_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(ucf_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file if [ -x /usr/bin/ucf ]; then ucf --purge $file; fi Modified: tetex-bin/trunk/debian/changelog =================================================================== --- tetex-bin/trunk/debian/changelog 2006-07-12 09:43:21 UTC (rev 1493) +++ tetex-bin/trunk/debian/changelog 2006-07-12 14:21:27 UTC (rev 1494) @@ -9,6 +9,9 @@ tarball must be unpacked first; but this is because upstream creates the formats with "make install". Funny that nobody ever noticed this for years... [frank] + * Refresh common.functions.in from tex-common. + create_tetex_formats() now runs fmtutil-sys in a temporary directory + (closes: #377997). [florent] -- Frank Küster <[EMAIL PROTECTED]> Thu, 6 Jul 2006 20:21:32 +0200 Modified: tetex-bin/trunk/debian/common.functions.in =================================================================== --- tetex-bin/trunk/debian/common.functions.in 2006-07-12 09:43:21 UTC (rev 1493) +++ tetex-bin/trunk/debian/common.functions.in 2006-07-12 14:21:27 UTC (rev 1494) @@ -37,35 +37,42 @@ create_tetex_formats(){ options="$@" - tempfile=`mktemp -t tetex.postinst.XXXXXXXX` - echo "Running fmtutil-sys. This may take some time. ..." + printf "Running fmtutil-sys. This may take some time... " # for jadetex safety (see #352391 and friends), remove old latex formats if [ "$options" = "--all" ]; then for file in latex.fmt latex.efmt latex.log pdflatex.fmt pdflatex.efmt pdflatex.log; do rm -f $TEXMFSYSVARDIR/web2c/$file done fi - if fmtutil-sys $options > $tempfile; then - rm -f $tempfile + + # Working in a temporary directory avoids bad suprises caused by TeX first + # looking for input files in the current directory (see bug #377581). + tempdir=$(mktemp -d -t tetex.format_creation.XXXXXXXX) || exit 1 + curdir="$PWD"; cd "$tempdir" + + if fmtutil-sys $options >fmtutil-sys.log; then + cd "$curdir" + rm -r "$tempdir" + echo "done." else echo - echo "fmtutil failed. Output has been stored in" - echo "$tempfile" + echo "fmtutil-sys failed. Output has been stored in:" + echo " $tempdir/fmtutil-sys.log" echo "Please include this file if you report a bug." exit 1 fi } create_fontmaps(){ - tempfile=`mktemp -t tetex.updmap.XXXXXXXX` - echo -n "Running updmap-sys. This may take some time. ..." + tempfile=$(mktemp -t tetex.updmap.XXXXXXXX) + printf "Running updmap-sys. This may take some time... " if updmap-sys 2> $tempfile; then rm -f $tempfile - echo " done." + echo "done." else echo - echo "updmap failed. Output has been stored in" - echo "$tempfile" + echo "updmap-sys failed. Output has been stored in:" + echo " $tempfile" echo "Please include this file if you report a bug." exit 1 fi @@ -88,9 +95,9 @@ CONFSTATEDIR=<:=$confstatedir:> NO_CONFIG_PREFIX=<:=$no_config_prefix:> PCONFSTATEDIR=$CONFSTATEDIR/$PACKAGE - SAVED_CONFIG_FILE=$PCONFSTATEDIR/`basename $CONFIG_FILE` - NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.`basename $CONFIG_FILE` - TEMP_CONFIG_FILE="$PCONFSTATEDIR/`basename $CONFIG_FILE`.tmp" + SAVED_CONFIG_FILE=$PCONFSTATEDIR/$(basename $CONFIG_FILE) + NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.$(basename $CONFIG_FILE) + TEMP_CONFIG_FILE="$PCONFSTATEDIR/$(basename $CONFIG_FILE).tmp" case $1 in --preinst) @@ -262,7 +269,7 @@ dpkg_md5sum(){ file=$1 - md5sum=`grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' '` + md5sum=$(grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -271,7 +278,7 @@ ucf_md5sum(){ file=$1 - md5sum=`grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' '` + md5sum=$(grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -588,28 +595,28 @@ preinst_remove_or_move(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`dpkg_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(dpkg_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file fi } preinst_remove_or_move_ucf(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`ucf_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(ucf_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file if [ -x /usr/bin/ucf ]; then ucf --purge $file; fi Modified: tex-common/trunk/debian/changelog =================================================================== --- tex-common/trunk/debian/changelog 2006-07-12 09:43:21 UTC (rev 1493) +++ tex-common/trunk/debian/changelog 2006-07-12 14:21:27 UTC (rev 1494) @@ -7,26 +7,36 @@ Ralf Stubner for his "braindump". This change requires installation of a file in a TEXMF tree; we - therefore run mktexlsr if it is available. + therefore run mktexlsr if it is available. [frank] + * Debconf Translations: [frank] - Updated Czech translation, thanks to Miroslav Kure - <[EMAIL PROTECTED]> + <[EMAIL PROTECTED]> - Updated Japanese translation, thank to Kenshi Muto <[EMAIL PROTECTED]> (closes: #376632, #377945) - Updated brazilian Portuguese translation, thanks to Felipe Augusto - van de Wiel (faw) <[EMAIL PROTECTED]> + van de Wiel (faw) <[EMAIL PROTECTED]> - Updated Danish translation, thanks to Claus Hindsgaul <[EMAIL PROTECTED]> (closes: #377664) - Updated German translation, thanks to Helge Kreutzmann - <[EMAIL PROTECTED]> + <[EMAIL PROTECTED]> - Updated italian translation, thanks to Luca Monducci <[EMAIL PROTECTED]> (closes: #377378). - Updated french translation, thanks to Jean-Baka Domelevo-Entfellner <[EMAIL PROTECTED]> (closes: #377388) - Updated Swedish translation, thanks to Daniel Nylander - <[EMAIL PROTECTED]> + <[EMAIL PROTECTED]> - Updated Lithuanian translation, thanks to Kęstutis Biliūnas - <[EMAIL PROTECTED]> + <[EMAIL PROTECTED]> + + * common.functions.in: [florent] + + change create_tetex_formats() so that fmtutil-sys is run in a + temporary directory; otherwise, it may use files lying in the + current directory, which can cause bad surprises. This will close + #377581 when propagated to the various packages using this function + in their maintainer scripts. + + replace `command args ...` with $(command args ...) everywhere in + the file. -- Frank Küster <[EMAIL PROTECTED]> Wed, 12 Jul 2006 11:06:24 +0200 Modified: tex-common/trunk/debian/common.functions.in =================================================================== --- tex-common/trunk/debian/common.functions.in 2006-07-12 09:43:21 UTC (rev 1493) +++ tex-common/trunk/debian/common.functions.in 2006-07-12 14:21:27 UTC (rev 1494) @@ -37,35 +37,42 @@ create_tetex_formats(){ options="$@" - tempfile=`mktemp -t tetex.postinst.XXXXXXXX` - echo "Running fmtutil-sys. This may take some time. ..." + printf "Running fmtutil-sys. This may take some time... " # for jadetex safety (see #352391 and friends), remove old latex formats if [ "$options" = "--all" ]; then for file in latex.fmt latex.efmt latex.log pdflatex.fmt pdflatex.efmt pdflatex.log; do rm -f $TEXMFSYSVARDIR/web2c/$file done fi - if fmtutil-sys $options > $tempfile; then - rm -f $tempfile + + # Working in a temporary directory avoids bad suprises caused by TeX first + # looking for input files in the current directory (see bug #377581). + tempdir=$(mktemp -d -t tetex.format_creation.XXXXXXXX) || exit 1 + curdir="$PWD"; cd "$tempdir" + + if fmtutil-sys $options >fmtutil-sys.log; then + cd "$curdir" + rm -r "$tempdir" + echo "done." else echo - echo "fmtutil failed. Output has been stored in" - echo "$tempfile" + echo "fmtutil-sys failed. Output has been stored in:" + echo " $tempdir/fmtutil-sys.log" echo "Please include this file if you report a bug." exit 1 fi } create_fontmaps(){ - tempfile=`mktemp -t tetex.updmap.XXXXXXXX` - echo -n "Running updmap-sys. This may take some time. ..." + tempfile=$(mktemp -t tetex.updmap.XXXXXXXX) + printf "Running updmap-sys. This may take some time... " if updmap-sys 2> $tempfile; then rm -f $tempfile - echo " done." + echo "done." else echo - echo "updmap failed. Output has been stored in" - echo "$tempfile" + echo "updmap-sys failed. Output has been stored in:" + echo " $tempfile" echo "Please include this file if you report a bug." exit 1 fi @@ -88,9 +95,9 @@ CONFSTATEDIR=<:=$confstatedir:> NO_CONFIG_PREFIX=<:=$no_config_prefix:> PCONFSTATEDIR=$CONFSTATEDIR/$PACKAGE - SAVED_CONFIG_FILE=$PCONFSTATEDIR/`basename $CONFIG_FILE` - NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.`basename $CONFIG_FILE` - TEMP_CONFIG_FILE="$PCONFSTATEDIR/`basename $CONFIG_FILE`.tmp" + SAVED_CONFIG_FILE=$PCONFSTATEDIR/$(basename $CONFIG_FILE) + NO_CONFIG_FILE=$PCONFSTATEDIR/$NO_CONFIG_PREFIX.$(basename $CONFIG_FILE) + TEMP_CONFIG_FILE="$PCONFSTATEDIR/$(basename $CONFIG_FILE).tmp" case $1 in --preinst) @@ -262,7 +269,7 @@ dpkg_md5sum(){ file=$1 - md5sum=`grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' '` + md5sum=$(grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -271,7 +278,7 @@ ucf_md5sum(){ file=$1 - md5sum=`grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' '` + md5sum=$(grep "$file$" /var/lib/ucf/hashfile | cut -f 1 -d ' ') if [ -z "$md5sum" ]; then get_sarge_md5sum_from_list $file fi @@ -588,28 +595,28 @@ preinst_remove_or_move(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`dpkg_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(dpkg_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file fi } preinst_remove_or_move_ucf(){ file=/etc/texmf/$1 - newname=`get_newfilename $1` + newname=$(get_newfilename $1) debug $file test -f "$file" || return 0 debug "handled\n" - oldmd5sum=`ucf_md5sum $file` - currmd5sum=`md5sum $file | cut -d ' ' -f 1` + oldmd5sum=$(ucf_md5sum $file) + currmd5sum=$(md5sum $file | cut -d ' ' -f 1) if [ "$oldmd5sum" != "$currmd5sum" ]; then - mv $file $oldstuff_dir/`basename $file`.$PREINST_MOVE_EXT + mv $file $oldstuff_dir/$(basename $file).$PREINST_MOVE_EXT else rm $file if [ -x /usr/bin/ucf ]; then ucf --purge $file; fi _______________________________________________ Pkg-tetex-commits mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-tetex-commits

