s243a

LinkOrWrapGCC

Jun 3rd, 2018
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash #http://murga-linux.com/puppy/viewtopic.php?p=994267#994267
  2. export SUFF='-63'
  3. export METHOD='wrap'  
  4.  read -r -d '' HDR <<'EOF'
  5. #!/bin/bash
  6. #CPATH=
  7. export C_INCLUDE_PATH='/usr/libgcc63/gcc/i486-slitaz-linux/6.3.0/include'
  8. export CPLUS_INCLUDE_PATH='/usr/include/c++/6.3.0'
  9. #OBJC_INCLUDE_PATH
  10. EOF
  11. echo "HDR=$HDR"
  12. D='$' #I can't get the dollar sign end of line terminator to work with sed no matter what I do!
  13. for line in `cat /var/lib/tazpkg/installed/gcc63/files.list`; do #'/usr/bin/c++-63'; do #
  14.   read -r -d '' SED_EXP <<EOF
  15. s/^\(.*\)\($SUFF\)/a='\1'; b='\2'/p
  16. EOF
  17. echo "SED_EXP=$SED_EXP"
  18. export SED_EXP #Not sure if this is necessary
  19.   echo "line=$line"
  20.   export line #Not sure if this is necessary
  21.   echo "$line2"
  22.   EXP=$( echo "$line" | sed -n "$SED_EXP")
  23.   echo "EXP=$EXP"
  24.   eval "$EXP"
  25.   if [ -n "$b" ]; then
  26.     DNAME="$( dirname $a)"; echo "DNAME=$DNAME"
  27.     cd "$DNAME"
  28.     LNAME="$( basename $a )"
  29.     echo "LNAME=$LNAME"
  30.     ONAME="$LNAME"-63
  31.     echo "ONAME=$ONAME";
  32.     case $METHOD in
  33.         'wrap')
  34.            echo "$HDR" > "$LNAME"; echo "$ONAME "'$@'>>"$LNAME"; chmod 773 "$LNAME"; ;;
  35.         'link')
  36.            ln -s "$ONAME" "$LNAME"; ;;
  37.     esac  
  38.     #exit
  39.   fi
  40. done
RAW Paste Data