--- a/makeicecat 2021-04-21 12:56:35.319095244 +0200 +++ b/makeicecat 2021-04-21 13:10:03.249639226 +0200 @@ -143,16 +143,23 @@ do which ${rename_cmd} &> /dev/null && RENAME_CMD=${rename_cmd} done readonly RENAME_CMD - if ! ( [[ "$( ${RENAME_CMD} --version )" =~ 'File::Rename version '([0-9]+)\.([0-9]+) ]] && + if ! ( [[ "$( ${RENAME_CMD} --version )" =~ ([0-9]+)\.([0-9]+) ]] && (( ${BASH_REMATCH[1]} >= MIN_RENAME_VER_MAJ )) && (( ${BASH_REMATCH[2]} >= MIN_RENAME_VER_MIN )) ) then required_ver=${MIN_RENAME_VER_MAJ}.${MIN_RENAME_VER_MIN} echo -e "\nERROR: This script requires the Perl rename program (version >= ${required_ver}) e.g.: 'rename' from the Guix 'rename' package - 'perl-rename' from the Parabola 'perl-file-rename' package + 'perl-rename' from the Archlinux package or 'perl-file-rename' in the Parabola project 'prename' from the Trisquel 'rename' package" return 1 + else + if [[ "$( ${RENAME_CMD} --version )" =~ 'File::Rename' ]] + then + RENAME_FLAVOUR=RMBARKER + else + RENAME_FLAVOUR=PEDERST + fi fi # verify that Wget is available @@ -428,9 +433,16 @@ apply_batch_branding() { - find . | tac | grep -i fennec | ${RENAME_CMD} --nofullpath -E 's/fennec/icecatmobile/;' -E 's/Fennec/IceCatMobile/;' - find . | tac | grep -i firefox | ${RENAME_CMD} --nofullpath -E 's/firefox/icecat/;' -E 's/Firefox/IceCat/;' - find services/fxaccounts/rust-bridge | tac | ${RENAME_CMD} --nofullpath -E 's/icecat-accounts/firefox-accounts/;' -E 's/IceCatAccounts/FirefoxAccounts/;' + if [ "${RENAME_FLAVOUR}" = "PEDERST" ] + then + find . | tac | grep -i firefox | ${RENAME_CMD} 's/firefox/icecat/ if -f;' + find . | tac | grep -i firefox | ${RENAME_CMD} 's/Firefox/IceCat/ if -f;' + find services/fxaccounts/rust-bridge | tac | ${RENAME_CMD} 's/icecat-accounts/firefox-accounts/ if -f;' + find services/fxaccounts/rust-bridge | tac | ${RENAME_CMD} 's/IceCatAccounts/FirefoxAccounts/ if -f;' + else + find . | tac | grep -i firefox | ${RENAME_CMD} --nofullpath -E 's/firefox/icecat/;' -E 's/Firefox/IceCat/;' + find services/fxaccounts/rust-bridge | tac | ${RENAME_CMD} --nofullpath -E 's/icecat-accounts/firefox-accounts/;' -E 's/IceCatAccounts/FirefoxAccounts/;' + fi echo "Running batch rebranding" local sed_script=" @@ -492,7 +507,12 @@ sed 's/mozilla-bin/icecat-bin/' -i build/unix/run-mozilla.sh - find . | tac | grep run-mozilla | ${RENAME_CMD} --nofullpath -E 's/mozilla/icecat/;' + if [ "${RENAME_FLAVOUR}" = "PEDERST" ] + then + find . | tac | grep run-mozilla | ${RENAME_CMD} 's/mozilla/icecat/ if -f;' + else + find . | tac | grep run-mozilla | ${RENAME_CMD} --nofullpath -E 's/mozilla/icecat/;' + fi # do not alter useragent/platform/oscpu/etc with fingerprinting countermeasure, it makes things worse sed '/ShouldResistFingerprinting/,/}/s/^/\/\//' -i ./netwerk/protocol/http/nsHttpHandler.cpp