Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uNr customizepkg.orig/customizepkg customizepkg/customizepkg
- --- customizepkg.orig/customizepkg 2011-01-31 04:31:06.000000000 +0900
- +++ customizepkg/customizepkg 2011-10-30 12:35:19.000000000 +0900
- @@ -50,15 +50,17 @@
- configfile=$1
- originalscriptfile=$2
- scriptfile=$3
- - grep --invert-match "\(^#\|^$\)" $configfile |
- + separator=$(sed -n "s/^@SEPARATOR=\(.*\)//p" $configfile)
- + separator=${separator:-#}
- + grep --invert-match "\(^#\|^$\|^@\)" $configfile |
- while read line; do
- unset action context pattern value
- - action=$(echo $line | awk -F# '{ print $1 }')
- - context=$(echo $line | awk -F# '{ print $2 }')
- - pattern=$(echo $line | awk -F# '{ print $3 }')
- + action=$(echo $line | awk -F $separator '{ print $1 }')
- + context=$(echo $line | awk -F $separator '{ print $2 }')
- + pattern=$(echo $line | awk -F $separator '{ print $3 }')
- case $action in
- remove|replace)
- - value=`echo $line | awk -F [^#]# '{print $4}'`
- + value=`echo $line | awk -F [^$separator]$separator '{print $4}'`
- echo "=> removes/replaces '$pattern' by '$value' in $context"
- if [ "$action" = "replace" -a "$context" != "global" ]; then
- #value=" '$(echo $value | tr -d "\'")' "
- @@ -123,7 +125,7 @@
- fi
- # creating copy of pkgname string into temporary file
- -$( cat ./PKGBUILD | grep "pkgname=" > ./PKGBUILD.pkgname )
- +$( cat ./PKGBUILD | grep "pkgname+\?=" > ./PKGBUILD.pkgname )
- # and sourcing it instead of whole PKGBUILD (since it may contains errors)
- source ./PKGBUILD.pkgname 2> /dev/null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement