All pastes #186874 Raw Edit

Divers

public text v1 · immutable
#186874 ·published 2006-09-30 15:25 UTC
rendered paste body
--- makepkg.orig	2006-09-30 02:41:04.000000000 +0000
+++ makepkg	2006-09-30 04:12:45.000000000 +0000
@@ -42,18 +42,11 @@
 fi
 
 make_install_script() {
-  COUNT=1
-  LINE="`sed -n "$COUNT p" $1`"
-  while [ ! "$LINE" = "" ]; do
-   LINKGOESIN="`echo "$LINE" | cut -f 1 -d " "`" 
-   LINKGOESIN="`dirname $LINKGOESIN`" 
-   LINKNAMEIS="`echo "$LINE" | cut -f 1 -d ' '`"
-   LINKNAMEIS="`basename "$LINKNAMEIS"`"
-   LINKPOINTSTO="`echo "$LINE" | cut -f 3 -d ' '`"
-   echo "( cd $LINKGOESIN ; rm -rf $LINKNAMEIS )"
-   echo "( cd $LINKGOESIN ; ln -sf $LINKPOINTSTO $LINKNAMEIS )"
-   COUNT=`expr $COUNT + 1`
-   LINE="`sed -n "$COUNT p" $1`"
+  cat $1 | while read LINK SEP TARGET ; do
+   DIR="`dirname $LINK`" 
+   NAME="`basename $LINK`"
+   echo "( cd $DIR ; rm -rf $NAME )"
+   echo "( cd $DIR ; ln -sf $TARGET $NAME )"
   done
 }
 
@@ -126,7 +119,7 @@
 # Get rid of possible pre-existing trouble:
 INST=`mktemp $TMP/makepkg.XXXXXX`
 # This requires the ls from coreutils-5.0 (or newer):
-find . -type l -exec ls -l --time-style=long-iso {} \; | while read foo ; do echo $foo ; done | cut -f 8- -d ' ' | cut -b3- | tee $INST
+find . -type l -printf "%P -> %l\n" | tee $INST
 if [ ! "`cat $INST`" = "" ]; then
   echo
   echo "Making symbolic link creation script:"