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!

Submitter:  Paul Gover <goverp>
Submitted:  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:  2.02
Release:  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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code