download-translations: Remove bash-isms
authorJan Schmidt <thaytan@mad.scientist.com>
Sat, 12 Jan 2008 22:13:03 +0000 (22:13 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Sat, 12 Jan 2008 22:13:03 +0000 (22:13 +0000)
Original commit message from CVS:
* download-translations:
Remove bash-isms

ChangeLog
download-translations

index 207bb0c..377f841 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-01-12  Jan Schmidt  <Jan.Schmidt@sun.com>
 
+       * download-translations:
+       Remove bash-isms
+
+2008-01-12  Jan Schmidt  <Jan.Schmidt@sun.com>
+
        * check-exports:
        Restore the cleanup rm of our tmp file which I didn't mean to leave 
        commented out.
index 7272378..b1081d6 100755 (executable)
@@ -16,13 +16,15 @@ DOMAINS=\
 #DOMAINS="es fr hu sv pl xx"
 
 # check for 'diff' program
-if ! diff --version 2>/dev/null >/dev/null; then
+diff --version 2>/dev/null >/dev/null
+if [ ! $? ]; then
   echo "==== You must have the 'diff' program installed for this script ===="
   exit 1
 fi
 
 # check for 'wget' program
-if ! wget --version 2>/dev/null >/dev/null; then
+wget --version 2>/dev/null >/dev/null
+if [ ! $? ]; then
   echo "==== You must have the 'wget' program installed for this script ===="
   exit 1
 fi
@@ -61,10 +63,7 @@ do
   PACKAGE_PO_URL_BASE="http://translationproject.org/latest/$PACKAGE"
   PO_URL="$PACKAGE_PO_URL_BASE/$d.po"
   PO_FILENAME="$PACKAGE.$d.po"
-  if ! wget -q -nc -O $PO_FILENAME $PO_URL 2>/dev/null >/dev/null; then
-    rm -f $PO_FILENAME
-    echo "$d.po: failure (does probably not exist)"
-  else
+  if wget -q -nc -O $PO_FILENAME $PO_URL; then
     if [ -f "po/$d.po" ]; then
       # ./po/foo.po exists, so let's check if ours matches the latest from the
       # translation project website 
@@ -77,13 +76,16 @@ do
         DOMAINS_UPDATED="$DOMAINS_UPDATED $d"
       fi
     else
-      # ./po/foo.po does exists, but foo.po exists on the translation project
+      # ./po/foo.po doesn't exist, but foo.po exists on the translation project
       # website, so it's probably a new translation
       echo "$d.po: new language"
-      mv $PO_FILENAME "po/$d.po"
+      mv $PO_FILENAME "po/$d.po"
       DOMAINS_UPDATED="$DOMAINS_UPDATED $d"
       DOMAINS_TO_ADD="$DOMAINS_TO_ADD $d"
     fi
+  else
+    rm -f $PO_FILENAME
+    echo "$d.po: failure (does probably not exist)"
   fi
 done