This PR adds _ to the package pattern match for RHEL: '\.el[1-9]+[\._]'.
This PR also reworks the package list parsing for each OS, such that cat is no longer required.
head is still used, but moved to the end of the expression, so that elif doesn't complain.
The use of head -1 could probably be replaced with [ -z "$str" ] expression; however, I didn't implement this as I couldn't be bothered testing on a bunch of systems and versions of Bash.
Issue
LES uses regex pattern matching on the first line (head -1 ...) of the package list to determine to the package list format and OS.
The match is insufficient for RHEL systems, as there's no guarantee that the first line will contain the el[0-9] pattern.
For example, the following output is from rpm -qa on a RHEL5.5 box:
Additionally, when el[0-9] is present in the package name, there's no guarantee that the package name format will always match the \.el[0-9]+\. pattern. For example, on RHEL 5, the pattern el5_ is often used, rather than a el5..
This PR adds
_
to the package pattern match for RHEL:'\.el[1-9]+[\._]'
.This PR also reworks the package list parsing for each OS, such that
cat
is no longer required.head
is still used, but moved to the end of the expression, so thatelif
doesn't complain.The use of
head -1
could probably be replaced with[ -z "$str" ]
expression; however, I didn't implement this as I couldn't be bothered testing on a bunch of systems and versions of Bash.Issue
LES uses regex pattern matching on the first line (
head -1 ...
) of the package list to determine to the package list format and OS.The match is insufficient for RHEL systems, as there's no guarantee that the first line will contain the
el[0-9]
pattern.For example, the following output is from
rpm -qa
on a RHEL5.5 box:Additionally, when
el[0-9]
is present in the package name, there's no guarantee that the package name format will always match the\.el[0-9]+\.
pattern. For example, on RHEL 5, the patternel5_
is often used, rather than ael5.
.