File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ PATH=$TOPLEVEL/scripts:$PATH
20
20
21
21
cd $TOPLEVEL
22
22
23
+ # GNU prefix command for mac os support (gsed, gsplit)
24
+ GP=
25
+ if [[ " $OSTYPE " =~ darwin* ]]; then
26
+ GP=g
27
+ fi
28
+
23
29
if ! type -p astyle.sh > /dev/null; then
24
30
echo astyle.sh not found
25
31
exit 1
40
46
set -e
41
47
42
48
# determine changed files
43
- MODIFIED=$( git status --porcelain| sed -ne " s/^ *[MA] *//p" | sort -u)
49
+ MODIFIED=$( git status --porcelain| ${GP} sed -ne " s/^ *[MA] *//p" | sort -u)
44
50
45
51
if [ -z " $MODIFIED " ]; then
46
52
echo nothing was modified
@@ -108,11 +114,11 @@ for f in $MODIFIED; do
108
114
if [[ $f =~ ^src\/ (core| gui| analysis)\/ .* \. h$ ]]; then
109
115
# look if corresponding SIP file
110
116
# echo $f
111
- sip_include=$( sed -r ' s/^src\/(\w+)\/.*$/python\/\1\/\1.sip/' <<< $f )
112
- sip_file=$( sed -r ' s/^src\/(core|gui|analysis)\///; s/\.h$/.sip/' <<< $f )
117
+ sip_include=$( ${GP} sed -r ' s/^src\/(\w+)\/.*$/python\/\1\/\1.sip/' <<< $f )
118
+ sip_file=$( ${GP} sed -r ' s/^src\/(core|gui|analysis)\///; s/\.h$/.sip/' <<< $f )
113
119
if grep -Exq " ^\s*%Include $sip_file " ${TOPLEVEL} /$sip_include ; then
114
120
# echo "in SIP"
115
- sip_file=$( sed -r ' s/^src\///; s/\.h$/.sip/' <<< $f )
121
+ sip_file=$( ${GP} sed -r ' s/^src\///; s/\.h$/.sip/' <<< $f )
116
122
# check it is not blacklisted (i.e. manualy SIP)
117
123
if ! grep -Fxq " $sip_file " python/auto_sip.blacklist; then
118
124
# echo "automatic file"
You can’t perform that action at this time.
0 commit comments