summaryrefslogtreecommitdiff
path: root/bug_tracker_change_detector
diff options
context:
space:
mode:
Diffstat (limited to 'bug_tracker_change_detector')
-rwxr-xr-xbug_tracker_change_detector18
1 files changed, 16 insertions, 2 deletions
diff --git a/bug_tracker_change_detector b/bug_tracker_change_detector
index f334337..ac90aac 100755
--- a/bug_tracker_change_detector
+++ b/bug_tracker_change_detector
@@ -8,6 +8,8 @@ do
temp_file=$( mktemp )
+ temp_changes=$( mktemp )
+
changes="/tmp/un-provoked-message-store"
for url in $( curl --compressed "https://bugs.parabolagnulinux.org/bugs/issue?@pagesize=99999" 2> /dev/null | grep -E 'href="issue[[:digit:]]+' | cut -d '"' -f 2 )
@@ -52,7 +54,7 @@ do
curl --compressed "https://bugs.parabolagnulinux.org/bugs/${bug_number}" 2> /dev/null | csplit -f "${tdir}/xx" - '%<title>%1'
bug_title=$( head -1 ${tdir}/xx* | replace_wierd_html_chars )
rm -r "${tdir}"
- echo "${bug_number} created: https://bugs.parabolagnulinux.org/bugs/${bug_number} (${bug_title})" >> "${changes}"
+ echo "${bug_number} created: https://bugs.parabolagnulinux.org/bugs/${bug_number} (${bug_title})" >> "${temp_changes}"
# It is in the log file so now we check if the entire line is there,
# because if it's not then the md5sum must have changed.
elif { ! grep "${line}" "${log_file}" > /dev/null ; }
@@ -61,12 +63,24 @@ do
curl --compressed "https://bugs.parabolagnulinux.org/bugs/${bug_number}" 2> /dev/null | csplit -f "${tdir}/xx" - '%<title>%1'
bug_title=$( head -1 ${tdir}/xx* | replace_wierd_html_chars )
rm -r "${tdir}"
- echo "${bug_number} changed: https://bugs.parabolagnulinux.org/bugs/${bug_number} (${bug_title})" >> "${changes}"
+ echo "${bug_number} changed: https://bugs.parabolagnulinux.org/bugs/${bug_number} (${bug_title})" >> "${temp_changes}"
fi
done
fi
+ if (( $( wc -l "${log_file}" 2> /dev/null | cut -d ' ' -f 1 ) > 5 ))
+ then
+ echo "More than 5 changes have been detected on the bug tracker. Ignoring." >> "${changes}"
+ else
+ while read line < "${temp_changes}"
+ do
+ echo "${line}" >> "${changes}"
+ done
+ fi
+
mv "${temp_file}" "${log_file}"
+ rm -f "${temp_changes}"
+
sleep 5m
done