MozillaFirefox/create-tar.sh
changeset 1056 90e1f32cf034
parent 1053 893fc4d031d6
child 1060 5ce9d1f6be41
equal deleted inserted replaced
1055:526f445635f3 1056:90e1f32cf034
     6 # http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/l10n_changesets.txt
     6 # http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/l10n_changesets.txt
     7 
     7 
     8 CHANNEL="beta"
     8 CHANNEL="beta"
     9 BRANCH="releases/mozilla-$CHANNEL"
     9 BRANCH="releases/mozilla-$CHANNEL"
    10 RELEASE_TAG="FIREFOX_61_0b12_RELEASE"
    10 RELEASE_TAG="FIREFOX_61_0b12_RELEASE"
    11 VERSION="60.99"
    11 VERSION="61.0"
       
    12 VERSION_SUFFIX="b12"
       
    13 LOCALE_FILE="firefox-$VERSION/browser/locales/l10n-changesets.json"
    12 
    14 
    13 # check required tools
    15 # check required tools
    14 test -x /usr/bin/hg || ( echo "hg missing: execute zypper in mercurial"; exit 5 )
    16 test -x /usr/bin/hg || ( echo "hg missing: execute zypper in mercurial"; exit 5 )
    15 test -x /usr/bin/jq || ( echo "jq missing: execute zypper in jq"; exit 5 )
    17 test -x /usr/bin/jq || ( echo "jq missing: execute zypper in jq"; exit 5 )
    16 
       
    17 
       
    18 # mozilla
       
    19 if [ -d mozilla ]; then
       
    20   pushd mozilla
       
    21   _repourl=$(hg paths)
       
    22   case "$_repourl" in
       
    23     *$BRANCH*)
       
    24       echo "updating previous tree"
       
    25       hg pull
       
    26       popd
       
    27       ;;
       
    28     * )
       
    29       echo "removing obsolete tree"
       
    30       popd
       
    31       rm -rf mozilla
       
    32       ;;
       
    33   esac
       
    34 fi
       
    35 if [ ! -d mozilla ]; then
       
    36   echo "cloning new $BRANCH..."
       
    37   hg clone http://hg.mozilla.org/$BRANCH mozilla
       
    38 fi
       
    39 pushd mozilla
       
    40 hg update --check
       
    41 [ "$RELEASE_TAG" == "default" ] || hg update -r $RELEASE_TAG
       
    42 # get repo and source stamp
       
    43 echo -n "REV=" > ../source-stamp.txt
       
    44 hg -R . parent --template="{node|short}\n" >> ../source-stamp.txt
       
    45 echo -n "REPO=" >> ../source-stamp.txt
       
    46 hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" >> ../source-stamp.txt
       
    47 popd
       
    48 
    18 
    49 # use parallel compression, if available
    19 # use parallel compression, if available
    50 compression='-J'
    20 compression='-J'
    51 pixz -h > /dev/null 2>&1
    21 pixz -h > /dev/null 2>&1
    52 if (($? != 127)); then
    22 if (($? != 127)); then
    53   compression='-Ipixz'
    23   compression='-Ipixz'
    54 fi
    24 fi
    55 
    25 
    56 echo "creating archive..."
    26 # we might have an upstream archive already and can skip the checkout
    57 tar $compression -cf firefox-$VERSION.source.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg --exclude=CVS mozilla
    27 if [ -e firefox-$VERSION$VERSION_SUFFIX.source.tar.xz ]; then
       
    28   echo "skip firefox checkout and use available archive"
       
    29   # still need to extract the locale information from the archive
       
    30   echo "extract locale changesets"
       
    31   tar -xf firefox-$VERSION$VERSION_SUFFIX.source.tar.xz $LOCALE_FILE
       
    32 else
       
    33   # mozilla
       
    34   if [ -d firefox-$VERSION ]; then
       
    35     pushd firefox-$VERSION
       
    36     _repourl=$(hg paths)
       
    37     case "$_repourl" in
       
    38       *$BRANCH*)
       
    39         echo "updating previous tree"
       
    40         hg pull
       
    41         popd
       
    42         ;;
       
    43       * )
       
    44         echo "removing obsolete tree"
       
    45         popd
       
    46         rm -rf firefox-$VERSION
       
    47         ;;
       
    48     esac
       
    49   fi
       
    50   if [ ! -d firefox-$VERSION ]; then
       
    51     echo "cloning new $BRANCH..."
       
    52     hg clone http://hg.mozilla.org/$BRANCH firefox-$VERSION
       
    53   fi
       
    54   pushd firefox-$VERSION
       
    55   hg update --check
       
    56   [ "$RELEASE_TAG" == "default" ] || hg update -r $RELEASE_TAG
       
    57   # get repo and source stamp
       
    58   echo -n "REV=" > ../source-stamp.txt
       
    59   hg -R . parent --template="{node|short}\n" >> ../source-stamp.txt
       
    60   echo -n "REPO=" >> ../source-stamp.txt
       
    61   hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" >> ../source-stamp.txt
       
    62   popd
       
    63 
       
    64   echo "creating archive..."
       
    65   tar $compression -cf firefox-$VERSION$VERSION_SUFFIX.source.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg --exclude=CVS firefox-$VERSION
       
    66 fi
    58 
    67 
    59 # l10n
    68 # l10n
    60 echo "fetching locales..."
    69 echo "fetching locales..."
    61 test ! -d l10n && mkdir l10n
    70 test ! -d l10n && mkdir l10n
    62 jq -r 'to_entries[]| "\(.key) \(.value|.revision)"' mozilla/browser/locales/l10n-changesets.json | \
    71 jq -r 'to_entries[]| "\(.key) \(.value|.revision)"' $LOCALE_FILE | \
    63   while read locale changeset ; do
    72   while read locale changeset ; do
    64     case $locale in
    73     case $locale in
    65       ja-JP-mac|en-US)
    74       ja-JP-mac|en-US)
    66         ;;
    75         ;;
    67       *)
    76       *)
    71         [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $changeset
    80         [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $changeset
    72         ;;
    81         ;;
    73     esac
    82     esac
    74   done
    83   done
    75 echo "creating l10n archive..."
    84 echo "creating l10n archive..."
    76 tar $compression -cf l10n-$VERSION.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg l10n
    85 tar $compression -cf l10n-$VERSION$VERSION_SUFFIX.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg l10n
    77 
    86 
    78 # compare-locales
    87 # compare-locales
    79 echo "creating compare-locales"
    88 echo "creating compare-locales"
    80 hg clone http://hg.mozilla.org/build/compare-locales
    89 hg clone http://hg.mozilla.org/build/compare-locales
    81 tar $compression -cf compare-locales.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg compare-locales
    90 tar $compression -cf compare-locales.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg compare-locales