howto/AdvancedDailyAdm: portPatch.bash

File portPatch.bash, 509 bytes (added by BjarneDMat, 10 years ago)

the script for creating a patch

Line 
1#!/macports/bin/bash
2
3declare prefix=${1:-"/macports"}
4declare rsyncMacportsOrg="/var/macports/sources/rsync.macports.org/release/ports"
5
6(   cd $( dirname ${0} )
7
8declare outputFile
9declare patchFile
10
11for port in $(find portfiles -name 'Portfile')
12do
13    outputFile=${port%/*}/patch-${port##*/}
14    rm ${outputFile} 2>/dev/null
15    diff -u \
16        ${prefix}${rsyncMacportsOrg}/${port#*/} \
17        ${port} \
18    > ${outputFile}
19    echo "created patch for ${port}"
20    mv ${port} ${port}.OK
21done
22
23) ; wait