[pacman-dev] [PATCH 3/4] pacdiff: check cmp's exit code rather than output

Florian Pritz bluewind at xinu.at
Wed Dec 19 17:33:50 EST 2012


Signed-off-by: Florian Pritz <bluewind at xinu.at>
---
 contrib/pacdiff.sh.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/pacdiff.sh.in b/contrib/pacdiff.sh.in
index 2e67424..97584b5 100644
--- a/contrib/pacdiff.sh.in
+++ b/contrib/pacdiff.sh.in
@@ -76,8 +76,8 @@ while IFS= read -u 3 -r -d '' pacfile; do
 		rm -iv "$pacfile"
 		continue
 	fi
-	check="$(cmp "$pacfile" "$file")"
-	if [ -z "${check}" ]; then
+
+	if cmp -s "$pacfile" "$file"; then
 		echo "  Files are identical, removing..."
 		rm -v "$pacfile"
 	else
-- 
1.8.0.2


More information about the pacman-dev mailing list