Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 29th, 2011  |  syntax: Diff  |  size: 1.52 KB  |  hits: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -uNr customizepkg.orig/customizepkg customizepkg/customizepkg
  2. --- customizepkg.orig/customizepkg      2011-01-31 04:31:06.000000000 +0900
  3. +++ customizepkg/customizepkg   2011-10-30 12:35:19.000000000 +0900
  4. @@ -50,15 +50,17 @@
  5.         configfile=$1
  6.         originalscriptfile=$2
  7.         scriptfile=$3
  8. -       grep --invert-match "\(^#\|^$\)" $configfile |
  9. +       separator=$(sed -n "s/^@SEPARATOR=\(.*\)//p" $configfile)
  10. +       separator=${separator:-#}
  11. +       grep --invert-match "\(^#\|^$\|^@\)" $configfile |
  12.         while read line; do
  13.                 unset action context pattern value
  14. -               action=$(echo $line | awk -F# '{ print $1 }')
  15. -               context=$(echo $line | awk -F# '{ print $2 }')
  16. -               pattern=$(echo $line | awk -F# '{ print $3 }')
  17. +               action=$(echo $line | awk -F $separator '{ print $1 }')
  18. +               context=$(echo $line | awk -F $separator '{ print $2 }')
  19. +               pattern=$(echo $line | awk -F $separator '{ print $3 }')
  20.                 case $action in
  21.                         remove|replace)
  22. -                               value=`echo $line | awk -F [^#]# '{print $4}'`
  23. +                               value=`echo $line | awk -F [^$separator]$separator '{print $4}'`
  24.                                 echo "=> removes/replaces '$pattern' by '$value' in $context"
  25.                                 if [ "$action" = "replace" -a "$context" != "global" ]; then
  26.                                         #value=" '$(echo $value | tr -d "\'")' "
  27. @@ -123,7 +125,7 @@
  28.  fi
  29.  
  30.  # creating copy of pkgname string into temporary file
  31. -$( cat ./PKGBUILD | grep "pkgname=" > ./PKGBUILD.pkgname )
  32. +$( cat ./PKGBUILD | grep "pkgname+\?=" > ./PKGBUILD.pkgname )
  33.  # and sourcing it instead of whole PKGBUILD (since it may contains errors)
  34.  source ./PKGBUILD.pkgname 2> /dev/null
  35.  
  36.  
  37.