Changeset 29830 for other-projects

Show
Ignore:
Timestamp:
02.04.2015 19:35:51 (4 years ago)
Author:
ak19
Message:

Added processing for any new files (?) found on gti in the language modules area, since I kept overlooking these when committing language files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • other-projects/gti/translation_status.sh

    r29414 r29830  
    1 #! /bin/bash 
     1#!/bin/bash 
    22 
    33# This script makes a report of any language files that have been modified via the online GTI,  
     
    2828 
    2929num_modified=0 
     30num_added=0 
    3031 
    3132# in the lines returned from the diff, test for archives or newline 
     
    3839    if [[ "$status" == *"M "* ]]; then 
    3940    #echo "$file has been modified: $status" 
    40     echo $file >> $report 
     41    echo $status >> $report #echo $file >> $report 
    4142    ((num_modified++)) 
    4243    fi 
    4344done 
    4445 
    45 # restore IFS 
    46 IFS=$IFS_BAK 
    47 IFS_BAK= 
    4846 
    4947if [[ $num_modified == 0 ]]; then 
     
    5654echo "---------------------------------------------" >> $report 
    5755 
     56# repeat, this time looking for any newly added files 
     57for file in ${filelisting[@]}; do 
     58    status=`svn status $file` 
     59    if [[ "$status" == *"? "* ]]; then 
     60    #echo "$file has been added: $status" 
     61    echo $status >> $report 
     62    ((num_added++)) 
     63    fi 
     64done 
     65 
     66if [[ $num_added == 0 ]]; then 
     67    echo "No files added" >> $report 
     68else 
     69    echo "" >> $report 
     70    echo "The above $num_added files were added." >> $report 
     71fi 
     72 
     73echo "---------------------------------------------" >> $report 
     74 
     75# restore IFS 
     76IFS=$IFS_BAK 
     77IFS_BAK= 
     78 
     79 
     80 
    5881# if no files are modified, we don't send email, otherwise we do 
    59 if [[ $num_modified != 0 ]]; then 
    60 #  echo "Files were modified. Sending email..."   
    61     cat $report | mail -s 'GTI: '$num_modified' language file(s) on nzdl have been updated' $GREENSTONE_EMAIL 
     82if [[ $num_modified != 0 || $num_added != 0 ]]; then 
     83#  echo "Files were modified or added. Sending email..."   
     84    cat $report | mail -s 'GTI: '$num_modified/$num_added' language file(s) on nzdl have been updated/added' $GREENSTONE_EMAIL 
    6285    echo "Sent mail of report: $report" 
    6386else