diff options
author | Ulrich Müller <ulm@gentoo.org> | 2020-02-12 03:08:37 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2020-02-13 05:31:04 +0100 |
commit | 53c9011002e037ee2b8d97a5ee5657be6f4dd275 (patch) | |
tree | 29194256270c76ac22c16d091f0e8ba0ef895556 /eclass/mount-boot.eclass | |
parent | sys-fs/zfs: Adding myself as a maintainer for zfs/zfs-kmod/spl (diff) | |
download | gentoo-53c9011002e037ee2b8d97a5ee5657be6f4dd275.tar.gz gentoo-53c9011002e037ee2b8d97a5ee5657be6f4dd275.tar.bz2 gentoo-53c9011002e037ee2b8d97a5ee5657be6f4dd275.zip |
mount-boot.eclass: Make awk expression work with mawk.
gensub() is a GNUism and doesn't exist in all awk variants. Use a loop
instead.
Tested with gawk, nawk, mawk, and busybox awk.
Closes: https://bugs.gentoo.org/709322
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/mount-boot.eclass')
-rw-r--r-- | eclass/mount-boot.eclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/eclass/mount-boot.eclass b/eclass/mount-boot.eclass index c5c6b69b063e..00b367793252 100644 --- a/eclass/mount-boot.eclass +++ b/eclass/mount-boot.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: mount-boot.eclass @@ -62,8 +62,8 @@ mount-boot_check_status() { return fi - local procstate=$(awk '$2 == "/boot" \ - { print gensub(/^(.*,)?(ro|rw)(,.*)?$/, "\\2", 1, $4); exit }' \ + local procstate=$(awk '$2 == "/boot" { split($4, a, ","); \ + for (i in a) if (a[i] ~ /^r[ow]$/) { print a[i]; break }; exit }' \ /proc/mounts || die "awk failed") if [[ -z ${procstate} ]] ; then |