Changeset 28046 for other-projects/nightly-tasks/diffcol/trunk
- Timestamp:
- 2013-08-14T21:30:02+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/gen-model-colls.sh
r28037 r28046 77 77 return; 78 78 fi 79 80 # return here if just deleting empty dirs 81 #return 79 82 80 83 # diff the svn model and rebuilt model collections … … 117 120 118 121 # Now svn remove what's unique to model-collect and svn add what's been rebuilt in index and archives 119 # see # http://stackoverflow.com/questions/7502261/delete-folder-content-and-remove-from-version-control 120 122 # see http://stackoverflow.com/questions/7502261/delete-folder-content-and-remove-from-version-control 123 # And doing: rm -rfv mydir/* should leave .hidden folders in mydir, see 124 # http://askubuntu.com/questions/72446/how-to-remove-all-files-and-subdirectories-in-a-directory-without-deleting-the-d 121 125 if [ "$mode" == "svndelete" ]; then 122 126 svn rm model-collect/$collection/archives/* 123 127 svn rm model-collect/$collection/index/* 124 fi 128 # rm -rfv model-collect/$collection/archives/* 129 # rm -rfv model-collect/$collection/index/* 130 # from testing, the above will remove all the contents of archives and index 131 # except the .svn folder of toplevel archives/index 132 fi 133 134 # http://stackoverflow.com/questions/5044214/how-do-i-detect-and-or-delete-empty-subversion-directories 135 # http://stackoverflow.com/questions/1301203/removing-svn-files-from-all-directories 125 136 126 137 # copy across the contents of the rebuilt model-collection's index and archives to the svn model-collect … … 139 150 140 151 # if etc/collect.cfg is different, copy it across too? 141 142 143 152 } 153 144 154 145 155 # re-build a single collection in "collect" which is a copy of model-collect … … 152 162 #get just the basename 153 163 collection=`basename $collection` 164 165 # clean up empty directories: 166 # HASH dirs that are empty in local (non-svn) collect's archives and index/assoc, 167 # need to be removed from the svn in model-collect. 168 # They're almost empty in the mode-collect, except for the .svn folder they contain 169 170 for coldir in `find collect/$collection/archives/HASH* -type d -empty`; do 171 modeldir="model-$coldir" 172 echo "Removing empty dir from svn: $modeldir" 173 174 # remove from svn of model collect 175 svn rm $modeldir 176 rm -rf $modeldir 177 # remove physically from local collect (not necessary, as a rebuild will sort this out too) 178 rm -rf $coldir 179 done 180 181 for coldir in `find collect/$collection/index/assoc/HASH* -type d -empty`; do 182 modeldir="model-$coldir" 183 echo "Removing empty dir from svn: $modeldir" 184 185 # remove from svn of model collect 186 svn rm $modeldir 187 rm -rf $modeldir 188 # remove physically from local collect (not necessary, as a rebuild will sort this out too) 189 rm -rf $coldir 190 done 154 191 155 192 import.pl -removeold $collection … … 304 341 305 342 343 # Now delete all empty dirs in the copy of model-collect (since the dirs will not have .svn folders in them anymore) 344 # http://www.commandlinefu.com/commands/view/5131/recursively-remove-all-empty-directories 345 #find collect -type d -empty -delete 346 306 347 # Set up the Greenstone environment for building 307 348 source setup.bash … … 317 358 single_collection $collection; 318 359 if [ "x$mode" != "x" ]; then 360 # Now delete all empty dirs in the copy of model-collect (since the dirs will not have .svn folders in them anymore) 361 # http://www.commandlinefu.com/commands/view/5131/recursively-remove-all-empty-directories 362 # find collect/$collection/archives/HASH* -type d -empty -delete 363 # find collect/$collection/index/assoc/HASH* -type d -empty -delete 319 364 update_single_collection $collection $mode; 320 365 fi … … 329 374 single_collection $collection; 330 375 if [ "x$mode" != "x" ]; then 376 # find collect/$collection/archives/HASH* -type d -empty -delete 377 # find collect/$collection/index/assoc/HASH* -type d -empty -delete 331 378 update_single_collection $collection $mode; 332 379 fi … … 358 405 359 406 407 # The following in a separate script file will delete all folders from model-collect that are 408 # empty in the copied collection (all folders which contain only a .svn subfolder in model-collect) 409 410 #for collection in collect/*; do 411 #escape the filename (in case of space) 412 # collection=`echo $collection | sed 's@ @\\\ @g'` 413 414 #get just the basename 415 # collection=`basename $collection` 416 417 # HASH dirs that are empty in local collect's archives and index/assoc, 418 # need to be removed from the svn in model-collect 419 420 # for line in `find collect/$collection/archives/HASH* -type d -empty`; do 421 # modelline="model-$line" 422 # echo "LINE: $modelline" 423 424 # remove from svn of model collect 425 # svn rm $modelline 426 ## rm -rf $modelline 427 # remove physically from local collect 428 # rm -rf $line 429 # done 430 431 # for line in `find collect/$collection/index/assoc/HASH* -type d -empty`; do 432 # modelline="model-$line" 433 # echo "LINE: $modelline" 434 435 # remove from svn of model collect 436 # svn rm $modelline 437 ## rm -rf $modelline 438 # remove physically from local collect 439 # rm -rf $line 440 # done 441 442 #done
Note:
See TracChangeset
for help on using the changeset viewer.