File: tlp_diff.sh

package info (click to toggle)
tulip 4.8.0dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 179,264 kB
  • ctags: 64,517
  • sloc: cpp: 600,444; ansic: 36,311; makefile: 22,136; python: 1,304; sh: 946; yacc: 522; xml: 337; pascal: 157; php: 66; lex: 55
file content (44 lines) | stat: -rwxr-xr-x 1,024 bytes parent folder | download
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
# diff from tlp files
# scene descriptions are removed before diff

# remove old files 
if [ -f tlp_diff_arg1.tlp ]; then
    rm tlp_diff_arg1.tlp
fi

if [ -f tlp_diff_arg2.tlp ]; then
    rm tlp_diff_arg2.tlp
fi

# remove tlp, date, comments and viewFontAwesomeIcon property
sed -e '/(tlp /,/Tulip.")/d' -e '/(property  0 string "viewFontAwesomeIcon"/ {
N
N
d}' -e '/(graph_attributes / {
N
N
d}' -e '/(string "file" "/,0d' $1 > tlp_diff_arg1.tlp
sed -e '/(tlp /,/Tulip.")/d' -e '/(property  0 string "viewFontAwesomeIcon"/ {
N
N
d}' -e '/(graph_attributes / {
N
N
d}' -e '/(string "file" "/,0d' $2 > tlp_diff_arg2.tlp

# and controller description if needed
if [ "$TLP_DIFF_CONTROLLER" = "NO" ]; then
  sed '/(controller /,$d' tlp_diff_arg1.tlp > tlp_diff2_arg1.tlp
  mv tlp_diff2_arg1.tlp tlp_diff_arg1.tlp
  sed '/(controller /,$d' tlp_diff_arg2.tlp > tlp_diff2_arg2.tlp
  mv tlp_diff2_arg2.tlp tlp_diff_arg2.tlp
fi

diff tlp_diff_arg1.tlp tlp_diff_arg2.tlp

ok=$?

# remove created files
rm tlp_diff_arg*.tlp

exit $ok