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

Re: transitioning from conffile to ucf



En réponse à Frank Küster <frank@debian.org>:

> Darren Salt <linux@youmustbejoking.demon.co.uk> schrieb:
> 
> > You mean /usr/share/doc/tetex-base/remove-oldmaps :-)
> 
> Err, yes. And it isn't even executable. That way, I hope to make
> people think before typing.

  When I use such a script, I like it prints what it is doing.
What about applying this kind of patch :

--- remove-oldmaps.old  2004-10-15 11:42:18.000000000 +0200
+++ remove-oldmaps      2004-10-15 11:41:54.000000000 +0200
@@ -91,13 +91,28 @@
                                                                                
 generated_links="dvipdfm.map pdftex.map psfonts.map"
                                                                                
+if [ "$1" = "--force-delete" ]; then
+  ACTION='rm -v'
+else
+  ACTION='echo File to remove:'
+  TO_REMOVE=false
+fi
+
 for oldmap in $ANTP $ANTT $BLUESKY $CCPL $LUCIDA $PSNFSS \
   $MISC $EXTRAMISC $TETEX $PL $QFNT $XYPIC $OMEGA_UCF $BSRTETEX_UCF $oldfiles;
do
 #   $generated $oldfiles; do
   file=$DVIPS/$oldmap
-  if [ -e $file -a ! -L $file ]; then rm $file; fi
+  if [ -e $file -a ! -L $file ]; then $ACTION $file; TO_REMOVE=true; fi
 done
                                                                                
+if [ "$TO_REMOVE" = true ]; then
+  if [ "$1" != "--force-delete" ]; then
+    echo "Use '--force-delete' to remove previoulsy listed files"
+  fi
+else
+  echo "I found no file to remove"
+fi
+
 # for oldlink in $generated_links; do
 #   file=$DVIPS/$oldlink
 #   if [ -L $file -a ! -f "`readlink $file`" ]; then rm $file; fi

  Vincent



Reply to: