File: changext

package info (click to toggle)
dcmtk 3.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 54,900 kB
  • sloc: cpp: 274,805; ansic: 47,345; makefile: 5,313; sh: 4,250; perl: 277; xml: 182; lex: 103
file content (149 lines) | stat: -rwxr-xr-x 8,034 bytes parent folder | download | duplicates (4)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#! /bin/sh
#
# This script changes the file name extension for all C++ files
# from .cc to a different extension. This is useful for C++ compilers
# which do note recognise ".cc" as a valid extension for C++ code.
# For instance, the IBM xlC compiler on AIX 3.x requires ".C" and
# older versions of Microsoft Visual C++ need ".cpp" or ".cxx".
#
# The script must be called from the "dcmtk/" directory, e.g.
#   cd dcmtk
#   config/changext cpp
#
# The first command line argument (if given) overrides the
#   new extension (default: C).
#   You must not specify the dot preceding the extension.
#
# The second command line argument (if given) overrides the
#   old extension (default: cc). This is useful if you want
#   to "rename back".
#
# Author: Marco Eichelberg, (C) 1997-2011 Kuratorium OFFIS e.V.
#

newext=${1-C}
oldext=${2-cc}

echo "renaming C++ files from .$oldext to .$newext"
for file in `find . -name "*.$oldext" -print`
do
  newfile=`echo $file | sed -e "s/\.$oldext/\.$newext/g"`
  `mv $file $newfile`
done

if [ -f dcmjpls/apps/dcml2pnm.$newext ] ; then
  echo "updating implementation include in dcml2pnm.$newext"
  `cat dcmjpls/apps/dcml2pnm.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmimage\/apps\/dcm2pnm\.$oldext\"/#include \"..\/..\/dcmimage\/apps\/dcm2pnm.$newext\"/g" >dcmjpls/apps/dcml2pnm.new`
  `mv dcmjpls/apps/dcml2pnm.new dcmjpls/apps/dcml2pnm.$newext`
fi

if [ -f dcmjpeg/apps/dcmj2pnm.$newext ] ; then
  echo "updating implementation include in dcmj2pnm.$newext"
  `cat dcmjpeg/apps/dcmj2pnm.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmimage\/apps\/dcm2pnm\.$oldext\"/#include \"..\/..\/dcmimage\/apps\/dcm2pnm.$newext\"/g" >dcmjpeg/apps/dcmj2pnm.new`
  `mv dcmjpeg/apps/dcmj2pnm.new dcmjpeg/apps/dcmj2pnm.$newext`
fi

if [ -f dcmjpeg/apps/dcmmkdir.$newext ] ; then
  echo "updating implementation include in dcmmkdir.$newext"
  `cat dcmjpeg/apps/dcmmkdir.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmdata\/apps\/dcmgpdir\.$oldext\"/#include \"..\/..\/dcmdata\/apps\/dcmgpdir.$newext\"/g" >dcmjpeg/apps/dcmmkdir.new`
  `mv dcmjpeg/apps/dcmmkdir.new dcmjpeg/apps/dcmmkdir.$newext`
fi

if [ -f dcmeval/apps/tcpsrv_e.$newext ] ; then
  echo "updating implementation include in tcpsrv_e.$newext"
  `cat dcmeval/apps/tcpsrv_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmprscp\/apps\/tcpsrv\.$oldext\"/#include \"..\/..\/dcmprscp\/apps\/tcpsrv.$newext\"/g" >dcmeval/apps/tcpsrv_e.new`
  `mv dcmeval/apps/tcpsrv_e.new dcmeval/apps/tcpsrv_e.$newext`
fi

if [ -f dcmeval/apps/tcpprt_e.$newext ] ; then
  echo "updating implementation include in tcpprt_e.$newext"
  `cat dcmeval/apps/tcpprt_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmprint\/apps\/tcpprt\.$oldext\"/#include \"..\/..\/dcmprint\/apps\/tcpprt.$newext\"/g" >dcmeval/apps/tcpprt_e.new`
  `mv dcmeval/apps/tcpprt_e.new dcmeval/apps/tcpprt_e.$newext`
fi

if [ -f dcmeval/apps/dcmcjp2k_e.$newext ] ; then
  echo "updating implementation include in dcmcjp2k_e.$newext"
  `cat dcmeval/apps/dcmcjp2k_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmjp2k\/apps\/dcmcjp2k\.$oldext\"/#include \"..\/..\/dcmjp2k\/apps\/dcmcjp2k.$newext\"/g" >dcmeval/apps/dcmcjp2k_e.new`
  `mv dcmeval/apps/dcmcjp2k_e.new dcmeval/apps/dcmcjp2k_e.$newext`
fi

if [ -f dcmeval/apps/dcmdjp2k_e.$newext ] ; then
  echo "updating implementation include in dcmdjp2k_e.$newext"
  `cat dcmeval/apps/dcmdjp2k_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmjp2k\/apps\/dcmdjp2k\.$oldext\"/#include \"..\/..\/dcmjp2k\/apps\/dcmdjp2k.$newext\"/g" >dcmeval/apps/dcmdjp2k_e.new`
  `mv dcmeval/apps/dcmdjp2k_e.new dcmeval/apps/dcmdjp2k_e.$newext`
fi

if [ -f dcmqrdbx/apps/dcmqrscq.$newext ] ; then
  echo "updating implementation include in dcmqrscq.$newext"
  `cat dcmqrdbx/apps/dcmqrscq.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmqrdb\/apps\/dcmqrscp\.$oldext\"/#include \"..\/..\/dcmqrdb\/apps\/dcmqrscp.$newext\"/g" >dcmqrdbx/apps/dcmqrscq.new`
  `mv dcmqrdbx/apps/dcmqrscq.new dcmqrdbx/apps/dcmqrscq.$newext`
