Chameleon

Chameleon Commit Details

Date:2012-02-28 12:28:33 (8 years 2 months ago)
Author:blackosx
Commit:1839
Parents: 1838
Message:update header of perl script with url of readonly google spreadsheet. Add 'fix me' note in to buildpkg.sh buildresources() that the textutil conversion process yields different unicode markup in Snow Leopard as it does in Lion - as a result running on SL will give incorrect results.
Changes:
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Resources.source/ConvertResourcesTextFile.pl

File differences

branches/blackosx/package/Resources.source/ConvertResourcesTextFile.pl
11
22
3
4
5
6
3
4
5
76
8
9
7
8
9
1010
11
12
13
14
11
12
13
1514
16
17
18
1915
2016
2117
18
19
20
21
2222
2323
2424
#!/usr/bin/perl
# This script converts a human readable file for all the
# language 'Resources' for the Chameleon package installer
# in to a simple format ready for merging with pre-defined
# templates during compilation.
# This script converts a human readable file for all the language 'Resources'
# for the Chameleon package installer in to a simple format ready for merging
# with pre-defined templates during compilation.
#
# The human readable file is hosted on Google Docs at:
# www.......
# The human readable file is a hosted on Google Docs Spreadsheet.
# To view the readonly spreadsheet, go here:
# https://docs.google.com/spreadsheet/ccc?key=0Aj0jJ2rdmK_sdFdNbm45NlpNYU1PcjRmOHVXX0FNa3c
#
# The spreadsheet is a published file and will be
# automatically downloaded as a UTF-8, tabbed delimited
# text file which will be saved in the folder indicated
# by the two arguments passed when calling this.
# The spreadsheet is a published file and will be automatically downloaded by this
# script as a UTF-8, tabbed delimited text file which will be saved in the folder
# indicated by the two arguments passed.
#
# Call this script with:
# ./ConvertResourcesTextFile.pl path filename
#
# buildpkg.sh calls this with the following defaults:
# path: ${PKG_BUILD_DIR}
# filename: ResourcesSourceFile.txt
#
# This script can be called manually by using:
# ./ConvertResourcesTextFile.pl path filename
#
use LWP::Simple;
branches/blackosx/package/buildpkg.sh
10381038
10391039
10401040
1041
10411042
1043
1044
1045
1046
1047
10421048
1049
10431050
10441051
10451052
1046
1047
1053
10481054
10491055
10501056
# Build an array for each the Welcome, Conclusion and Description Resource files per language.
if [[ "$foundCode" != "" ]] && [[ "$foundDescription" != "" ]]; then
if [[ "$resourceToUse" == "Welcome" ]] || [[ "$resourceToUse" == "Conclusion" ]]; then
# Convert description from UFT8 to raw unicode markup
# ************************************************************
# FIX ME:
# This ony works on Lion.
# The command on Snow Leopard yields different results??
# ************************************************************
convertedFoundDescription=$( echo $foundDescription | textutil -convert rtf -encoding UTF-8 -stdin -stdout )
# Strip away unicode text up to and including '\f0\fs24 \cf0' - take what's after.
strippedConvertedFoundDescription="${convertedFoundDescription#*\\f0\\fs24 \\cf0 }"
# Remove last three characters from string and replace all backslashes with a double backslash.
fixStrippedConvertedFoundDescription=$( echo "${strippedConvertedFoundDescription%???}" | sed -e 's/\\/\\\\/g' )
#echo "$fixStrippedConvertedFoundDescription"
fixStrippedConvertedFoundDescription=$( echo "${strippedConvertedFoundDescription%???}" | sed -e 's/\\/\\\\/g' )
buildCodes[${#buildCodes[*]}]="$foundCode=$fixStrippedConvertedFoundDescription"
fi
if [[ "$resourceToUse" == "Description" ]]; then

Archive Download the corresponding diff file

Revision: 1839