Re: [locales] Solving the "debconf is not a registry" issue
On Wed, Apr 30, 2003 at 10:48:40PM +0200, Denis Barbier wrote:
> On Thu, May 01, 2003 at 01:06:00AM +0900, GOTO Masanori wrote:
> [...]
> > > > ex)
> > > > char=`tail -1 /etc/locale.gen`
> > > > if [ -n "$char" ]; then
> > > > echo
> > > > fi
> > >
> > > No, an EOL has to be added if last line is not empty but does not contain
> > > an EOL.
> >
> > Hmm, why?
> >
> > At least I think it's fine compared with an empty line is inserted one
> > by one. Or am I missing?
>
> No, that's me, I misunderstood your test.
> But your solution will also add an empty line one by one, we need a flag
> to insert it only once, here is a patch.
Ahem, here it is.
Denis
Index: postinst
===================================================================
RCS file: /cvs/glibc/glibc-package/debian/locales/DEBIAN/postinst,v
retrieving revision 1.8
diff -u -r1.8 postinst
--- postinst 28 Apr 2003 04:45:02 -0000 1.8
+++ postinst 30 Apr 2003 21:02:35 -0000
@@ -30,6 +30,7 @@
list=`echo $SELECTED_LOCALES | sed -e 's/, /,/g'`
save_IFS=$IFS
IFS=,
+ first=true
for locale in $list; do
if grep -q "^#$locale *\$" $LG; then
# Uncomment previous defined locales
@@ -37,10 +38,8 @@
mv -f $LG.tmp $LG
else
# Add a newline in case last line does not have one
- echo >> $LG
- # Consecutive blank lines are replaced by a single line
- cat -s $LG > $LG.tmp
- mv -f $LG.tmp $LG
+ [ -n "$first" ] && echo >> $LG
+ first=
# Add a new locale
echo $locale >> $LG
fi
Reply to: