3 # TODO |
3 # TODO |
4 # http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/linux-x86_64/en-US/firefox-48.0.json |
4 # http://ftp.mozilla.org/pub/firefox/candidates/48.0-candidates/build2/linux-x86_64/en-US/firefox-48.0.json |
5 # "moz_source_stamp": "c1de04f39fa956cfce83f6065b0e709369215ed5" |
5 # "moz_source_stamp": "c1de04f39fa956cfce83f6065b0e709369215ed5" |
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="release" |
8 CHANNEL="esr60" |
9 BRANCH="releases/mozilla-$CHANNEL" |
9 BRANCH="releases/mozilla-$CHANNEL" |
10 RELEASE_TAG="FIREFOX_60_0_2_RELEASE" |
10 RELEASE_TAG="4ad4c31db9b1526aab8641be98fec8e0d63a4a7e" |
11 VERSION="60.0.2" |
11 VERSION="60.1.0" |
|
12 VERSION_SUFFIX="esr" |
|
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 *) |