File: organizeincludes.sh

package info (click to toggle)
scip 10.0.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 76,156 kB
  • sloc: ansic: 716,600; cpp: 41,095; awk: 9,195; sh: 4,918; makefile: 4,044; python: 2,076; perl: 731; xml: 660; java: 314; php: 24; lisp: 15
file content (18 lines) | stat: -rwxr-xr-x 573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /bin/bash
echo "organizing includes..."
for i in newfiles/scip/*.c
do
   echo $i
   ./list_includes.py $i > tmp.list
   echo "#include \"scip/$(basename $i .c).h\"" >> tmp.list
   cat tmp.list | grep scip/scip_ | sort -u > tmp2.list
   cat tmp.list | grep scip/pub_ | sort -u > tmp3.list
   mv tmp2.list tmp.list
   sed -e '/scip_bandit.h/{:a; N; /scip_var.h/!ba; r tmp.list' -e 'd;}' $i  > tmpnewfile.c
   mv tmpnewfile.c $i

   mv tmp3.list tmp.list
   sed -e '/pub_bandit.h/{:a; N; /pub_expr.h/!ba; r tmp.list' -e 'd;}' $i  > tmpnewfile.c

   mv tmpnewfile.c $i
done