From: Jan Schmidt Date: Sat, 12 Jan 2008 22:13:03 +0000 (+0000) Subject: download-translations: Remove bash-isms X-Git-Tag: RELEASE-0_10_0_3~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36e8d05157d6c831e0d3919ae2ee9c342498eda8;p=platform%2Fupstream%2Fgst-common.git download-translations: Remove bash-isms Original commit message from CVS: * download-translations: Remove bash-isms --- diff --git a/ChangeLog b/ChangeLog index 207bb0c..377f841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-01-12 Jan Schmidt + * download-translations: + Remove bash-isms + +2008-01-12 Jan Schmidt + * check-exports: Restore the cleanup rm of our tmp file which I didn't mean to leave commented out. diff --git a/download-translations b/download-translations index 7272378..b1081d6 100755 --- a/download-translations +++ b/download-translations @@ -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