fi

if [ -f dcmeval/apps/ppsscpfs_e.$newext ] ; then
  echo "updating implementation include in ppsscpfs_e.$newext"
  `cat dcmeval/apps/ppsscpfs_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsscpfs\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsscpfs.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppscefs\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppscefs.$newext\"/g" >dcmeval/apps/ppsscpfs_e.new`
  `mv dcmeval/apps/ppsscpfs_e.new dcmeval/apps/ppsscpfs_e.$newext`
fi

if [ -f dcmeval/apps/ppsmgr_e.$newext ] ; then
  echo "updating implementation include in ppsmgr_e.$newext"
  `cat dcmeval/apps/ppsmgr_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsmgr\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsmgr.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmpps\/apps\/ppsmgrce\.$oldext\"/#include \"..\/..\/dcmpps\/apps\/ppsmgrce.$newext\"/g" >dcmeval/apps/ppsmgr_e.new`
  `mv dcmeval/apps/ppsmgr_e.new dcmeval/apps/ppsmgr_e.$newext`
fi

if [ -f dcmeval/apps/pawscpfs_e.$newext ] ; then
  echo "updating implementation include in pawscpfs_e.$newext"
  `cat dcmeval/apps/pawscpfs_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmppswm\/apps\/pawscpfs\.$oldext\"/#include \"..\/..\/dcmppswm\/apps\/pawscpfs.$newext\"/g" | sed -e "s/#include \"\.\.\/\.\.\/dcmppswm\/apps\/pawcefs\.$oldext\"/#include \"..\/..\/dcmppswm\/apps\/pawcefs.$newext\"/g" >dcmeval/apps/pawscpfs_e.new`
  `mv dcmeval/apps/pawscpfs_e.new dcmeval/apps/pawscpfs_e.$newext`
fi

if [ -f dcmeval/apps/dcmanon_e.$newext ] ; then
  echo "updating implementation include in dcmanon_e.$newext"
  `cat dcmeval/apps/dcmanon_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmmisc\/apps\/dcmanon\.$oldext\"/#include \"..\/..\/dcmmisc\/apps\/dcmanon.$newext\"/g" >dcmeval/apps/dcmanon_e.new`
  `mv dcmeval/apps/dcmanon_e.new dcmeval/apps/dcmanon_e.$newext`
fi

if [ -f dcmmisc/apps/detecscp.$newext ] ; then
  echo "updating implementation include in detecscp.$newext"
  `cat dcmmisc/apps/detecscp.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmnet\/apps\/storescp\.$oldext\"/#include \"..\/..\/dcmnet\/apps\/storescp.$newext\"/g" >dcmmisc/apps/detecscp.new`
  `mv dcmmisc/apps/detecscp.new dcmmisc/apps/detecscp.$newext`
fi

if [ -f dcmmisc/apps/detecscu.$newext ] ; then
  echo "updating implementation include in detecscu.$newext"
  `cat dcmmisc/apps/detecscu.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmnet\/apps\/echoscu\.$oldext\"/#include \"..\/..\/dcmnet\/apps\/echoscu.$newext\"/g" >dcmmisc/apps/detecscu.new`
  `mv dcmmisc/apps/detecscu.new dcmmisc/apps/detecscu.$newext`
fi

if [ -f dcmeval/apps/mppsscu_e.$newext ] ; then
  echo "updating implementation include in mppsscu_e.$newext"
  `cat dcmeval/apps/mppsscu_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmppscu\/apps\/mppsscu\.$oldext\"/#include \"..\/..\/dcmppscu\/apps\/mppsscu.$newext\"/g" >dcmeval/apps/mppsscu_e.new`
  `mv dcmeval/apps/mppsscu_e.new dcmeval/apps/mppsscu_e.$newext`
fi

if [ -f dcmeval/apps/stcomscu_e.$newext ] ; then
  echo "updating implementation include in stcomscu_e.$newext"
  `cat dcmeval/apps/stcomscu_e.$newext | sed -e "s/#include \"\.\.\/\.\.\/dcmstcom\/apps\/stcomscu\.$oldext\"/#include \"..\/..\/dcmstcom\/apps\/stcomscu.$newext\"/g" >dcmeval/apps/stcomscu_e.new`
  `mv dcmeval/apps/stcomscu_e.new dcmeval/apps/stcomscu_e.$newext`
fi

echo "updating makefiles"
for file in `find . -name "Makefile*" -print`
do
  `cat $file | sed -e "s/\.$oldext/\.$newext/g" >$file.new`
  `mv $file.new $file`
done

if [ -f CMake/GenerateDCMTKConfigure.cmake ] ; then
  echo "updating CMake/GenerateDCMTKConfigure.cmake"
  cat CMake/GenerateDCMTKConfigure.cmake | sed -e "s/\.$oldext/.$newext/g" > CMake/GenerateDCMTKConfigure.cmake.new
  mv CMake/GenerateDCMTKConfigure.cmake.new CMake/GenerateDCMTKConfigure.cmake
fi

if [ -f CMake/dcmtkMacros.cmake ] ; then
  echo "updating CMake/dcmtkMacros.cmake"
  cat CMake/dcmtkMacros.cmake | sed -e "s/\.$oldext/.$newext/g" > CMake/dcmtkMacros.cmake.new
  mv CMake/dcmtkMacros.cmake.new CMake/dcmtkMacros.cmake
fi

echo "done."