[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makeicecat fails for a miscalculation of the version of rename
From: |
Mark H Weaver |
Subject: |
Re: makeicecat fails for a miscalculation of the version of rename |
Date: |
Fri, 20 Jan 2023 04:15:46 -0500 |
chippy via help-gnuzilla <help-gnuzilla@gnu.org> writes:
> Hi, I tried to build Icecat with the latest changes on makeicecat and I
> noticed that the script wrongly fails at line 148.
>
> It's about the check of the version of perl-rename. It tries to match
> higher major version and a higher minor version, which will fail when
> going from say 1.9 to 2.0.
Indeed. Thanks very much for letting us know.
> If everyone is busy, I can spend some time on this, as I really care
> for Icecat.
I've attached a patch below that I hope will fix this problem.
Would you like to test it and let us know if it works for you?
Regards,
Mark
>From 705a00f1816942a88f0dcf535979126115f9893f Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Fri, 20 Jan 2023 03:57:16 -0500
Subject: [PATCH] Fix the version check for the Perl rename utility.
* makeicecat (validate_env): Fix the major+minor version comparison
when checking for the Perl rename utility.
---
makeicecat | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/makeicecat b/makeicecat
index 174f501..e2c9242 100755
--- a/makeicecat
+++ b/makeicecat
@@ -144,8 +144,9 @@ validate_env()
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 )) )
+ (( ${BASH_REMATCH[1]} > MIN_RENAME_VER_MAJ ||
+ ( ${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})
--
2.37.1