author | Wolfgang Rosenauer <wr@rosenauer.org> |
Fri, 01 Oct 2021 12:00:20 +0200 | |
branch | firefox92 |
changeset 1163 | 849d6343405b |
parent 1155 | b8c834aafde2 |
child 1173 | 56ecd2ae6e61 |
permissions | -rwxr-xr-x |
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 |
|
1097 | 3 |
function print_usage_and_exit() { |
1111 | 4 |
echo "Usage: create-tar.sh tar_stamps" |
1097 | 5 |
echo "" |
1111 | 6 |
echo "Where tar_stamps should look like this:" |
1097 | 7 |
echo "" |
8 |
cat << EOF |
|
9 |
# Node ID: 64ee63facd4ff96b3e8590cff559d7e97ac6b061 |
|
10 |
PRODUCT="firefox" # "firefox" or "thunderbird" |
|
11 |
CHANNEL="esr60" |
|
12 |
VERSION="60.7.0" |
|
13 |
VERSION_SUFFIX="esr" |
|
1111 | 14 |
RELEASE_TAG="" # Needs only to be set if no tar-ball can be downloaded |
1097 | 15 |
PREV_VERSION="60.6.3" # Prev. version only needed for locales (leave empty to force l10n-generation) |
16 |
PREV_VERSION_SUFFIX="esr" |
|
1119 | 17 |
#SKIP_LOCALES="" # Uncomment to skip l10n-generation |
1097 | 18 |
EOF |
19 |
||
20 |
exit 1 |
|
21 |
} |
|
22 |
||
23 |
if [ $# -ne 1 ]; then |
|
24 |
print_usage_and_exit |
|
25 |
fi |
|
26 |
||
1111 | 27 |
# Sourcing the given tar_stamps-file to have the variables available |
1114 | 28 |
TAR_STAMP="$1" |
29 |
source "$TAR_STAMP" || print_usage_and_exit |
|
1097 | 30 |
|
31 |
# Internal variables |
|
32 |
BRANCH="releases/mozilla-$CHANNEL" |
|
33 |
if [ "$PRODUCT" = "firefox" ]; then |
|
34 |
LOCALE_FILE="firefox-$VERSION/browser/locales/l10n-changesets.json" |
|
35 |
else |
|
36 |
LOCALE_FILE="thunderbird-$VERSION/comm/mail/locales/l10n-changesets.json" |
|
37 |
fi |
|
38 |
||
39 |
SOURCE_TARBALL="$PRODUCT-$VERSION$VERSION_SUFFIX.source.tar.xz" |
|
40 |
FTP_URL="https://ftp.mozilla.org/pub/$PRODUCT/releases/$VERSION$VERSION_SUFFIX/source" |
|
1114 | 41 |
FTP_CANDIDATES_BASE_URL="https://ftp.mozilla.org/pub/$PRODUCT/candidates" |
1097 | 42 |
# Make first letter of PRODCUT upper case |
43 |
PRODUCT_CAP="${PRODUCT^}" |
|
44 |
LOCALES_URL="https://product-details.mozilla.org/1.0/l10n/$PRODUCT_CAP" |
|
1117 | 45 |
PRODUCT_URL="https://product-details.mozilla.org/1.0/$PRODUCT.json" |
1097 | 46 |
# Exit script on CTRL+C |
47 |
trap "exit" INT |
|
48 |
||
1114 | 49 |
function get_ftp_candidates_url() { |
50 |
VERSION_WITH_SUFFIX="$1" |
|
51 |
echo "$FTP_CANDIDATES_BASE_URL/$VERSION_WITH_SUFFIX-candidates" |
|
52 |
} |
|
53 |
||
1097 | 54 |
function check_tarball_source () { |
55 |
TARBALL=$1 |
|
56 |
# Print out what is going to be done: |
|
57 |
if [ -e $TARBALL ]; then |
|
58 |
echo "Reuse existing file" |
|
59 |
elif wget --spider $FTP_URL/$TARBALL 2> /dev/null; then |
|
60 |
echo "Download file" |
|
61 |
else |
|
62 |
echo "Mercurial checkout" |
|
63 |
fi |
|
64 |
} |
|
909 | 65 |
|
1097 | 66 |
function ask_cont_abort_question() { |
67 |
while true; do |
|
68 |
read -p "$1 [(c)ontinue/(a)bort] " ca |
|
69 |
case $ca in |
|
70 |
[Cc]* ) return 0 ;; |
|
71 |
[Aa]* ) return 1 ;; |
|
72 |
* ) echo "Please answer c or a.";; |
|
73 |
esac |
|
74 |
done |
|
75 |
} |
|
76 |
||
77 |
function check_for_binary() { |
|
78 |
if ! test -x $1; then |
|
79 |
echo "$1 is missing: execute zypper in $2" |
|
80 |
exit 5 |
|
81 |
fi |
|
82 |
} |
|
83 |
||
1114 | 84 |
function get_source_stamp() { |
85 |
BUILD_ID="$1" |
|
86 |
FTP_CANDIDATES_BASE_URL=$(get_ftp_candidates_url $VERSION$VERSION_SUFFIX) |
|
1117 | 87 |
FTP_CANDIDATES_JSON_SUFFIX="${BUILD_ID}/linux-x86_64/en-US/$PRODUCT-$VERSION$VERSION_SUFFIX.json" |
1114 | 88 |
BUILD_JSON=$(curl --silent --fail "$FTP_CANDIDATES_BASE_URL/$FTP_CANDIDATES_JSON_SUFFIX") || return 1; |
89 |
REV=$(echo "$BUILD_JSON" | jq .moz_source_stamp) |
|
90 |
SOURCE_REPO=$(echo "$BUILD_JSON" | jq .moz_source_repo) |
|
91 |
TIMESTAMP=$(echo "$BUILD_JSON" | jq .buildid) |
|
92 |
echo "Extending $TAR_STAMP with:" |
|
93 |
echo "RELEASE_REPO=${SOURCE_REPO}" |
|
94 |
echo "RELEASE_TAG=${REV}" |
|
95 |
echo "RELEASE_TIMESTAMP=${TIMESTAMP}" |
|
96 |
# We "remove and add" instead of "replace" in case the entries are not there yet |
|
97 |
# Removing the old RELEASE_-tags |
|
98 |
sed -i "/RELEASE_\(TAG\|REPO\|TIMESTAMP\)=.*/d" "$TAR_STAMP" |
|
99 |
# Appending the new |
|
100 |
echo "RELEASE_REPO=$SOURCE_REPO" >> "$TAR_STAMP" |
|
101 |
echo "RELEASE_TAG=$REV" >> "$TAR_STAMP" |
|
102 |
echo "RELEASE_TIMESTAMP=$TIMESTAMP" >> "$TAR_STAMP" |
|
103 |
} |
|
1097 | 104 |
|
1114 | 105 |
function get_build_number() { |
1097 | 106 |
LAST_FOUND="" |
1114 | 107 |
VERSION_WITH_SUFFIX="$1" |
1117 | 108 |
|
109 |
BUILD_ID=$(curl --silent "$PRODUCT_URL" | jq -e '.["releases"] | .["'$PRODUCT-$VERSION_WITH_SUFFIX'"] | .["build_number"]') |
|
110 |
||
111 |
# Slow fall-back |
|
112 |
if [ $? -ne 0 ]; then |
|
113 |
echo "Build number not found in product URL, falling back to slow FTP-parsing." 1>&2 |
|
114 |
FTP_CANDIDATES_BASE_URL=$(get_ftp_candidates_url $VERSION_WITH_SUFFIX) |
|
115 |
# Unfortunately, locales-files are not associated to releases, but to builds. |
|
116 |
# And since we don't know which build was the final build, we grep them all from |
|
117 |
# the candidates-page, sort them and take the last one which should be the oldest |
|
118 |
# Error only if not even the first one exists |
|
119 |
LAST_FOUND=$(curl --silent --fail "$FTP_CANDIDATES_BASE_URL/" | grep -o "build[0-9]*/" | sort | uniq | tail -n 1 | cut -d "/" -f 1) |
|
120 |
else |
|
121 |
LAST_FOUND="build$BUILD_ID" |
|
122 |
fi |
|
1098 | 123 |
|
124 |
if [ "$LAST_FOUND" != "" ]; then |
|
125 |
echo "$LAST_FOUND" |
|
126 |
return 0 |
|
127 |
else |
|
1114 | 128 |
echo "Error: Could not find build-number for Firefox $VERSION_WITH_SUFFIX !" 1>&2 |
129 |
return 1 |
|
130 |
fi |
|
131 |
} |
|
132 |
||
133 |
||
134 |
function locales_get() { |
|
135 |
TMP_VERSION="$1" |
|
136 |
BUILD_ID="$2" |
|
137 |
URL_TO_CHECK="${LOCALES_URL}-${TMP_VERSION}" |
|
138 |
FINAL_URL="${URL_TO_CHECK}-${BUILD_ID}.json" |
|
139 |
if wget --quiet --spider "$FINAL_URL"; then |
|
140 |
echo "$FINAL_URL" |
|
141 |
return 0 |
|
142 |
else |
|
1098 | 143 |
echo "Error: Could not find locales-file (json) for Firefox $TMP_VERSION !" 1>&2 |
144 |
return 1 |
|
145 |
fi |
|
1097 | 146 |
} |
147 |
||
148 |
function locales_parse() { |
|
149 |
URL="$1" |
|
150 |
curl -s "$URL" | python -c "import json; import sys; \ |
|
151 |
print('\n'.join(['{} {}'.format(key, value['changeset']) \ |
|
152 |
for key, value in sorted(json.load(sys.stdin)['locales'].items())]));" |
|
153 |
} |
|
154 |
||
155 |
function locales_unchanged() { |
|
1114 | 156 |
BUILD_ID="$1" |
157 |
PREV_BUILD_ID=$(get_build_number "$PREV_VERSION$PREV_VERSION_SUFFIX") |
|
1097 | 158 |
# If no json-file for one of the versions can be found, we say "they changed" |
1114 | 159 |
prev_url=$(locales_get "$PREV_VERSION$PREV_VERSION_SUFFIX" "$PREV_BUILD_ID") || return 1 |
160 |
curr_url=$(locales_get "$VERSION$VERSION_SUFFIX" "$BUILD_ID") || return 1 |
|
1097 | 161 |
|
162 |
prev_content=$(locales_parse "$prev_url") || exit 1 |
|
163 |
curr_content=$(locales_parse "$curr_url") || exit 1 |
|
164 |
||
165 |
diff -y --suppress-common-lines -d <(echo "$prev_content") <(echo "$curr_content") |
|
166 |
} |
|
262
b680975515e0
probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
167 |
|
1032
8220ea23b47d
remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1031
diff
changeset
|
168 |
# check required tools |
1097 | 169 |
check_for_binary /usr/bin/hg "mercurial" |
170 |
check_for_binary /usr/bin/jq "jq" |
|
171 |
which python > /dev/null || exit 1 |
|
1032
8220ea23b47d
remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1031
diff
changeset
|
172 |
|
990
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
173 |
# use parallel compression, if available |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
174 |
compression='-J' |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
175 |
pixz -h > /dev/null 2>&1 |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
176 |
if (($? != 127)); then |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
177 |
compression='-Ipixz' |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
178 |
fi |
0d76004e9fa4
support parallel compression if available
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
986
diff
changeset
|
179 |
|
1114 | 180 |
# Get ID |
181 |
BUILD_ID=$(get_build_number "$VERSION$VERSION_SUFFIX") |
|
182 |
||
1097 | 183 |
if [ -z ${SKIP_LOCALES+x} ]; then |
1138 | 184 |
if [ "$PREV_VERSION" != "" ] && locales_unchanged "$BUILD_ID"; then |
1097 | 185 |
printf "%-40s: Did not change. Skipping.\n" "locales" |
186 |
LOCALES_CHANGED=0 |
|
187 |
else |
|
188 |
printf "%-40s: Need to download.\n" "locales" |
|
189 |
LOCALES_CHANGED=1 |
|
190 |
fi |
|
191 |
else |
|
192 |
printf "%-40s: User forced skip (SKIP_LOCALES set)\n" "locales" |
|
193 |
fi |
|
194 |
||
195 |
# Check what is going to be done and ask for consent |
|
196 |
for ff in $SOURCE_TARBALL $SOURCE_TARBALL.asc; do |
|
197 |
printf "%-40s: %s\n" $ff "$(check_tarball_source $ff)" |
|
198 |
done |
|
199 |
||
200 |
$(ask_cont_abort_question "Is this ok?") || exit 0 |
|
201 |
||
202 |
# Try to download tar-ball from officiall mozilla-mirror |
|
203 |
if [ ! -e $SOURCE_TARBALL ]; then |
|
204 |
wget https://ftp.mozilla.org/pub/$PRODUCT/releases/$VERSION$VERSION_SUFFIX/source/$SOURCE_TARBALL |
|
205 |
fi |
|
206 |
# including signature |
|
207 |
if [ ! -e $SOURCE_TARBALL.asc ]; then |
|
208 |
wget https://ftp.mozilla.org/pub/$PRODUCT/releases/$VERSION$VERSION_SUFFIX/source/$SOURCE_TARBALL.asc |
|
209 |
fi |
|
210 |
||
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
|
211 |
# we might have an upstream archive already and can skip the checkout |
1097 | 212 |
if [ -e $SOURCE_TARBALL ]; then |
1098 | 213 |
if [ -z ${SKIP_LOCALES+x} ] && [ $LOCALES_CHANGED -ne 0 ]; then |
1097 | 214 |
# still need to extract the locale information from the archive |
215 |
echo "extract locale changesets" |
|
216 |
tar -xf $SOURCE_TARBALL $LOCALE_FILE |
|
217 |
fi |
|
1114 | 218 |
get_source_stamp "$BUILD_ID" |
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
|
219 |
else |
1097 | 220 |
# We are working on a version that is not yet published on the mozilla mirror |
221 |
# so we have to actually check out the repo |
|
222 |
||
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
|
223 |
# mozilla |
1097 | 224 |
if [ -d $PRODUCT-$VERSION ]; then |
225 |
pushd $PRODUCT-$VERSION || exit 1 |
|
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
|
226 |
_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
|
227 |
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
|
228 |
*$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
|
229 |
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
|
230 |
hg pull |
1097 | 231 |
popd || exit 1 |
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
|
232 |
;; |
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
|
233 |
* ) |
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
|
234 |
echo "removing obsolete tree" |
1097 | 235 |
popd || exit 1 |
236 |
rm -rf $PRODUCT-$VERSION |
|
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
|
237 |
;; |
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
|
238 |
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
|
239 |
fi |
1097 | 240 |
if [ ! -d $PRODUCT-$VERSION ]; then |
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
|
241 |
echo "cloning new $BRANCH..." |
1155
b8c834aafde2
Prepare 87.0 branch based on 86.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1138
diff
changeset
|
242 |
hg clone https://hg.mozilla.org/$BRANCH $PRODUCT-$VERSION |
1097 | 243 |
if [ "$PRODUCT" = "thunderbird" ]; then |
1155
b8c834aafde2
Prepare 87.0 branch based on 86.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1138
diff
changeset
|
244 |
hg clone https://hg.mozilla.org/releases/comm-$CHANNEL $PRODUCT-$VERSION/comm |
1097 | 245 |
fi |
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
|
246 |
fi |
1097 | 247 |
pushd $PRODUCT-$VERSION || exit 1 |
1111 | 248 |
|
249 |
# parse out the Firefox-release tag for this Thunderbird-checkout |
|
250 |
if [ "$PRODUCT" = "thunderbird" ]; then |
|
251 |
FF_RELEASE_TAG=$(grep ^GECKO_HEAD_REV ./comm/.gecko_rev.yml | awk -F ' ' '{print $2}') || exit 1 |
|
252 |
echo "Parsed Firefox base ID from .gecko_rev.yml: $FF_RELEASE_TAG" |
|
253 |
else |
|
254 |
FF_RELEASE_TAG="$RELEASE_TAG" |
|
255 |
fi |
|
256 |
||
1097 | 257 |
hg update --check $FF_RELEASE_TAG |
258 |
[ "$FF_RELEASE_TAG" == "default" ] || hg update -r $FF_RELEASE_TAG |
|
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
|
259 |
# get repo and source stamp |
1117 | 260 |
REV=$(hg -R . parent --template="{node|short}\n") |
1155
b8c834aafde2
Prepare 87.0 branch based on 86.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1138
diff
changeset
|
261 |
SOURCE_REPO=$(hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/https:/") |
1117 | 262 |
TIMESTAMP=$(date +%Y%m%d%H%M%S) |
1097 | 263 |
|
264 |
if [ "$PRODUCT" = "thunderbird" ]; then |
|
265 |
pushd comm || exit 1 |
|
1111 | 266 |
hg update --check $RELEASE_TAG |
1097 | 267 |
popd || exit 1 |
268 |
rm -rf thunderbird-${VERSION}/{,comm/}other-licenses/7zstub |
|
269 |
fi |
|
270 |
popd || exit 1 |
|
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
|
271 |
|
1117 | 272 |
echo "Extending $TAR_STAMP with:" |
273 |
echo "RELEASE_REPO=${SOURCE_REPO}" |
|
274 |
echo "RELEASE_TAG=${REV}" |
|
275 |
echo "RELEASE_TIMESTAMP=${TIMESTAMP}" |
|
276 |
||
277 |
# We "remove and add" instead of "replace" in case the entries are not there yet |
|
278 |
# Removing the old RELEASE_-tags |
|
279 |
sed -i "/RELEASE_\(TAG\|REPO\|TIMESTAMP\)=.*/d" "$TAR_STAMP" |
|
280 |
# Appending the new |
|
281 |
echo "RELEASE_REPO=$SOURCE_REPO" >> "$TAR_STAMP" |
|
282 |
echo "RELEASE_TAG=$REV" >> "$TAR_STAMP" |
|
283 |
echo "RELEASE_TIMESTAMP=$TIMESTAMP" >> "$TAR_STAMP" |
|
284 |
||
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
|
285 |
echo "creating archive..." |
1097 | 286 |
tar $compression -cf $PRODUCT-$VERSION$VERSION_SUFFIX.source.tar.xz --exclude=.hgtags --exclude=.hgignore --exclude=.hg --exclude=CVS $PRODUCT-$VERSION |
287 |
fi |
|
288 |
||
289 |
if [ ! -z ${SKIP_LOCALES+x} ]; then |
|
290 |
echo "Skipping locales-creation." |
|
291 |
exit 0 |
|
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
|
292 |
fi |
262
b680975515e0
probably last working Firefox-on-xulrunner build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
293 |
|
1097 | 294 |
if [ $LOCALES_CHANGED -ne 0 ]; then |
295 |
# l10n |
|
296 |
echo "fetching locales..." |
|
297 |
test ! -d l10n && mkdir l10n |
|
298 |
jq -r 'to_entries[]| "\(.key) \(.value|.revision)"' $LOCALE_FILE | \ |
|
299 |
while read locale changeset ; do |
|
300 |
case $locale in |
|
301 |
ja-JP-mac|en-US) |
|
302 |
;; |
|
303 |
*) |
|
304 |
echo "reading changeset information for $locale" |
|
305 |
echo "fetching $locale changeset $changeset ..." |
|
306 |
if [ -d "l10n/$locale/.hg" ]; then |
|
307 |
pushd "l10n/$locale" || exit 1 |
|
308 |
hg pull |
|
309 |
popd || exit 1 |
|
310 |
else |
|
1155
b8c834aafde2
Prepare 87.0 branch based on 86.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1138
diff
changeset
|
311 |
hg clone "https://hg.mozilla.org/l10n-central/$locale" "l10n/$locale" |
1097 | 312 |
fi |
1111 | 313 |
[ "$RELEASE_TAG" == "default" ] || hg -R "l10n/$locale" up -C -r "$changeset" |
1097 | 314 |
;; |
315 |
esac |
|
316 |
done |
|
317 |
echo "creating l10n archive..." |
|
1098 | 318 |
if [ "$PRODUCT" = "thunderbird" ]; then |
1097 | 319 |
TB_TAR_FLAGS="--exclude=browser --exclude=suite" |
1098 | 320 |
fi |
1097 | 321 |
tar $compression -cf l10n-$VERSION$VERSION_SUFFIX.tar.xz \ |
322 |
--exclude=.hgtags --exclude=.hgignore --exclude=.hg \ |
|
323 |
$TB_TAR_FLAGS \ |
|
324 |
l10n |
|
1098 | 325 |
elif [ -f "l10n-$PREV_VERSION$PREV_VERSION_SUFFIX.tar.xz" ]; then |
326 |
# Locales did not change, but the old tar-ball is in this directory |
|
327 |
# Simply rename it: |
|
328 |
echo "Moving l10n-$PREV_VERSION$PREV_VERSION_SUFFIX.tar.xz to l10n-$VERSION$VERSION_SUFFIX.tar.xz" |
|
329 |
mv "l10n-$PREV_VERSION$PREV_VERSION_SUFFIX.tar.xz" "l10n-$VERSION$VERSION_SUFFIX.tar.xz" |
|
1097 | 330 |
fi |