bugGNU GRUB - Bugs: bug #59000, regexp sees parse-string...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59000: regexp sees parse-string "-x" as a parameter!

Submitted by:  Paul Gover <goverp>
Submitted on:  Sun 23 Aug 2020 08:00:07 PM UTC  
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release: 
Release:  2.02 Reproducibility:  Every Time
Planned Release:  None

Mon 24 Aug 2020 09:51:51 AM UTC, comment #1: 

Actually, doing a test in grub-emu, I get:

grub> foo="-gentoo" ; regexp --set=1:bah '^(.*)$' "$foo" ; echo $bah
error: unknown argument `-g'.

(Of course the regex in this case is trivial for testing.  The real one was something like '^([^[:digit:]]*)([[:digit:]]*)(.*)$' but that doesn't affect the command parsing.)

Either regexp should always treat the last two arguments as pattern and string, and avoid parsing them as parameters, or introduce a couple of long options, say

regexp ... --pattern="foo" --string="bah"

as an alternative to positional parameters.

Paul Gover <goverp>
Sun 23 Aug 2020 08:00:07 PM UTC, original submission:  

Actually, my Gentoo arm64 system says it's sys-boot/grub-2.04-r1, but your release spinbutton doesn't go that far.

EFI boot system, 64-bit i686 hardware.

in a grub.cfg script:

foo="-gentoo"
regexp --set=1:bah '^(.*)$' "$foo"

should succeed and set bah to '-gentoo'.
In fact it fails and says '-gentoo' is an invalid option.

(I'm doing this because I wanted to sort kernel images named
/boot/vmlinuz-5.8.1-gentoo.new
by version number, and thus need to compare in stages, either by collating sequence for non-numeric parts, and numeric comparison for numbers; the parsing loop fails cos the last nonnumeric part is "-gentoo".

Actually, as well as fixing this bug, which produces very hard-to-debug results, if you could add some "sort" parameters to the ls module (by date and version, optionally reversed, that would save a load of code.)

Paul Gover <goverp>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goverp (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5