diff options
author | Shaun McCance <shaunm@gnome.org> | 2014-03-25 10:08:55 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2014-03-25 10:08:55 -0400 |
commit | 24af2bcafb770cb9aa2764ea59fd43075cce509b (patch) | |
tree | d138b80ce9f73bcc5d83f34a3a66bcbefd164906 /tools | |
parent | eefe1acf4a4f2b7559f058675b9305cd6f5b6b51 (diff) | |
download | yelp-tools-24af2bcafb770cb9aa2764ea59fd43075cce509b.tar.gz |
yelp-check: Return non-zero for broken hrefs
https://bugzilla.gnome.org/show_bug.cgi?id=726763
Diffstat (limited to 'tools')
-rwxr-xr-x | 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 () { |