MozillaFirefox/create-tar.sh
author Wolfgang Rosenauer <wr@rosenauer.org>
Wed, 13 Feb 2019 08:51:42 +0100
branchfirefox65
changeset 1086 ed1c30c5f456
parent 1085 87f893cf45b9
child 1088 84cdfb476431
child 1089 eca1c1f2fe50
permissions -rwxr-xr-x
Firefox 65.0.1
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
1075
0831123bc28a final 63.0 release preparations
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1073
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"
1086
ed1c30c5f456 Firefox 65.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    10
RELEASE_TAG="1ea7b51ef5bb91bdc34fb7406fd4d35ed7961363"
ed1c30c5f456 Firefox 65.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    11
VERSION="65.0.1"
1075
0831123bc28a final 63.0 release preparations
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1073
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