Skip to contentSkip to conversation

fixfiles: drop unnecessary \ line endings

PATCH In review Petr Lautrbach 2 participants 3 messages Jun 6, 2024 – Jun 14, 2024 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixfiles: drop unnecessary \ line endings

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...

---
 policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
policycoreutils/scripts/fixfiles +16 -16
index 166af6f360a2..cb50fef3ca65 100755
@@ -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
 }
Signature · 1 line
2.45.2
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Petr Lautrbach

See https://github.com/koalaman/shellcheck/issues/2769

Fixes:

    $ shellcheck -S error fixfiles
Quoted 8 lines

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...

Quoted 59 lines
---
 policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
policycoreutils/scripts/fixfiles +16 -17
index 166af6f360a2..cb50fef3ca65 100755
@@ -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

#2 lore raw
Quoted 12 lines · James Carter
Quoted 10 lines · Petr Lautrbach

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.

Quoted 7 lines
Quoted 4 lines

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

Merged.
Thanks,
Jim

Quoted 59 lines
Quoted 59 lines
---
 policycoreutils/scripts/fixfiles | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
policycoreutils/scripts/fixfiles +16 -17
index 166af6f360a2..cb50fef3ca65 100755
@@ -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