-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean
executable file
·44 lines (39 loc) · 1.4 KB
/
clean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# The output of the clean compiler is not very suited for post-processing.
# Different kinds of error messages have different formats, file names are not
# absolute, a lot of progress output is generated that has nothing to do with
# errors, and so on.
#
# This script is a wrapper that filters and mangles output to make it more
# suitable for post-processing.
function postprocessFilenames() {
# The generated filenames in tags files have dots instead of slashes for hierarchical modules.
# We need to replace all dots with slashes, except the one before icl or dcl
# /home/mkl/clean/clean-svn-2016-08-26/lib/iTasks-SDK/Server/iTasks.API.Core.Types.icl
# becomes
# /home/mkl/clean/clean-svn-2016-08-26/lib/iTasks-SDK/Server/iTasks/API/Core/Types.icl
# first, replace all dots with slashes
sed 's#\.#\/#g' |\
# restore the last dot for .icl and .dcl
sed 's#\/\([id]cl[\t,]\)#.\1#'
}
unbuffer cpm $1 |\
grep -f $CLEAN_DEV_TOOLS/filter_clean_crap.grep -v |\
# postprocessFilenames is needed if there are compile errors in hierarchical
# modules like Control.Monad.icl but right now it is more confusing than it
# helps. Need to be smarter.
#postprocessFilenames |\
tee errors.err
if [ -s errors.err ]
then
exit 1
else
# generate tags
if [ -f makeTags.sh ]
then
# my makeTags.sh is just:
# cloogletags -c -l -d .
. makeTags.sh >/dev/null 2>&1
fi
exit 0
fi