summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2010-01-27 06:37:54 -1000
committerDavid Cantrell <dcantrell@redhat.com>2010-01-27 08:27:58 -1000
commit76b8f12b93916bc51e2f0a00a705450144b27d8e (patch)
tree20c86283106976528440132bfb4abfe848f217ac /loader
parent8ef02e74dc9a134c6fca2eb11ad1b7a42e7160b8 (diff)
downloadanaconda-76b8f12b93916bc51e2f0a00a705450144b27d8e.tar.gz
anaconda-76b8f12b93916bc51e2f0a00a705450144b27d8e.tar.xz
anaconda-76b8f12b93916bc51e2f0a00a705450144b27d8e.zip
Update =~ regexps in linuxrc.s390 for bash-4.1 (#558537).
GNU bash 4.1 changes the behavior of the =~ operator in the [[ command. From the bash FAQ: E14) Why does quoting the pattern argument to the regular expression matching conditional operator (=~) cause regexp matching to stop working? In versions of bash prior to bash-3.2, the effect of quoting the regular expression argument to the [[ command's =~ operator was not specified. The practical effect was that double-quoting the pattern argument required backslashes to quote special pattern characters, which interfered with the backslash processing performed by double-quoted word expansion and was inconsistent with how the == shell pattern matching operator treated quoted characters. In bash-3.2, the shell was changed to internally quote characters in single- and double-quoted string arguments to the =~ operator, which suppresses the special meaning of the characters special to regular expression processing (`.', `[', `\', `(', `), `*', `+', `?', `{', `|', `^', and `$') and forces them to be matched literally. This is consistent with how the `==' pattern matching operator treats quoted portions of its pattern argument. Since the treatment of quoted string arguments was changed, several issues have arisen, chief among them the problem of white space in pattern arguments and the differing treatment of quoted strings between bash-3.1 and bash-3.2. Both problems may be solved by using a shell variable to hold the pattern. Since word splitting is not performed when expanding shell variables in all operands of the [[ command, this allows users to quote patterns as they wish when assigning the variable, then expand the values to a single string that may contain whitespace. The first problem may be solved by using backslashes or any other quoting mechanism to escape the white space in the patterns. Bash-4.0 introduces the concept of a `compatibility level', controlled by several options to the `shopt' builtin. If the `compat31' option is enabled, bash reverts to the bash-3.1 behavior with respect to quoting the rhs of the =~ operator.
Diffstat (limited to 'loader')
-rw-r--r--loader/linuxrc.s39012
1 files changed, 6 insertions, 6 deletions
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 7a6be693a..9d04b9d70 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -688,7 +688,7 @@ function syntax_check_domainname() {
# - match against regex adopted from RFC1035,sec.2.3.1 or RFC1034,sec.3.5
# (Internationalized Domain Names in Applications (IDNA) [RFC4690]
# have to be entered after encoding by punycode [RFC3492])
- [[ "$1" =~ ^[[:alpha:]]([[:alnum:]-]{0,61}[[:alnum:]])?(\\.[[:alpha:]]([[:alnum:]-]{0,61}[[:alnum:]])?)*$ ]]
+ [[ "$1" =~ ^[[:alpha:]]([[:alnum:]-]{0,61}[[:alnum:]])?(\.[[:alpha:]]([[:alnum:]-]{0,61}[[:alnum:]])?)*$ ]]
case $? in
0)
# string matched the pattern
@@ -1091,10 +1091,10 @@ function syntax_check_subchannels() {
# - make subchannel question dependent on NETTYPE (2 vs. 3 subchannels)
if [ "$NETTYPE" = "qeth" ]; then
# - match against regex, depending on qeth
- [[ "$SUBCHANNELS" =~ ^[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4},[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4},[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4}$ ]]
+ [[ "$SUBCHANNELS" =~ ^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4},[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4},[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$ ]]
else
# - match against regex, depending on lcs/ctc
- [[ "$SUBCHANNELS" =~ ^[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4},[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4}$ ]]
+ [[ "$SUBCHANNELS" =~ ^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4},[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$ ]]
fi
case $? in
0)
@@ -2418,7 +2418,7 @@ function parse_dasd() {
unset IFS
# parse: dev OR dev'-'dev
local lo=${range%%-*}
- [[ "$lo" =~ (^[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
+ [[ "$lo" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
lo=$(canonicalize_devno $lo) ;;
@@ -2434,7 +2434,7 @@ function parse_dasd() {
esac
if [ "${range//*-*/}" = "" ]; then
local hi=${range##*-}
- [[ "$hi" =~ (^[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
+ [[ "$hi" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) # string matched the pattern
hi=$(canonicalize_devno $hi)
@@ -2595,7 +2595,7 @@ function syntax_check_fcp() {
continue
;;
esac
- [[ "$devno" =~ (^[[:xdigit:]]+\\.[0-3]\\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
+ [[ "$devno" =~ (^[[:xdigit:]]+\.[0-3]\.[[:xdigit:]]{4}$)|(^[[:xdigit:]]{3,4}$) ]]
case $? in
0) ;; # string matched the pattern
1) # string did not match the pattern