gnuzilla-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix DEVEL=1 build


From: bill-auger
Subject: Re: [PATCH] Fix DEVEL=1 build
Date: Wed, 11 Oct 2023 13:11:43 -0400

i noticed that the AUR maintainer (ab)uses the DEVEL switch to install only a
single language-pack; which seems like a valid use-case for anyone who
compiles only for personal use - this second patch formalizes that use-case,
allowing to specify a single language per the environment


From a21dbe38e85101627bccf748f41855a1a82de0d9 Mon Sep 17 00:00:00 2001
From: bill-auger <mr.j.spam.me@gmail.com>
Date: Wed, 11 Oct 2023 12:29:30 -0400
Subject: [PATCH 2/2] allow specifying single language-pack per env var

---
 makeicecat | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)

diff --git a/makeicecat b/makeicecat
index 71bc92f..dae1853 100755
--- a/makeicecat
+++ b/makeicecat
@@ -20,6 +20,24 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 
+###############################################################################
+# notes
+###############################################################################
+
+# environment variables:
+#
+# $ONE_LANG
+#   $ONE_LANG may be set in the environment to specify a single language-pack
+#   to be installed, in addition to the standard 'en-US'.
+#   If set, this must be one of `ls data/files-to-append/l10n/`
+#   If unset in standard mode, all supported language-packs will be installed.
+#   If unset in DEVEL mode, this defaults to 'es-ES'.
+
+
+###############################################################################
+# constants
+###############################################################################
+
 # metadata
 readonly FFMAJOR=115
 readonly FFMINOR=3
@@ -55,9 +73,11 @@ readonly SOURCEDIR=icecat-${FFVERSION}
 
 # debug/shell options
 readonly DEVEL=0
-readonly ONE_LANG=$( (( ! DEVEL )) || echo es-ES )
 set -euo pipefail
-(( DEVEL )) && set -x
+(( ! DEVEL )) || set -x
+
+# options per environment
+readonly ONE_LANG=${ONE_LANG:-$( (( ! DEVEL )) || echo es-ES )}
 
 
 ###############################################################################
@@ -188,12 +208,21 @@ sort_inner_list_in_file()
     sort_inner_list "$start_line" "$end_line" < "$file" > "$file.tmp" && mv --
"$file.tmp" "$file" }
 
+
 ###############################################################################
 # main functions
 ###############################################################################
 
 validate_env()
 {
+    # verify that the single language-pack, if specified, is supported
+    if [[ -n "$ONE_LANG" && ! -d data/files-to-append/l10n/${ONE_LANG}/ ]]
+    then
+        echo -e "\nERROR: The specified \$ONE_LANG: '$ONE_LANG' is not
supported.
+       It must be one of the directory names under data/files-to-append/l10n/."
+        return 1
+    fi
+
     # verify that GnuPG is available
     if ! which gpg &> /dev/null
     then
@@ -300,7 +329,7 @@ fetch_l10n()
     cd l10n
 
     while read lang; do
-        # download only one language-pack in DEVEL mode
+        # download only one language-pack in DEVEL mode, or per environment
         [[ -z "$ONE_LANG" || "${lang}" == "$ONE_LANG" ]] || continue
 
         # download only language-packs which are not already in the working
directory
-- 
2.42.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]