help-gnuzilla
[Top][All Lists]
Advanced

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

Re: makeicecat fails for a miscalculation of the version of rename


From: bill-auger
Subject: Re: makeicecat fails for a miscalculation of the version of rename
Date: Fri, 20 Jan 2023 06:50:39 -0500

i suspected that check to be brittle - the software itself is confusing - those 
minimum versions are no longer accurate

the original reason for that version check, was that there are multiple 
variants of the perl rename program - makeicecat requires the "Robin Barker" 
variant of the Perl rename program (version >= 1.10) - that is the variant in 
most distros; but the "pederst" variant in arch-based distros, is incompatible 
- IIRC,m at the time, its version was less than 1.10 - the project was/is very 
stagnant/abandoned; so it was a fair compromise at the time - now, the 
incompatible variant is at v1.11; but it still does not have the feature 
required by makeicecat.

so to avoid the original problem why that check was added, at the very least, 
MIN_RENAME_VER_MIN needs to move ahead _a_few_ arbitrary minor versions (13 
would be fine for now) - o/c that is again only passing the brittle buck 
forward a notch

the essential missing feature is the --nofullpath option; so i found a more 
robust check, which crudely but accurately tests for that feature, regardless 
of the misleading version numbers - this implementation should never need to 
change

i would want to verify that the test command is repeatable across distros -  
the "pederst" variant fails this test

# guix:
$ rename --nofullpath 's|||' no-such-file &> /dev/null && echo "this rename 
supports the --nofullpath option"

# arch derivatives:
$ perl-rename --nofullpath 's|||' no-such-file &> /dev/null && echo "this 
rename supports the --nofullpath option"

# debian derivatives:
$ prename --nofullpath 's|||' no-such-file &> /dev/null && echo "this rename 
supports the --nofullpath option"



diff --git a/makeicecat b/makeicecat
index 543e2ad..2d95f82 100755
--- a/makeicecat
+++ b/makeicecat
@@ -48,8 +48,6 @@ readonly 
PREFS_IN_FILE=browser/locales/en-US/browser/preferences/preferences.ftl
 readonly PREFS_OUT_FILE=/browser/browser/preferences/preferences.ftl
 
 # build environment, working directory, and outputs
-readonly MIN_RENAME_VER_MAJ=1
-readonly MIN_RENAME_VER_MIN=10
 readonly DATADIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/data
 readonly ICECATVERSION=${FFVERSION}-gnu${GNUVERSION}
 readonly OUTPUT_SOURCEBALL=icecat-${ICECATVERSION}.tar.bz2
@@ -143,12 +141,10 @@ validate_env()
     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]+) ]] &&
-               (( ${BASH_REMATCH[1]} >= MIN_RENAME_VER_MAJ )) &&
-               (( ${BASH_REMATCH[2]} >= MIN_RENAME_VER_MIN )) )
+    if ! ${RENAME_CMD} --nofullpath 's|||' no-such-file &> /dev/null
     then
-        required_ver=${MIN_RENAME_VER_MAJ}.${MIN_RENAME_VER_MIN}
-        echo -e "\nERROR: This script requires the Perl rename program 
(version >= ${required_ver})
+        echo -e "\nERROR: This script requires the \"Robin Barker\" variant of 
the Perl rename program (version >= 1.10).
+That is the variant in most distros. The \"pederst\" variant in arch-based 
distros, is incompatible.
  e.g.: 'rename' from the Guix 'rename' package
        'perl-rename' from the Parabola 'perl-file-rename' package
        'prename' from the Trisquel 'rename' package"



reply via email to

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