diff mbox series

policycoreutils: drop usage of egrep in fixfiles

Message ID 20220405133958.52460-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit df31981d635d
Headers show
Series policycoreutils: drop usage of egrep in fixfiles | expand

Commit Message

Christian Göttsche April 5, 2022, 1:39 p.m. UTC
egrep(1) is deprecated, use `grep -E`.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 policycoreutils/scripts/fixfiles | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Petr Lautrbach April 6, 2022, 10:41 a.m. UTC | #1
Christian Göttsche <cgzones@googlemail.com> writes:

> egrep(1) is deprecated, use `grep -E`.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

Acked-by: Petr Lautrbach <plautrba@redhat.com>


> ---
>  policycoreutils/scripts/fixfiles | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
> index 7df4303a..c72ca0eb 100755
> --- a/policycoreutils/scripts/fixfiles
> +++ b/policycoreutils/scripts/fixfiles
> @@ -45,9 +45,9 @@ FS="`cat /proc/self/mounts | sort | uniq | awk '{print $2}'`"
>  for i in $FS; do
>  	if [ `useseclabel` -ge 0 ]
>  	then
> -		grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)seclabel(,|$)' && echo $i
> +		grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)seclabel(,|$)' && echo $i
>  	else
> -		grep " $i " /proc/self/mounts | grep -v "context=" | egrep --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
> +		grep " $i " /proc/self/mounts | grep -v "context=" | grep -E --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
>  	fi
>  done
>  }
> @@ -55,14 +55,14 @@ done
>  get_rw_labeled_mounts() {
>  FS=`get_all_labeled_mounts | sort | uniq`
>  for i in $FS; do
> -	grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)rw(,|$)' && echo $i
> +	grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)rw(,|$)' && echo $i
>  done
>  }
>  
>  get_ro_labeled_mounts() {
>  FS=`get_all_labeled_mounts | sort | uniq`
>  for i in $FS; do
> -	grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)ro(,|$)' && echo $i
> +	grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)ro(,|$)' && echo $i
>  done
>  }
>  
> @@ -176,7 +176,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
>  	sed -r -e 's,:s0, ,g' $FC | sort -u | \
>  	/usr/bin/diff -b ${PREFCTEMPFILE} - | \
>  	    grep '^[<>]'|cut -c3-| grep ^/ | \
> -	    egrep -v '(^/home|^/root|^/tmp)' |\
> +	    grep -Ev '(^/home|^/root|^/tmp)' |\
>  	sed -r -e 's,[[:blank:]].*,,g' \
>  	       -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
>  	       -e 's|([/[:alnum:]])\?|{\1,}|g' \
> -- 
> 2.35.1
James Carter April 12, 2022, 6:03 p.m. UTC | #2
On Wed, Apr 6, 2022 at 11:29 AM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> Christian Göttsche <cgzones@googlemail.com> writes:
>
> > egrep(1) is deprecated, use `grep -E`.
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> Acked-by: Petr Lautrbach <plautrba@redhat.com>
>

Merged.
Thanks,
Jim

>
> > ---
> >  policycoreutils/scripts/fixfiles | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
> > index 7df4303a..c72ca0eb 100755
> > --- a/policycoreutils/scripts/fixfiles
> > +++ b/policycoreutils/scripts/fixfiles
> > @@ -45,9 +45,9 @@ FS="`cat /proc/self/mounts | sort | uniq | awk '{print $2}'`"
> >  for i in $FS; do
> >       if [ `useseclabel` -ge 0 ]
> >       then
> > -             grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)seclabel(,|$)' && echo $i
> > +             grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)seclabel(,|$)' && echo $i
> >       else
> > -             grep " $i " /proc/self/mounts | grep -v "context=" | egrep --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
> > +             grep " $i " /proc/self/mounts | grep -v "context=" | grep -E --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
> >       fi
> >  done
> >  }
> > @@ -55,14 +55,14 @@ done
> >  get_rw_labeled_mounts() {
> >  FS=`get_all_labeled_mounts | sort | uniq`
> >  for i in $FS; do
> > -     grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)rw(,|$)' && echo $i
> > +     grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)rw(,|$)' && echo $i
> >  done
> >  }
> >
> >  get_ro_labeled_mounts() {
> >  FS=`get_all_labeled_mounts | sort | uniq`
> >  for i in $FS; do
> > -     grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)ro(,|$)' && echo $i
> > +     grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)ro(,|$)' && echo $i
> >  done
> >  }
> >
> > @@ -176,7 +176,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
> >       sed -r -e 's,:s0, ,g' $FC | sort -u | \
> >       /usr/bin/diff -b ${PREFCTEMPFILE} - | \
> >           grep '^[<>]'|cut -c3-| grep ^/ | \
> > -         egrep -v '(^/home|^/root|^/tmp)' |\
> > +         grep -Ev '(^/home|^/root|^/tmp)' |\
> >       sed -r -e 's,[[:blank:]].*,,g' \
> >              -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
> >              -e 's|([/[:alnum:]])\?|{\1,}|g' \
> > --
> > 2.35.1
>
diff mbox series

Patch

diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
index 7df4303a..c72ca0eb 100755
--- a/policycoreutils/scripts/fixfiles
+++ b/policycoreutils/scripts/fixfiles
@@ -45,9 +45,9 @@  FS="`cat /proc/self/mounts | sort | uniq | awk '{print $2}'`"
 for i in $FS; do
 	if [ `useseclabel` -ge 0 ]
 	then
-		grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)seclabel(,|$)' && echo $i
+		grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)seclabel(,|$)' && echo $i
 	else
-		grep " $i " /proc/self/mounts | grep -v "context=" | egrep --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
+		grep " $i " /proc/self/mounts | grep -v "context=" | grep -E --silent '(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs )' && echo $i
 	fi
 done
 }
@@ -55,14 +55,14 @@  done
 get_rw_labeled_mounts() {
 FS=`get_all_labeled_mounts | sort | uniq`
 for i in $FS; do
-	grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)rw(,|$)' && echo $i
+	grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)rw(,|$)' && echo $i
 done
 }
 
 get_ro_labeled_mounts() {
 FS=`get_all_labeled_mounts | sort | uniq`
 for i in $FS; do
-	grep " $i " /proc/self/mounts | awk '{print $4}' | egrep --silent '(^|,)ro(,|$)' && echo $i
+	grep " $i " /proc/self/mounts | awk '{print $4}' | grep -E --silent '(^|,)ro(,|$)' && echo $i
 done
 }
 
@@ -176,7 +176,7 @@  if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
 	sed -r -e 's,:s0, ,g' $FC | sort -u | \
 	/usr/bin/diff -b ${PREFCTEMPFILE} - | \
 	    grep '^[<>]'|cut -c3-| grep ^/ | \
-	    egrep -v '(^/home|^/root|^/tmp)' |\
+	    grep -Ev '(^/home|^/root|^/tmp)' |\
 	sed -r -e 's,[[:blank:]].*,,g' \
 	       -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
 	       -e 's|([/[:alnum:]])\?|{\1,}|g' \