Making WordPress.org

Changeset 1217


Ignore:
Timestamp:
02/04/2015 06:28:18 AM (10 years ago)
Author:
dd32
Message:

Github Feature Plugins Sync: Attempt to work around UTF8 issues in commit messages.
Some commit messages include utf8 characters (Curly quotes, hello!) and the default character set the script runs in may not support UTF-8, this attempts to set the Locale to a UTF-8 aware locale for the duration of the script if available.
Unfortunately these UTF-8 characters may not show up correctly in the SVN logs, but the sync should suceed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/github-sync/feature-plugins.sh

    r1207 r1217  
    44SVN_PLUGIN=$2;
    55
     6# Expect ENV vars: $PHP_SVN_USER, $PHP_SVN_PASSWORD
     7
    68# Split by newlines only in bash arrays
    79IFS=$'\r\n'
    810
    9 # ENV vars: $PHP_SVN_USER, $PHP_SVN_PASSWORD
     11# Ensure that we're running with a UTF8 character set for commits with UTF8 characters
     12locale | grep LC_CTYPE | grep -qie 'utf-\?8';
     13if [ $? -eq 1 ]; then
     14        export LC_ALL=$( locale -a | grep -ie 'utf-\?8' | head -1 );
     15fi;
    1016
     17# Validate all Parameters are present
    1118if [ ! $GITHUB_URL ] || [ ! $SVN_PLUGIN ] || [ ! $PHP_SVN_USER ] || [ ! $PHP_SVN_PASSWORD ]; then
    1219    echo "Invalid Input, missing parameter"; exit 1
Note: See TracChangeset for help on using the changeset viewer.