From c147f5b3d349519a3f42149a97204ecb1e90dba7 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 18 Jul 2025 22:48:33 -0400 Subject: Support older (pre-2.49.0) versions of Git. Avoid using the new "git clone --revision" option, which first appeared in Git 2.49.0, released in March 2025. * makeicecat (git_thin_clone_revision): New shell function. (fetch_l10n): Use 'git_thin_clone_revision' to fetch the firefox-l10n repository. Use "git clone --branch" to fetch the compare-locales repository. --- makeicecat | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/makeicecat b/makeicecat index edd1582..5d74d7a 100755 --- a/makeicecat +++ b/makeicecat @@ -189,6 +189,23 @@ sort_inner_list_in_file() sort_inner_list "$start_line" "$end_line" < "$file" > "$file.tmp" && mv -- "$file.tmp" "$file" } +git_thin_clone_revision() +( + [ $# -eq 3 ] || fail "git_thin_clone_revision: expected 3 arguments, got $#" + local revision="$1" + local url="$2" + local dir="$3" + + # With Git 2.49.0 or later, the following command would suffice: + # git clone --depth=1 --revision="$revision" "$url" "$dir" + + git init "$dir" + cd "$dir" + git remote add origin "$url" + git fetch --depth=1 origin "$revision" + git checkout "$revision" +) + ############################################################################### # main functions ############################################################################### @@ -298,7 +315,7 @@ extract_sources() fetch_l10n() { - git clone --depth=1 --revision=${L10N_REV} ${L10N_URL} l10n + git_thin_clone_revision ${L10N_REV} ${L10N_URL} l10n rm -rf l10n/.git* mkdir ${SOURCEDIR}/l10n while read lang; do @@ -310,7 +327,7 @@ fetch_l10n() cp -a l10n/${lang} ${SOURCEDIR}/l10n/ done < ${SOURCEDIR}/browser/locales/shipped-locales - git clone --depth=1 --revision=${L10N_CMP_REV} ${L10N_CMP_URL} compare-locales + git clone --depth=1 --branch=${L10N_CMP_REV} ${L10N_CMP_URL} compare-locales rm -rf compare-locales/{.git*,.hg*} cp -a compare-locales ${SOURCEDIR}/l10n/ } -- cgit v1.2.3