testing/release/l10n/verify_l10n.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/release/l10n/verify_l10n.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +#!/bin/bash
     1.5 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 +
     1.9 +
    1.10 +. ../common/unpack.sh
    1.11 +
    1.12 +release=$1
    1.13 +
    1.14 +if [ -z "$release" ]
    1.15 +then
    1.16 +  echo "Syntax: $0 <release_dir>"
    1.17 +  exit 1
    1.18 +fi
    1.19 +
    1.20 +for platform in linux-i686 win32 mac
    1.21 +do
    1.22 +  rm -rf source/*
    1.23 +  # unpack_build platform dir_name pkg_file
    1.24 +  unpack_build $platform source $release/*.en-US.${platform}.* en-US
    1.25 +  # check for read-only files
    1.26 +  find "./source" -not -perm -u=w -exec echo "FAIL read-only file" {} \;
    1.27 +
    1.28 +  for package in `find $release -maxdepth 1 -iname "*.$platform.*" | \
    1.29 +                  grep -v 'en-US'`
    1.30 +  do
    1.31 +    # strip the directory portion
    1.32 +    package=`basename $package`
    1.33 +    # this cannot be named $locale, because unpack_build will overwrite it
    1.34 +    l=`echo $package | sed -e "s/\.${platform}.*//" -e 's/.*\.//'`
    1.35 +    rm -rf target/*
    1.36 +    unpack_build $platform target $release/$package $l
    1.37 +    # check for read-only files
    1.38 +    find "./target" -not -perm -u=w -exec echo "FAIL read-only file" {} \;
    1.39 +    mkdir -p $release/diffs
    1.40 +    diff -r source target > $release/diffs/$platform.$l.diff
    1.41 +  done
    1.42 +done
    1.43 +
    1.44 +exit 0

mercurial