[or-cvs] r20398: {torbrowser} This should modify nothing for the Cygwin builds but it shou (torbrowser/trunk/build-scripts)
ioerror at seul.org
ioerror at seul.org
Thu Aug 27 19:03:48 UTC 2009
Author: ioerror
Date: 2009-08-27 15:03:47 -0400 (Thu, 27 Aug 2009)
New Revision: 20398
Modified:
torbrowser/trunk/build-scripts/patch-firefox-language.sh
torbrowser/trunk/build-scripts/patch-vidalia-language.sh
Log:
This should modify nothing for the Cygwin builds but it should allow a caller who knows better to tell sed that it wants to do something other than edit files with "-c"
Now you can call like so:
patch-firefox-language.sh path/to/file langcode -n
patch-vidalia-language.sh path/to/file langcode -n
The above means that sed will replace the default '-c' argument with '-n'; this is just what we want on linux where we have no '-c' argument and '-n' is a nice safe, quiet option.
Modified: torbrowser/trunk/build-scripts/patch-firefox-language.sh
===================================================================
--- torbrowser/trunk/build-scripts/patch-firefox-language.sh 2009-08-27 18:40:17 UTC (rev 20397)
+++ torbrowser/trunk/build-scripts/patch-firefox-language.sh 2009-08-27 19:03:47 UTC (rev 20398)
@@ -12,13 +12,22 @@
## Parse command line
FILENAME=$1
LANGCODE=$2
+SEDARG=$3
+# For linux, we tell this to be silent by passing "-n"
+# On other platforms, we pass "-c" when they do nothing
+if [ -z $SEDARG ];
+then
+ SEDARG="-c";
+fi
+
## Backup original file
ORIGFILENAME=$FILENAME.orig
mv "$FILENAME" "$ORIGFILENAME"
## Replace LanguageCode value with $LANGCODE
-sed -c "s/BUNDLELOCALE/$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
+#sed -c "s/BUNDLELOCALE/$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
+sed $SEDARG "s/BUNDLELOCALE/$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
## Remove backup
-rm -f "$ORIGFILENAME"
\ No newline at end of file
+rm -f "$ORIGFILENAME"
Modified: torbrowser/trunk/build-scripts/patch-vidalia-language.sh
===================================================================
--- torbrowser/trunk/build-scripts/patch-vidalia-language.sh 2009-08-27 18:40:17 UTC (rev 20397)
+++ torbrowser/trunk/build-scripts/patch-vidalia-language.sh 2009-08-27 19:03:47 UTC (rev 20398)
@@ -12,7 +12,15 @@
## Parse command line
FILENAME=$1
MOZLANG=$2
+SEDARG=$3
+# For linux, we tell this to be silent by passing "-n"
+# On other platforms, we pass "-c" when they do nothing
+if [ -z $SEDARG ];
+then
+ SEDARG="-c";
+fi
+
## Handle exceptions where Mozilla language definition doesn't equal Vidalia's
case "$MOZLANG" in
'en-US') LANGCODE='en'
@@ -34,7 +42,8 @@
mv "$FILENAME" "$ORIGFILENAME"
## Replace LanguageCode value with $LANGCODE
-sed -c "s/\\(LanguageCode=\\).*/\\1$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
+#sed -c "s/\\(LanguageCode=\\).*/\\1$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
+sed $SEDARG "s/\\(LanguageCode=\\).*/\\1$LANGCODE/" "$ORIGFILENAME" > "$FILENAME"
## Remove backup
rm -f "$ORIGFILENAME"
More information about the tor-commits
mailing list