base-files: remove useless cat
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 10 May 2020 14:47:54 +0000 (16:47 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sat, 11 Jul 2020 10:52:01 +0000 (12:52 +0200)
Check file contents directly instead of using cat.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/base-files/files/sbin/pkg_check

index 775e401b266db953b441413a6b908d4f3a934261..28e87925aefd476dea7e3accfb0b23eed85eead2 100755 (executable)
@@ -91,7 +91,7 @@ while [ "$1" ]; do
 
        # Do we have changed files or not?
        if [ -z "$ERR" ]; then
-               [ $QUIET = yes ] || [ -z "$(cat "/usr/lib/opkg/info/$1.files-sha256sum")" ] || echo "$CHECK" | sed 's|^|   - |'
+               [ $QUIET = yes ] || [ ! -s "/usr/lib/opkg/info/$1.files-sha256sum" ] || echo "$CHECK" | sed 's|^|   - |'
                [ $QUIET = yes ] || echo " * Package $1 is ok"
                [ $QUIET = yes ] || echo
        else