File:  [mozdev] / forward / src / make-amo.sh
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Fri Nov 23 12:32:52 2012 UTC (7 years, 3 months ago) by oeekker
Branches: MAIN
CVS tags: HEAD
Change cd command for paths with spaces in it

#!/bin/bash
# amo
cd $(dirname $(cygpath -u $(cygpath -m -s "${0}")))/..
[ -d package ] || mkdir package
cd package
rm -fr amo/
rsync -a --exclude-from=../src/make-exclude.txt ../src/* amo/
cd amo/chrome/locale
for locale in *
do
  for file in ${locale}/*.properties
  do
    grep -q '=$' ${file}      # Check if file has untranslated strings
    if [ $? -eq 0 ]
    then
      while read line
      do
        if expr index "${line}" '=' > /dev/null
        then
          untranslatedstring="#${line%%=*}=$"
          untranslatedstring="${untranslatedstring/\#\#/\#}"
          sed -r "s/${untranslatedstring//\//\\/}/${line//\//\\/}/" ${file} > ${file}.new
          mv ${file}.new ${file}
        fi
      done < en-US/$(basename ${file})
    fi
  done
done
cd ..
zip -r -D -0 forward.jar content/ locale/ skin/
cd ../..
grep em:update -A 2 ../src/install.rdf > make-grep.txt
grep -v -f make-grep.txt ../src/install.rdf | grep -v em:unpack > amo/install.rdf
rm make-grep.txt
sed -r "s/chrome\//jar:chrome\/forward.jar!\//" ../src/chrome.manifest > amo/chrome.manifest
version=$(grep em:version ../src/install.rdf | sed -r "s/^[^\"]*\"//" | sed -r "s/\"[^\"]*$//")
cd amo
rm forward-${version}-tb.xpi 2> /dev/null
zip -r -D forward-${version}-tb.xpi install.rdf chrome.manifest chrome/forward.jar defaults/
cd ..
read -p "Press any key to continue . . . " -n 1

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>