Changeset 4481 for palm/trunk/SCRIPTS/document_changes
- Timestamp:
- Mar 31, 2020 6:55:54 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/document_changes
r4370 r4481 25 25 # ----------------- 26 26 # $Id$ 27 # Bugfix for copyright updates 28 # 29 # 4370 2020-01-10 14:00:44Z raasch 27 30 # script made bash compatible 28 31 # … … 204 207 done <"$fn" 205 208 206 207 209 208 210 # 209 211 #-- check for updates of the copyright statement 210 found_update_year=false211 212 212 while read line 213 213 do … … 216 216 line_tmp2="" 217 217 line_tmp=${line:22:29} 218 line_tmp2=${line:2:1 5}219 220 # echo "$line_tmp $line_tmp2" 221 222 if [[ "$line_tmp" == "Leibniz Universitaet Hannover" && "$line_tmp2" == "Copyright 1997-" ]]223 then224 225 year_in_file=${line:17:4} 226 if [[ "$year_in_file " != "$current_year" ]]218 line_tmp2=${line:2:10} 219 220 if [[ "$line_tmp2" == "Copyright " ]] 221 then 222 year_in_file1=${line:12:4} 223 year_in_file2=${line:17:4} 224 institution=${line:22} 225 226 if [[ "$year_in_file2" != "$current_year" ]] 227 227 then 228 229 228 printf "\r%$(tput cols)s" " " 230 229 printf "\r \e[1;33m*** Copyright update required in $fn\e[0m\n" 231 230 232 231 comment_char=${line:0:1} 233 found_update_year=true234 232 cp $fn $fn~ 235 233 234 (( count_updates = count_updates + 1 )) 235 sed -i "s/$comment_char Copyright .*$institution/$comment_char Copyright $year_in_file1-$current_year $institution/" $fn 236 236 237 fi 237 238 fi 238 239 239 240 done <"$fn" 240 241 241 242 printf "\r%$(tput cols)s" " " 242 243 printf "\r\e[1m *** Searched files: $count_files. Comments found: $count_changes. Copyright updates found: $count_updates\e[0m" 243 244 244 245 # 245 246 #-- move comments from current revisions to former revisions … … 252 253 #-- remove leading \n characters in string 253 254 comments=${comments:2} 254 255 256 255 257 256 # 258 257 #-- fix old time stamp … … 267 266 (( line_stop = line_stop + 2 )) 268 267 sed -i "${line_stop}i$comments" $fn 269 268 270 269 271 270 … … 279 278 fi 280 279 281 #282 #-- move comments from current revisions to former revisions283 if [[ "$found_update_year" == true ]]284 then285 286 (( count_updates = count_updates + 1 ))287 288 sed -i "s/$comment_char Copyright 1997-.*Leibniz Universitaet Hannover/$comment_char Copyright 1997-$current_year Leibniz Universitaet Hannover/" $fn289 290 fi291 292 280 done 293 281
Note: See TracChangeset
for help on using the changeset viewer.