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