[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: |
Fri, 20 Oct 2023 00:00:46 -0400 |
On Wed, 11 Oct 2023 14:03:09 -0400 Mark wrote:
> bill-auger <bill-auger@peers.community> writes:
> > but it should probably be done in the makeicecat script,
> > to apply the change to all installed languages
>
> I think it's already done. It should be handled by this code in the
> 'apply_patches' shell function:
>
> --8<---------------cut here---------------start------------->8---
> for dir in l10n/*; do
> if [[ $dir != l10n/compare-locales ]]; then
> if [[ ! -e ${DATADIR}/files-to-append/${dir}/${PREFS_OUT_FILE}
> ]]; then
> cat ${DATADIR}/files-to-append/${PREFS_IN_FILE} >>
> ${dir}/${PREFS_OUT_FILE}
> fi
> fi
> done
> --8<---------------cut here---------------end--------------->8---
>
> This code aims to add the English-language messages for the
> "IceCat-specific privacy settings" (including 'resistFingerprinting')
> for all languages for which we don't yet have proper localized strings.
yes i agree - i re-worked the patch and commented the intention
there is a bug in this section of code, which i had another patch for -
namely, ${DATADIR} may contain spaces; but is unquoted -
the main patch assumes that this change is already applied
diff --git a/makeicecat b/makeicecat
index 4eb8d34..db9e7e7 100755
--- a/makeicecat
+++ b/makeicecat
@@ -373,8 +373,8 @@ apply_patches()
for dir in l10n/*; do
if [[ $dir != l10n/compare-locales ]]; then
- if [[ ! -e ${DATADIR}/files-to-append/${dir}/${PREFS_OUT_FILE} ]];
then
- cat ${DATADIR}/files-to-append/${PREFS_IN_FILE} >>
${dir}/${PREFS_OUT_FILE}
+ if [[ ! -e "${DATADIR}"/files-to-append/${dir}/${PREFS_OUT_FILE}
]]; then
+ cat "${DATADIR}"/files-to-append/${PREFS_IN_FILE} >>
${dir}/${PREFS_OUT_FILE}
fi
fi
done
--
2.42.0
diff --git a/makeicecat b/makeicecat
index db9e7e7..f18f131 100755
--- a/makeicecat
+++ b/makeicecat
@@ -56,6 +56,7 @@ readonly SOURCEDIR=icecat-${FFVERSION}
# debug/shell options
readonly DEVEL=0
+readonly ICECAT_LANG=$( (( DEVEL )) && echo es-ES )
set -euo pipefail
(( DEVEL )) && set -x
@@ -322,8 +323,8 @@ for lang in data:
print (lang, data[lang]["revision"])
'
python3 -c "${py_script}" < "${file}" | while read lang revision ; do
- # download only one language-pack in devel mode
- ! (( DEVEL )) || [[ "$(echo ${lang} | cut -d' ' -f1)" == "es-ES" ]] ||
continue
+ # download only one language-pack in DEVEL mode
+ [[ -z "${ICECAT_LANG}" || "${lang}" == "${ICECAT_LANG}" ]] || continue
# download only language-packs which are not already in the working
directory
if [[ -n "${lang}" && "${lang}" != 'en-US' && ! -f
${lang}/${L10N_DTD_FILE} ]]
@@ -366,14 +367,20 @@ apply_patches()
done
shopt -u nullglob
+ # Apply translated "IceCat-specific privacy settings" to translations
for file_to_append in $(cd "${DATADIR}"/files-to-append; find . -type f
-print); do
- echo Appending new data to the end of file: $file_to_append
+ # handle only one language in DEVEL mode, or per environment
+ [[ "${file_to_append}" != ./l10n/* ]] ||
+ [[ "${file_to_append}" == ./l10n/${ICECAT_LANG:+${ICECAT_LANG}/}* ]]
|| continue
+
+ echo Applying translated IceCat-specific privacy settings to file:
$file_to_append
cat "${DATADIR}"/files-to-append/$file_to_append >> $file_to_append
done
-
+ # Apply English "IceCat-specific privacy settings" to remaining
translations
for dir in l10n/*; do
if [[ $dir != l10n/compare-locales ]]; then
if [[ ! -e "${DATADIR}"/files-to-append/${dir}/${PREFS_OUT_FILE}
]]; then
+ echo Applying English IceCat-specific privacy settings to
file: ${dir}/${PREFS_OUT_FILE}
cat "${DATADIR}"/files-to-append/${PREFS_IN_FILE} >>
${dir}/${PREFS_OUT_FILE}
fi
fi
--
2.42.0
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/05
- Re: [PATCH] Fix DEVEL=1 build, Yuchen Pei, 2023/10/05
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/05
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build,
bill-auger <=
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/20
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, bill-auger, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/11
- Re: [PATCH] Fix DEVEL=1 build, Mark H Weaver, 2023/10/05