[yelp-tools] yelp-check: Return non-zero for broken hrefs



commit 24af2bcafb770cb9aa2764ea59fd43075cce509b
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Mar 25 10:08:55 2014 -0400

    yelp-check: Return non-zero for broken hrefs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726763

 tools/yelp-check.in |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tools/yelp-check.in b/tools/yelp-check.in
index dedafab..7cb0d95 100755
--- a/tools/yelp-check.in
+++ b/tools/yelp-check.in
@@ -280,6 +280,7 @@ yelp_hrefs () {
         yelp_usage_hrefs
         exit 1
     fi
+    check_out_file=`mktemp "${TMPDIR:-/tmp}"/yelp-XXXXXXXX`
     for xml in "$@"; do
         if [ -d "$xml" ]; then
             for page in "$xml"/*.page; do
@@ -303,7 +304,12 @@ yelp_hrefs () {
             (curl -s -I -L "$url" | grep '^HTTP/' | tail -n 1 | head -n 1 | grep -q 'HTTP/.\.. 200 .*') ||
             echo "$id: $url"
         fi
-    done
+    done > "$check_out_file"
+    ret=`cat "$check_out_file" | wc -l`
+    if test "x$ret" != "x0"; then ret="1"; fi
+    cat "$check_out_file"
+    rm "$check_out_file"
+    exit $ret
 }
 
 yelp_ids_page () {


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