[gnome-builder] xdg-app: check md5 of files instead of cmp



commit a4e5295d62556da981adbc12a26f5b8cea6f0f2f
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 27 17:50:07 2015 -0700

    xdg-app: check md5 of files instead of cmp
    
    cmp wasn't exactly working as expected, so just compare the md5. This means
    we don't abort after finding the first mismatched byte, but the files are
    local anyway, so not the end of the world.

 build/xdg-app/build.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/build/xdg-app/build.sh b/build/xdg-app/build.sh
index 3402cf6..953f197 100755
--- a/build/xdg-app/build.sh
+++ b/build/xdg-app/build.sh
@@ -77,9 +77,10 @@ for MODULE in $MODULES; do
         fi
         BODY="$BODY$MODULE: $URL $REV"$'\n'
     elif [[ "$URL" =~ ^\. ]]; then
-        if test -f $BASENAME; then
-            cmp -s "$URL" "$BASENAME"
-            if [[ $? != 0 ]]; then
+        if test -f "$BASENAME" && test -f "$URL"; then
+            OLD_MD5=`md5sum $BASENAME`
+            NEW_MD5=`md5sum $URL`
+            if [ "x$OLD_MD5" != "x$NEW_MD5" ]; then
                 cp "$URL" "$BASENAME"
                 CHANGED="$CHANGED $MODULE"
             fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]