Changeset 2814


Ignore:
Timestamp:
Jul 24, 2013, 2:55:06 PM (4 years ago)
Author:
sam
Message:

build: automatically add svn:eol-style = RF property to source files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build/check-source.sh

    r2739 r2814  
    8585total_spaces=0
    8686total_tabs=0
     87total_props=0
    8788
    8889OIFS="$IFS"
     
    106107    should_check_crlf=false
    107108    should_check_spaces=false
     109    should_check_props=false
    108110
    109111    case "$file" in
     
    112114          should_check_crlf=true
    113115          should_check_spaces=true
     116          should_check_props=true
    114117          ;;
    115118      *)
     
    156159    fi
    157160
     161    # Check for CR LF SVN prop
     162    if [ "$repo" = svn -a "$should_check_props" = true ]; then
     163        if [ "$(svn propget svn:eol-style "$file")" != "CR" ]; then
     164            clean=false
     165            if [ "$fix" = true ]; then
     166                svn propset svn:eol-style CR "$file"
     167                info "$file is missing svn:eol-style property"
     168            else
     169                error "$file is missing svn:eol-style property"
     170            fi
     171            total_props="$(($total_props + 1))"
     172        fi
     173    fi
     174
    158175    # Check for trailing spaces
    159176    if [ "$should_check_spaces" = true ]; then
     
    200217 - removed $total_spaces trailing whitespaces
    201218 - replaced $total_tabs tabs with spaces
     219 - fixed $total_props svn:eol-style properties
    202220EOF
    203221    elif [ "$fix" = "true" ]; then
     
    213231            info " - fixed $total_tabs tabs"
    214232        fi
     233        if [ "$total_props" -gt 0 ]; then
     234            info " - fixed $total_props svn:eol-style properties"
     235        fi
    215236        info "re-run with -c to commit fixes"
    216237    else
Note: See TracChangeset for help on using the changeset viewer.