diff mbox series

fixfiles: drop unnecessary \ line endings

Message ID 20240606095039.50456-1-lautrbach@redhat.com (mailing list archive)
State Accepted
Commit fd08019984db
Delegated to: Petr Lautrbach
Headers show
Series fixfiles: drop unnecessary \ line endings | expand

Commit Message

Petr Lautrbach June 6, 2024, 9:50 a.m. UTC
See https://github.com/koalaman/shellcheck/issues/2769

Fixes:
    $ shellcheck -S error fixfiles

    In fixfiles line 189:
            # These two sorts need to be separate commands \
                                                            ^-- SC1143 (error): This backslash is part of a comment and does not continue the line.

    For more information:
      https://www.shellcheck.net/wiki/SC1143 -- This backslash is part of a comme...

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
---
 policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

Comments

James Carter June 10, 2024, 6:14 p.m. UTC | #1
On Thu, Jun 6, 2024 at 5:51 AM Petr Lautrbach <lautrbach@redhat.com> wrote:
>
> See https://github.com/koalaman/shellcheck/issues/2769
>
> Fixes:
>     $ shellcheck -S error fixfiles
>
>     In fixfiles line 189:
>             # These two sorts need to be separate commands \
>                                                             ^-- SC1143 (error): This backslash is part of a comment and does not continue the line.
>
>     For more information:
>       https://www.shellcheck.net/wiki/SC1143 -- This backslash is part of a comme...
>
> Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>

Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
> index 166af6f360a2..cb50fef3ca65 100755
> --- a/policycoreutils/scripts/fixfiles
> +++ b/policycoreutils/scripts/fixfiles
> @@ -173,10 +173,10 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
>         test -z "$TEMPFILE" && exit
>         PREFCTEMPFILE=`mktemp ${PREFC}.XXXXXXXXXX`
>         sed -r -e 's,:s0, ,g' $PREFC | sort -u > ${PREFCTEMPFILE}
> -       sed -r -e 's,:s0, ,g' $FC | sort -u | \
> -       /usr/bin/diff -b ${PREFCTEMPFILE} - | \
> -           grep '^[<>]'|cut -c3-| grep ^/ | \
> -           grep -Ev '(^/home|^/root|^/tmp)' |\
> +       sed -r -e 's,:s0, ,g' $FC | sort -u |
> +       /usr/bin/diff -b ${PREFCTEMPFILE} - |
> +           grep '^[<>]'|cut -c3-| grep ^/ |
> +           grep -Ev '(^/home|^/root|^/tmp)' |
>         sed -r -e 's,[[:blank:]].*,,g' \
>                -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
>                -e 's|([/[:alnum:]])\?|{\1,}|g' \
> @@ -185,19 +185,19 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
>                -e 's|\(.*|*|g' \
>                -e 's|\[.*|*|g' \
>                -e 's|\.\*.*|*|g' \
> -              -e 's|\.\+.*|*|g' | \
> -           # These two sorts need to be separate commands \
> -       sort -u | \
> -       sort -d | \
> -       while read pattern ; \
> -           do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
> -                 echo "$pattern"; \
> -                 case "$pattern" in *"*") \
> +              -e 's|\.\+.*|*|g' |
> +           # These two sorts need to be separate commands
> +       sort -u |
> +       sort -d |
> +       while read pattern ;
> +           do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then
> +                 echo "$pattern";
> +                 case "$pattern" in *"*")
>                        echo "$pattern" | sed -e 's,^,^,' -e 's,\*$,,g' >> ${TEMPFILE};;
> -                 esac; \
> -              fi; \
> -           done | \
> -       ${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -; \
> +                 esac;
> +              fi;
> +           done |
> +       ${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -;
>         rm -f ${TEMPFILE} ${PREFCTEMPFILE}
>  fi
>  }
> --
> 2.45.2
>
>
James Carter June 14, 2024, 2:09 p.m. UTC | #2
On Mon, Jun 10, 2024 at 2:14 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Thu, Jun 6, 2024 at 5:51 AM Petr Lautrbach <lautrbach@redhat.com> wrote:
> >
> > See https://github.com/koalaman/shellcheck/issues/2769
> >
> > Fixes:
> >     $ shellcheck -S error fixfiles
> >
> >     In fixfiles line 189:
> >             # These two sorts need to be separate commands \
> >                                                             ^-- SC1143 (error): This backslash is part of a comment and does not continue the line.
> >
> >     For more information:
> >       https://www.shellcheck.net/wiki/SC1143 -- This backslash is part of a comme...
> >
> > Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
>
> Acked-by: James Carter <jwcart2@gmail.com>
>

Merged.
Thanks,
Jim

> > ---
> >  policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
> >  1 file changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
> > index 166af6f360a2..cb50fef3ca65 100755
> > --- a/policycoreutils/scripts/fixfiles
> > +++ b/policycoreutils/scripts/fixfiles
> > @@ -173,10 +173,10 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
> >         test -z "$TEMPFILE" && exit
> >         PREFCTEMPFILE=`mktemp ${PREFC}.XXXXXXXXXX`
> >         sed -r -e 's,:s0, ,g' $PREFC | sort -u > ${PREFCTEMPFILE}
> > -       sed -r -e 's,:s0, ,g' $FC | sort -u | \
> > -       /usr/bin/diff -b ${PREFCTEMPFILE} - | \
> > -           grep '^[<>]'|cut -c3-| grep ^/ | \
> > -           grep -Ev '(^/home|^/root|^/tmp)' |\
> > +       sed -r -e 's,:s0, ,g' $FC | sort -u |
> > +       /usr/bin/diff -b ${PREFCTEMPFILE} - |
> > +           grep '^[<>]'|cut -c3-| grep ^/ |
> > +           grep -Ev '(^/home|^/root|^/tmp)' |
> >         sed -r -e 's,[[:blank:]].*,,g' \
> >                -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
> >                -e 's|([/[:alnum:]])\?|{\1,}|g' \
> > @@ -185,19 +185,19 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
> >                -e 's|\(.*|*|g' \
> >                -e 's|\[.*|*|g' \
> >                -e 's|\.\*.*|*|g' \
> > -              -e 's|\.\+.*|*|g' | \
> > -           # These two sorts need to be separate commands \
> > -       sort -u | \
> > -       sort -d | \
> > -       while read pattern ; \
> > -           do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
> > -                 echo "$pattern"; \
> > -                 case "$pattern" in *"*") \
> > +              -e 's|\.\+.*|*|g' |
> > +           # These two sorts need to be separate commands
> > +       sort -u |
> > +       sort -d |
> > +       while read pattern ;
> > +           do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then
> > +                 echo "$pattern";
> > +                 case "$pattern" in *"*")
> >                        echo "$pattern" | sed -e 's,^,^,' -e 's,\*$,,g' >> ${TEMPFILE};;
> > -                 esac; \
> > -              fi; \
> > -           done | \
> > -       ${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -; \
> > +                 esac;
> > +              fi;
> > +           done |
> > +       ${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -;
> >         rm -f ${TEMPFILE} ${PREFCTEMPFILE}
> >  fi
> >  }
> > --
> > 2.45.2
> >
> >
diff mbox series

Patch

diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
index 166af6f360a2..cb50fef3ca65 100755
--- a/policycoreutils/scripts/fixfiles
+++ b/policycoreutils/scripts/fixfiles
@@ -173,10 +173,10 @@  if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
 	test -z "$TEMPFILE" && exit
 	PREFCTEMPFILE=`mktemp ${PREFC}.XXXXXXXXXX`
 	sed -r -e 's,:s0, ,g' $PREFC | sort -u > ${PREFCTEMPFILE}
-	sed -r -e 's,:s0, ,g' $FC | sort -u | \
-	/usr/bin/diff -b ${PREFCTEMPFILE} - | \
-	    grep '^[<>]'|cut -c3-| grep ^/ | \
-	    grep -Ev '(^/home|^/root|^/tmp)' |\
+	sed -r -e 's,:s0, ,g' $FC | sort -u |
+	/usr/bin/diff -b ${PREFCTEMPFILE} - |
+	    grep '^[<>]'|cut -c3-| grep ^/ |
+	    grep -Ev '(^/home|^/root|^/tmp)' |
 	sed -r -e 's,[[:blank:]].*,,g' \
 	       -e 's|\(([/[:alnum:]]+)\)\?|{\1,}|g' \
 	       -e 's|([/[:alnum:]])\?|{\1,}|g' \
@@ -185,19 +185,19 @@  if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
 	       -e 's|\(.*|*|g' \
 	       -e 's|\[.*|*|g' \
 	       -e 's|\.\*.*|*|g' \
-	       -e 's|\.\+.*|*|g' | \
-	    # These two sorts need to be separate commands \
-	sort -u | \
-	sort -d | \
-	while read pattern ; \
-	    do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then \
-		  echo "$pattern"; \
-		  case "$pattern" in *"*") \
+	       -e 's|\.\+.*|*|g' |
+	    # These two sorts need to be separate commands
+	sort -u |
+	sort -d |
+	while read pattern ;
+	    do if ! echo "$pattern" | grep -q -f ${TEMPFILE} 2>/dev/null; then
+		  echo "$pattern";
+		  case "$pattern" in *"*")
 		       echo "$pattern" | sed -e 's,^,^,' -e 's,\*$,,g' >> ${TEMPFILE};;
-		  esac; \
-	       fi; \
-	    done | \
-	${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -; \
+		  esac;
+	       fi;
+	    done |
+	${RESTORECON} ${VERBOSE} ${EXCLUDEDIRS} ${FORCEFLAG} ${THREADS} $* -i -R -f -;
 	rm -f ${TEMPFILE} ${PREFCTEMPFILE}
 fi
 }