Bug#219156: tetex-bin: postinst script fails to run texconfig under dash
(Hi Atsuhito,
at the very end of this mail is a patch!)
Michel Casabona <michel.casabona@free.fr> wrote:
> I've attached two test scripts, t1 and t2. Code is basically an extract
> of tetex-bin.postinst and texconfig. Run t1 that in turn call t2
Again i couldn't reproduce it.
Hm, reading the link you provided it seems to me that IFS should be
marked for export in any case, together with LANG, LC_*, HOME and
friends. As far as I understood it is only up to the implementation to
decide wether it should ignore it even if it _is_ set. However, in my
bash on woody
$ export | grep IFS
$ export | egrep 'HOME|LANG|LC_' | wc -l
5
$
dash in my pbuilder sid does the same, how is it with your dash?
> It seems to me that bash behaviour is the intended one (if I read bash
> source code correctly), although not mentionned in the doc.
> It doesn't mean that it's more correct than dash though.
> Actually, it is implementation dependent according to this doc:
>
> http://www.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_05_03
>
> So in the end, I believe that the problem is with texconfig that should
> not rely on the current value of IFS when it starts.
I agree. Both behaviors are allowed, so a script should not rely on
that. A patch is really simple, it seems, I attach it below.
> I don't understand why you couldn't reproduce the problem, so it may be
> caused by something special to my configs but I fail to see what.
Which version of dash do you use? There are some occurences of IFS in
the changelog, but rather long back.
Bye, Frank
--- tetex-bin-2.0.2/debian/postinst.orig Tue Nov 18 14:28:51 2003
+++ tetex-bin-2.0.2/debian/postinst Tue Nov 18 14:29:46 2003
@@ -176,6 +176,7 @@
(cd ${LDATD} ; ln -s ${LDAT} .)
fi
db_get tetex-bin/hyphen || true
+ OIFS=$IFS
IFS=' ,'
lang="$RET"
for l in $lang; do
@@ -195,6 +196,7 @@
*) sed -e "s/%! $l/$l/" $LDAT > $LDAT_$$; mv $LDAT_$$ $LDAT ;;
esac
done
+ IFS=$OIFS
else
if [ -f ${ELDAT} ]; then
rm -f ${LDATD}/language.dat
--
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie
Reply to: