Re: [PATCH 1/4] Update =~ regexps in linuxrc.s390 for bash-4.1 (#558537).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 27 Jan 2010, Steffen Maier wrote:

Assuming you tested this successfully, this one looks good, but it is
not sufficient.

Could you also adapt loader/lsznet.raw accordingly to fix bug 558537
completely?

Patch coming shortly.  Speaking of lsznet.raw, why can't it live in the
s390utils project?  It does not feel right that anaconda owns this script.


On 01/27/2010 06:46 PM, David Cantrell wrote:
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?

---
 loader/linuxrc.s390 |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 7a6be69..9d04b9d 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

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkth93UACgkQ5hsjjIy1VklyqQCg9Gx4Glus+Y5F3R2DKl8XHqwy
9rcAoNMLQvckNCMBmjmAYpRQx3vlhU/m
=+C1u
-----END PGP SIGNATURE-----
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux