MozillaFirefox/create-tar.sh
author Wolfgang Rosenauer <wr@rosenauer.org>
Sun, 21 Oct 2018 09:20:26 +0200
branchfirefox62
changeset 1072 84c1339de259
parent 1071 8dc7d19e8298
child 1073 63a32fb3b602
permissions -rwxr-xr-x
62.0.3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
#!/bin/bash
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 906
diff changeset
     3
# TODO
923
3cc9f17ca9bb prepare FF48
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 921
diff changeset
     4
# http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/linux-x86_64/en-US/firefox-48.0.json
3cc9f17ca9bb prepare FF48
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 921
diff changeset
     5
# "moz_source_stamp": "c1de04f39fa956cfce83f6065b0e709369215ed5"
3cc9f17ca9bb prepare FF48
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 921
diff changeset
     6
# http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/l10n_changesets.txt
909
c6717354928b Firefox 46.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 906
diff changeset
     7
1071
8dc7d19e8298 firefox 62.0.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1070
diff changeset
     8
CHANNEL="release"
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 337
diff changeset
     9
BRANCH="releases/mozilla-$CHANNEL"
1072
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1071
diff changeset
    10
RELEASE_TAG="c9ed11ae5c79df3dcb69075e1c9da0317d1ecb1b"
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1071
diff changeset
    11
VERSION="62.0.3"
1071
8dc7d19e8298 firefox 62.0.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1070
diff changeset
    12
VERSION_SUFFIX=""
1056
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    13
LOCALE_FILE="firefox-$VERSION/browser/locales/l10n-changesets.json"
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    15
# check required tools
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    16
test -x /usr/bin/hg || ( echo "hg missing: execute zypper in mercurial"; exit 5 )
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    17
test -x /usr/bin/jq || ( echo "jq missing: execute zypper in jq"; exit 5 )
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    18
990
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    19
# use parallel compression, if available
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    20
compression='-J'
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    21
pixz -h > /dev/null 2>&1
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    22
if (($? != 127)); then
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    23
  compression='-Ipixz'
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    24
fi
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    25
1056
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    26
# we might have an upstream archive already and can skip the checkout
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    27
if [ -e firefox-$VERSION$VERSION_SUFFIX.source.tar.xz ]; then
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    28
  echo "skip firefox checkout and use available archive"
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    29
  # still need to extract the locale information from the archive
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    30
  echo "extract locale changesets"
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    31
  tar -xf firefox-$VERSION$VERSION_SUFFIX.source.tar.xz $LOCALE_FILE
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    32
else
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    33
  # mozilla
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    34
  if [ -d firefox-$VERSION ]; then
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    35
    pushd firefox-$VERSION
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    36
    _repourl=$(hg paths)
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    37
    case "$_repourl" in
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    38
      *$BRANCH*)
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    39
        echo "updating previous tree"
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    40
        hg pull
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    41
        popd
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    42
        ;;
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    43
      * )
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    44
        echo "removing obsolete tree"
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    45
        popd
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    46
        rm -rf firefox-$VERSION
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    47
        ;;
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    48
    esac
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    49
  fi
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    50
  if [ ! -d firefox-$VERSION ]; then
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    51
    echo "cloning new $BRANCH..."
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    52
    hg clone http://hg.mozilla.org/$BRANCH firefox-$VERSION
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    53
  fi
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    54
  pushd firefox-$VERSION
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    55
  hg update --check
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    56
  [ "$RELEASE_TAG" == "default" ] || hg update -r $RELEASE_TAG
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    57
  # get repo and source stamp
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    58
  echo -n "REV=" > ../source-stamp.txt
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    59
  hg -R . parent --template="{node|short}\n" >> ../source-stamp.txt
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    60
  echo -n "REPO=" >> ../source-stamp.txt
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    61
  hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" >> ../source-stamp.txt
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    62
  popd
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    63
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    64
  echo "creating archive..."
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    65
  tar $compression -cf firefox-$VERSION$VERSION_SUFFIX.source.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg --exclude=CVS firefox-$VERSION
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    66
fi
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    67
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    68
# l10n
409
ff30593d2daa switch to 12.0dev
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 408
diff changeset
    69
echo "fetching locales..."
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    70
test ! -d l10n && mkdir l10n
1056
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    71
jq -r 'to_entries[]| "\(.key) \(.value|.revision)"' $LOCALE_FILE | \
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    72
  while read locale changeset ; do
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    73
    case $locale in
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    74
      ja-JP-mac|en-US)
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    75
        ;;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    76
      *)
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    77
        echo "reading changeset information for $locale"
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    78
        echo "fetching $locale changeset $changeset ..."
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    79
        hg clone http://hg.mozilla.org/l10n-central/$locale l10n/$locale
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    80
        [ "$RELEASE_TAG" == "default" ] || hg -R l10n/$locale up -C -r $changeset
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    81
        ;;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    82
    esac
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1031
diff changeset
    83
  done
409
ff30593d2daa switch to 12.0dev
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 408
diff changeset
    84
echo "creating l10n archive..."
1056
90e1f32cf034 several changes to make upstream tarballs a good neighbour for locale fetching and HG checkouts
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1053
diff changeset
    85
tar $compression -cf l10n-$VERSION$VERSION_SUFFIX.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg l10n
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    86
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    87
# compare-locales
409
ff30593d2daa switch to 12.0dev
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 408
diff changeset
    88
echo "creating compare-locales"
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    89
hg clone http://hg.mozilla.org/build/compare-locales
990
0d76004e9fa4 support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 986
diff changeset
    90
tar $compression -cf compare-locales.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg compare-locales
262
b680975515e0 probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    91