1. Before this change, "abrt-cli report DIR", if it found that
it was already reported, was saying:
ABRT Server:
URL=https://retrace.fedoraproject.org/faf/reports/8739/
Bugzilla:
URL=https://bugzilla.redhat.com/show_bug.cgi?id=688129
THANKYOU
This change makes it:
A bug was already filed about this problem:
ABRT Server:
URL=https://retrace.fedoraproject.org/faf/reports/8739/
Bugzilla:
URL=https://bugzilla.redhat.com/show_bug.cgi?id=688129
THANKYOU
(the "THANKYOU" thing needs improving as well, not part of this change)
2. If "abrt-cli report DIR" found that ureport was sent, but no bugs were
filed,
abrt-action-ureport used to die silently. Now it prints one line:
"uReport was already sent, not sending it again".
3. Since now abrt-action-generate-core-backtrace emits its own message,
"Generating core_backtarce" message at verbosity 1 is removed from here.
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/plugins/abrt-action-ureport | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport
index b82d1ce..0999cc0 100644
--- a/src/plugins/abrt-action-ureport
+++ b/src/plugins/abrt-action-ureport
@@ -4,6 +4,12 @@
# uReports to a server consistent with number of problem ocurrences.
# $1 a message
+log()
+{
+ echo "$1" >&2
+}
+
+# $1 a message
log1()
{
test -n "$ABRT_VERBOSE" && test "$ABRT_VERBOSE" -ge 1
&& echo "$1" >&2
@@ -13,7 +19,7 @@ log1()
# $2 a default value
try_parse_number()
{
- if test -f $1 && grep -q "^[0-9][0-9]*$" < "$1"
&& test 0 -eq $(wc -l < $1); then
+ if test -f "$1" && grep -q "^[0-9][0-9]*$" <
"$1" && test 0 -eq "$(wc -l < $1)"; then
cat -- "$1"
else
log1 "Not a number in file '$1'"
@@ -37,24 +43,21 @@ if test 0 -ne "$UREPORTS" && test 0 -ne
"$COUNT" && test "$UREPORTS" -ge "$COUNT
log1 "uReport has been already sent: '$PWD'"
if test -f reported_to; then
- grep -e "^Bugzilla: " -e "^ABRT Server: " < reported_to |
sort -u
-
- if grep -q -e "^Bugzilla: " -e "^ABRT Server: " <
reported_to; then
+ reported=$(grep -e "^Bugzilla: " -e "^ABRT Server: " <
reported_to)
+ if test $? = 0; then
+ echo "A bug was already filed about this problem:"
+ printf "%s\n" "$reported" | sort -u
echo "THANKYOU"
exit 0
fi
-
- log1 "Bug for '$PWD' not yet filed. Continuing."
- exit 0
+ else
+ log1 "'$PWD/reported_to' doesn't exist"
fi
-
- log1 "uReport was sent but '$PWD/reported_to' doesn't exist.
Continuing."
+ log "uReport was already sent, not sending it again"
exit 0
fi
if test ! -s core_backtrace; then
- log1 "Generating core_backtrace"
-
abrt-action-generate-core-backtrace || {
log1 "uReport can't be sent without core_backtrace. Exiting."
exit 1
--
1.8.1.4