Merge remote-tracking branch 'origin/release-v4.5'
[WRF.git] / tools / any_updates_in_registry.csh
blob9dc5da349ce8367c0784bc215fc38e9cb94717d5
1 #!/bin/csh
3 unalias rm cp
5 # Easy way to get this hash is to do a "git log README" in the top WRFV3 directory
7 set LAST_RELEASE_HASH = a98c4ada98934ef0
9 if ( -e newbies ) then
10 rm -rf newbies
11 endif
12 touch newbies
14 pushd ../Registry >& /dev/null
15 set Registry_files = `ls -1 Registry* registry*`
16 popd >& /dev/null
18 foreach f ( $Registry_files )
19 if ( ( $f == Registry.CONVERT ) || \
20 ( $f == Registry.EM_COMMON.var ) || \
21 ( $f == Registry.NMM ) || \
22 ( $f == registry.chem ) || \
23 ( $f == registry.tracker ) || \
24 ( $f == registry.var ) || \
25 ( $f == registry.var_chem ) || \
26 ( $f == Registry ) ) then
27 else
29 # Check existend of file within last release
31 git diff ${LAST_RELEASE_HASH}:Registry/$f -- ../Registry/$f >& /dev/null
32 set OK = $status
33 if ( $OK == 0 ) then
35 # Yep, it existed, process the diffs
37 git diff ${LAST_RELEASE_HASH}:Registry/$f -- ../Registry/$f >& ad.${f}.txt
39 # Check if this is an empty file
41 ls -ls ad.${f}.txt | grep " 0 " >& /dev/null
42 set ZERO_SIZED = $status
43 if ( $ZERO_SIZED == 0 ) then
45 # Empty file, remove it from consideration
47 rm -rf ad.${f}.txt
48 else
50 # Check for new rconfig entries
52 grep "^+" ad.${f}.txt | grep -i rconfig >& /dev/null
53 set NEW_STUFF = $status
54 if ( $NEW_STUFF == 0 ) then
56 # Yep, found some rconfigs with a leading plus, international sign of adding something or other
58 echo " "
59 echo processing $f
61 # Check to see if this new rconfig is talked about in the README.namelist
63 foreach g ( `grep "^+" ad.${f}.txt | grep -i rconfig | awk '{print $3}' ` )
65 grep -iq $g ../run/README.namelist
66 set ALREADY_DESCRIBED = $status
68 if ( $ALREADY_DESCRIBED != 0 ) then
69 echo $g is not described in README.namelist
70 endif
71 end
74 endif
76 endif
78 else
80 # Nope, did not previously exist. New file needs to handled separately
82 echo $f >> newbies
83 endif
84 endif
85 end