← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/bug-1084296 into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/bug-1084296 into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1084296 in Apport: "possible for a 2nd occurrence of a crash not to be sent to errors"
  https://bugs.launchpad.net/apport/+bug/1084296

For more details, see:
https://code.launchpad.net/~brian-murray/apport/bug-1084296/+merge/136816
-- 
https://code.launchpad.net/~brian-murray/apport/bug-1084296/+merge/136816
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/bug-1084296 into lp:apport.
=== modified file 'apport/crashdb_impl/launchpad.py'
--- apport/crashdb_impl/launchpad.py	2012-09-20 05:58:24 +0000
+++ apport/crashdb_impl/launchpad.py	2012-11-29 00:00:31 +0000
@@ -485,7 +485,7 @@
 
         A user should add additional information to an existing ID if (s)he is
         the reporter or subscribed, the bug is open, not a duplicate, etc. The
-        exact policy and checks should be done according to  the particular
+        exact policy and checks should be done according to the particular
         implementation.
         '''
         bug = self.launchpad.bugs[id]

=== modified file 'apport/fileutils.py'
--- apport/fileutils.py	2012-08-22 08:59:28 +0000
+++ apport/fileutils.py	2012-11-29 00:00:31 +0000
@@ -101,8 +101,18 @@
 
 
 def mark_report_upload(report):
-    report = '%s.upload' % report.rsplit('.', 1)[0]
-    with open(report, 'a'):
+    upload = '%s.upload' % report.rsplit('.', 1)[0]
+    uploaded = '%s.uploaded' % report.rsplit('.', 1)[0]
+    # if uploaded exists and is older than the report remove it and upload
+    if os.path.exists(uploaded) and os.path.exists(upload):
+        report_st = os.stat(report)
+        upload_st = os.stat(upload)
+        uploaded_st = os.stat(uploaded)
+        if upload_st.st_mtime < report_st.st_mtime:
+            os.unlink(upload)
+        if uploaded_st.st_mtime < report_st.st_mtime:
+            os.unlink(uploaded)
+    with open(upload, 'a'):
         pass
 
 

=== modified file 'po/apport.pot'
--- po/apport.pot	2012-10-01 09:58:58 +0000
+++ po/apport.pot	2012-11-29 00:00:31 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-01 11:58+0200\n"
+"POT-Creation-Date: 2012-11-28 15:54-0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -17,18 +17,18 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../apport/ui.py:105
+#: ../apport/ui.py:122
 msgid "This package does not seem to be installed correctly"
 msgstr ""
 
-#: ../apport/ui.py:109
+#: ../apport/ui.py:126
 #, python-format
 msgid ""
 "This is not an official %s package. Please remove any third party package "
 "and try again."
 msgstr ""
 
-#: ../apport/ui.py:126
+#: ../apport/ui.py:143
 #, python-format
 msgid ""
 "You have some obsolete package versions installed. Please upgrade the "
@@ -37,105 +37,105 @@
 "%s"
 msgstr ""
 
-#: ../apport/ui.py:232
+#: ../apport/ui.py:249
 msgid "unknown program"
 msgstr ""
 
-#: ../apport/ui.py:233
+#: ../apport/ui.py:250
 #, python-format
 msgid "Sorry, the program \"%s\" closed unexpectedly"
 msgstr ""
 
-#: ../apport/ui.py:235 ../apport/ui.py:1230
+#: ../apport/ui.py:252 ../apport/ui.py:1247
 #, python-format
 msgid "Problem in %s"
 msgstr ""
 
-#: ../apport/ui.py:236
+#: ../apport/ui.py:253
 msgid ""
 "Your computer does not have enough free memory to automatically analyze the "
 "problem and send a report to the developers."
 msgstr ""
 
 #. package does not exist
-#: ../apport/ui.py:251 ../apport/ui.py:257 ../apport/ui.py:263
-#: ../apport/ui.py:301 ../apport/ui.py:309 ../apport/ui.py:438
-#: ../apport/ui.py:441 ../apport/ui.py:642 ../apport/ui.py:1043
-#: ../apport/ui.py:1184 ../apport/ui.py:1188 ../apport/ui.py:1207
-#: ../apport/ui.py:1213
+#: ../apport/ui.py:268 ../apport/ui.py:274 ../apport/ui.py:280
+#: ../apport/ui.py:318 ../apport/ui.py:326 ../apport/ui.py:455
+#: ../apport/ui.py:458 ../apport/ui.py:659 ../apport/ui.py:1060
+#: ../apport/ui.py:1201 ../apport/ui.py:1205 ../apport/ui.py:1224
+#: ../apport/ui.py:1230
 msgid "Invalid problem report"
 msgstr ""
 
-#: ../apport/ui.py:252 ../apport/ui.py:1190
+#: ../apport/ui.py:269 ../apport/ui.py:1207
 msgid "This problem report is damaged and cannot be processed."
 msgstr ""
 
-#: ../apport/ui.py:258
+#: ../apport/ui.py:275
 msgid "The report belongs to a package that is not installed."
 msgstr ""
 
-#: ../apport/ui.py:264
+#: ../apport/ui.py:281
 msgid "An error occurred while attempting to process this problem report:"
 msgstr ""
 
-#: ../apport/ui.py:302
+#: ../apport/ui.py:319
 msgid "You are not allowed to access this problem report."
 msgstr ""
 
-#: ../apport/ui.py:305
+#: ../apport/ui.py:322
 msgid "Error"
 msgstr ""
 
-#: ../apport/ui.py:306
+#: ../apport/ui.py:323
 msgid "There is not enough disk space available to process this report."
 msgstr ""
 
-#: ../apport/ui.py:390
+#: ../apport/ui.py:407
 msgid "No package specified"
 msgstr ""
 
-#: ../apport/ui.py:391
+#: ../apport/ui.py:408
 msgid ""
 "You need to specify a package or a PID. See --help for more information."
 msgstr ""
 
-#: ../apport/ui.py:408
+#: ../apport/ui.py:425
 msgid "Invalid PID"
 msgstr ""
 
-#: ../apport/ui.py:409
+#: ../apport/ui.py:426
 msgid "The specified process ID does not belong to a program."
 msgstr ""
 
-#: ../apport/ui.py:417
+#: ../apport/ui.py:434
 msgid "Permission denied"
 msgstr ""
 
-#: ../apport/ui.py:418
+#: ../apport/ui.py:435
 msgid ""
 "The specified process does not belong to you. Please run this program as the "
 "process owner or as root."
 msgstr ""
 
-#: ../apport/ui.py:439
+#: ../apport/ui.py:456
 #, python-format
 msgid "Symptom script %s did not determine an affected package"
 msgstr ""
 
-#: ../apport/ui.py:442
+#: ../apport/ui.py:459
 #, python-format
 msgid "Package %s does not exist"
 msgstr ""
 
-#: ../apport/ui.py:466 ../apport/ui.py:654 ../apport/ui.py:659
+#: ../apport/ui.py:483 ../apport/ui.py:671 ../apport/ui.py:676
 msgid "Cannot create report"
 msgstr ""
 
-#: ../apport/ui.py:481 ../apport/ui.py:527 ../apport/ui.py:544
+#: ../apport/ui.py:498 ../apport/ui.py:544 ../apport/ui.py:561
 msgid "Updating problem report"
 msgstr ""
 
-#: ../apport/ui.py:482
+#: ../apport/ui.py:499
 msgid ""
 "You are not the reporter or subscriber of this problem report, or the report "
 "is a duplicate or already closed.\n"
@@ -143,7 +143,7 @@
 "Please create a new report using \"apport-bug\"."
 msgstr ""
 
-#: ../apport/ui.py:491
+#: ../apport/ui.py:508
 msgid ""
 "You are not the reporter of this problem report. It is much easier to mark a "
 "bug as a duplicate of another than to move your comments and attachments to "
@@ -155,172 +155,172 @@
 "Do you really want to proceed?"
 msgstr ""
 
-#: ../apport/ui.py:528 ../apport/ui.py:545
+#: ../apport/ui.py:545 ../apport/ui.py:562
 msgid "No additional information collected."
 msgstr ""
 
-#: ../apport/ui.py:596
+#: ../apport/ui.py:613
 msgid "What kind of problem do you want to report?"
 msgstr ""
 
-#: ../apport/ui.py:613
+#: ../apport/ui.py:630
 msgid "Unknown symptom"
 msgstr ""
 
-#: ../apport/ui.py:614
+#: ../apport/ui.py:631
 #, python-format
 msgid "The symptom \"%s\" is not known."
 msgstr ""
 
-#: ../apport/ui.py:645
+#: ../apport/ui.py:662
 msgid ""
 "After closing this message please click on an application window to report a "
 "problem about it."
 msgstr ""
 
-#: ../apport/ui.py:655 ../apport/ui.py:660
+#: ../apport/ui.py:672 ../apport/ui.py:677
 msgid "xprop failed to determine process ID of the window"
 msgstr ""
 
-#: ../apport/ui.py:674
+#: ../apport/ui.py:691
 msgid "%prog <report number>"
 msgstr ""
 
-#: ../apport/ui.py:676
+#: ../apport/ui.py:693
 msgid "Specify package name."
 msgstr ""
 
-#: ../apport/ui.py:678 ../apport/ui.py:729
+#: ../apport/ui.py:695 ../apport/ui.py:746
 msgid "Add an extra tag to the report. Can be specified multiple times."
 msgstr ""
 
-#: ../apport/ui.py:708
+#: ../apport/ui.py:725
 msgid "%prog [options] [symptom|pid|package|program path|.apport/.crash file]"
 msgstr ""
 
-#: ../apport/ui.py:711
+#: ../apport/ui.py:728
 msgid ""
 "Start in bug filing mode. Requires --package and an optional --pid, or just "
 "a --pid. If neither is given, display a list of known symptoms. (Implied if "
 "a single argument is given.)"
 msgstr ""
 
-#: ../apport/ui.py:713
+#: ../apport/ui.py:730
 msgid "Click a window as a target for filing a problem report."
 msgstr ""
 
-#: ../apport/ui.py:715
+#: ../apport/ui.py:732
 msgid "Start in bug updating mode. Can take an optional --package."
 msgstr ""
 
-#: ../apport/ui.py:717
+#: ../apport/ui.py:734
 msgid ""
 "File a bug report about a symptom. (Implied if symptom name is given as only "
 "argument.)"
 msgstr ""
 
-#: ../apport/ui.py:719
+#: ../apport/ui.py:736
 msgid ""
 "Specify package name in --file-bug mode. This is optional if a --pid is "
 "specified. (Implied if package name is given as only argument.)"
 msgstr ""
 
-#: ../apport/ui.py:721
+#: ../apport/ui.py:738
 msgid ""
 "Specify a running program in --file-bug mode. If this is specified, the bug "
 "report will contain more information.  (Implied if pid is given as only "
 "argument.)"
 msgstr ""
 
-#: ../apport/ui.py:723
+#: ../apport/ui.py:740
 msgid "The provided pid is a hanging application."
 msgstr ""
 
-#: ../apport/ui.py:725
+#: ../apport/ui.py:742
 #, python-format
 msgid ""
 "Report the crash from given .apport or .crash file instead of the pending "
 "ones in %s. (Implied if file is given as only argument.)"
 msgstr ""
 
-#: ../apport/ui.py:727
+#: ../apport/ui.py:744
 msgid ""
 "In bug filing mode, save the collected information into a file instead of "
 "reporting it. This file can then be reported later on from a different "
 "machine."
 msgstr ""
 
-#: ../apport/ui.py:731
+#: ../apport/ui.py:748
 msgid "Print the Apport version number."
 msgstr ""
 
-#: ../apport/ui.py:865
+#: ../apport/ui.py:882
 msgid ""
 "This will launch apport-retrace in a terminal window to examine the crash."
 msgstr ""
 
-#: ../apport/ui.py:866
+#: ../apport/ui.py:883
 msgid "Run gdb session"
 msgstr ""
 
-#: ../apport/ui.py:867
+#: ../apport/ui.py:884
 msgid "Run gdb session without downloading debug symbols"
 msgstr ""
 
 #. TRANSLATORS: %s contains the crash report file name
-#: ../apport/ui.py:869
+#: ../apport/ui.py:886
 #, python-format
 msgid "Update %s with fully symbolic stack trace"
 msgstr ""
 
-#: ../apport/ui.py:940
+#: ../apport/ui.py:957
 #, python-format
 msgid ""
 "The problem happened with the program %s which changed since the crash "
 "occurred."
 msgstr ""
 
-#: ../apport/ui.py:1044
+#: ../apport/ui.py:1061
 msgid "Could not determine the package or source package name."
 msgstr ""
 
-#: ../apport/ui.py:1062
+#: ../apport/ui.py:1079
 msgid "Unable to start web browser"
 msgstr ""
 
-#: ../apport/ui.py:1063
+#: ../apport/ui.py:1080
 #, python-format
 msgid "Unable to start web browser to open %s."
 msgstr ""
 
-#: ../apport/ui.py:1138
+#: ../apport/ui.py:1155
 #, python-format
 msgid "Please enter your account information for the %s bug tracking system"
 msgstr ""
 
-#: ../apport/ui.py:1150
+#: ../apport/ui.py:1167
 msgid "Network problem"
 msgstr ""
 
-#: ../apport/ui.py:1152
+#: ../apport/ui.py:1169
 msgid ""
 "Cannot connect to crash database, please check your Internet connection."
 msgstr ""
 
-#: ../apport/ui.py:1179
+#: ../apport/ui.py:1196
 msgid "Memory exhaustion"
 msgstr ""
 
-#: ../apport/ui.py:1180
+#: ../apport/ui.py:1197
 msgid "Your system does not have enough memory to process this crash report."
 msgstr ""
 
-#: ../apport/ui.py:1203 ../apport/ui.py:1212
+#: ../apport/ui.py:1220 ../apport/ui.py:1229
 msgid ""
 "This problem report applies to a program which is not installed any more."
 msgstr ""
 
-#: ../apport/ui.py:1233
+#: ../apport/ui.py:1250
 #, python-format
 msgid ""
 "The problem cannot be reported:\n"
@@ -328,18 +328,18 @@
 "%s"
 msgstr ""
 
-#: ../apport/ui.py:1284 ../apport/ui.py:1291
+#: ../apport/ui.py:1301 ../apport/ui.py:1308
 msgid "Problem already known"
 msgstr ""
 
-#: ../apport/ui.py:1285
+#: ../apport/ui.py:1302
 msgid ""
 "This problem was already reported in the bug report displayed in the web "
 "browser. Please check if you can add any further information that might be "
 "helpful for the developers."
 msgstr ""
 
-#: ../apport/ui.py:1292
+#: ../apport/ui.py:1309
 msgid "This problem was already reported to developers. Thank you!"
 msgstr ""
 
@@ -361,7 +361,7 @@
 msgid "(%i bytes)"
 msgstr ""
 
-#: ../bin/apport-cli.py:146 ../gtk/apport-gtk.py:138 ../kde/apport-kde.py:335
+#: ../bin/apport-cli.py:146 ../gtk/apport-gtk.py:138 ../kde/apport-kde.py:338
 msgid "(binary data)"
 msgstr ""
 
@@ -414,7 +414,7 @@
 msgid "Error: %s"
 msgstr ""
 
-#: ../bin/apport-cli.py:234 ../kde/apport-kde.py:380
+#: ../bin/apport-cli.py:234 ../kde/apport-kde.py:383
 msgid "Collecting problem information"
 msgstr ""
 
@@ -424,7 +424,7 @@
 "application. This might take a few minutes."
 msgstr ""
 
-#: ../bin/apport-cli.py:247 ../kde/apport-kde.py:408 ../gtk/apport-gtk.ui.h:13
+#: ../bin/apport-cli.py:247 ../kde/apport-kde.py:411 ../gtk/apport-gtk.ui.h:13
 msgid "Uploading problem information"
 msgstr ""
 
@@ -604,12 +604,12 @@
 msgstr ""
 
 #: ../gtk/apport-gtk-mime.desktop.in.h:1 ../kde/apport-kde.desktop.in.h:1
-#: ../kde/apport-kde-mime.desktop.in.h:1 ../gtk/apport-gtk.desktop.in.h:1
+#: ../gtk/apport-gtk.desktop.in.h:1 ../kde/apport-kde-mime.desktop.in.h:1
 msgid "Report a problem..."
 msgstr ""
 
 #: ../gtk/apport-gtk-mime.desktop.in.h:2 ../kde/apport-kde.desktop.in.h:2
-#: ../kde/apport-kde-mime.desktop.in.h:2 ../gtk/apport-gtk.desktop.in.h:2
+#: ../gtk/apport-gtk.desktop.in.h:2 ../kde/apport-kde-mime.desktop.in.h:2
 msgid "Report a malfunction to the developers"
 msgstr ""
 
@@ -627,7 +627,7 @@
 msgid "Sorry, %s has closed unexpectedly."
 msgstr ""
 
-#: ../gtk/apport-gtk.py:161 ../kde/apport-kde.py:176 ../kde/apport-kde.py:214
+#: ../gtk/apport-gtk.py:161 ../kde/apport-kde.py:176 ../kde/apport-kde.py:217
 #, python-format
 msgid "Sorry, %s has experienced an internal error."
 msgstr ""
@@ -636,13 +636,13 @@
 msgid "Send"
 msgstr ""
 
-#: ../gtk/apport-gtk.py:200 ../gtk/apport-gtk.py:567 ../kde/apport-kde.py:268
+#: ../gtk/apport-gtk.py:200 ../gtk/apport-gtk.py:569 ../kde/apport-kde.py:271
 #: ../gtk/apport-gtk.ui.h:7
 msgid "Show Details"
 msgstr ""
 
-#: ../gtk/apport-gtk.py:212 ../gtk/apport-gtk.py:282 ../gtk/apport-gtk.py:297
-#: ../kde/apport-kde.py:211 ../kde/apport-kde.py:220 ../gtk/apport-gtk.ui.h:10
+#: ../gtk/apport-gtk.py:212 ../gtk/apport-gtk.py:280 ../gtk/apport-gtk.py:299
+#: ../kde/apport-kde.py:210 ../kde/apport-kde.py:223 ../gtk/apport-gtk.ui.h:10
 msgid "Continue"
 msgstr ""
 
@@ -650,8 +650,8 @@
 msgid "Force Closed"
 msgstr ""
 
-#: ../gtk/apport-gtk.py:225 ../gtk/apport-gtk.py:279 ../kde/apport-kde.py:208
-#: ../kde/apport-kde.py:354
+#: ../gtk/apport-gtk.py:225 ../gtk/apport-gtk.py:284 ../kde/apport-kde.py:214
+#: ../kde/apport-kde.py:357
 msgid "Relaunch"
 msgstr ""
 
@@ -674,7 +674,7 @@
 msgid "Sorry, a problem occurred while installing software."
 msgstr ""
 
-#: ../gtk/apport-gtk.py:269 ../gtk/apport-gtk.py:286 ../kde/apport-kde.py:197
+#: ../gtk/apport-gtk.py:269 ../gtk/apport-gtk.py:288 ../kde/apport-kde.py:197
 #, python-format
 msgid "The application %s has experienced an internal error."
 msgstr ""
@@ -684,51 +684,51 @@
 msgid "The application %s has closed unexpectedly."
 msgstr ""
 
-#: ../gtk/apport-gtk.py:278 ../kde/apport-kde.py:207 ../gtk/apport-gtk.ui.h:9
+#: ../gtk/apport-gtk.py:283 ../kde/apport-kde.py:213 ../gtk/apport-gtk.ui.h:9
 msgid "Leave Closed"
 msgstr ""
 
-#: ../gtk/apport-gtk.py:294 ../kde/apport-kde.py:217 ../gtk/apport-gtk.ui.h:4
+#: ../gtk/apport-gtk.py:296 ../kde/apport-kde.py:220 ../gtk/apport-gtk.ui.h:4
 msgid "If you notice further problems, try restarting the computer."
 msgstr ""
 
-#: ../gtk/apport-gtk.py:298 ../kde/apport-kde.py:221
+#: ../gtk/apport-gtk.py:300 ../kde/apport-kde.py:224
 msgid "Ignore future problems of this type"
 msgstr ""
 
-#: ../gtk/apport-gtk.py:571 ../kde/apport-kde.py:265
+#: ../gtk/apport-gtk.py:573 ../kde/apport-kde.py:268
 msgid "Hide Details"
 msgstr ""
 
-#: ../kde/apport-kde.py:291
+#: ../kde/apport-kde.py:294
 msgid "Username:"
 msgstr ""
 
-#: ../kde/apport-kde.py:292
+#: ../kde/apport-kde.py:295
 msgid "Password:"
 msgstr ""
 
-#: ../kde/apport-kde.py:379
+#: ../kde/apport-kde.py:382
 msgid "Collecting Problem Information"
 msgstr ""
 
-#: ../kde/apport-kde.py:381
+#: ../kde/apport-kde.py:384
 msgid ""
 "The collected information can be sent to the developers to improve the "
 "application. This might take a few minutes."
 msgstr ""
 
-#: ../kde/apport-kde.py:407
+#: ../kde/apport-kde.py:410
 msgid "Uploading Problem Information"
 msgstr ""
 
-#: ../kde/apport-kde.py:409 ../gtk/apport-gtk.ui.h:15
+#: ../kde/apport-kde.py:412 ../gtk/apport-gtk.ui.h:15
 msgid ""
 "The collected information is being sent to the bug tracking system. This "
 "might take a few minutes."
 msgstr ""
 
-#: ../kde/apport-kde.py:443 ../kde/apport-kde.py:479 ../gtk/apport-gtk.ui.h:1
+#: ../kde/apport-kde.py:446 ../kde/apport-kde.py:482 ../gtk/apport-gtk.ui.h:1
 msgid "Apport"
 msgstr ""
 

=== modified file 'test/test_fileutils.py'
--- test/test_fileutils.py	2012-07-12 15:11:48 +0000
+++ test/test_fileutils.py	2012-11-29 00:00:31 +0000
@@ -130,6 +130,24 @@
         expected = os.path.join(apport.fileutils.report_dir, 'report.upload')
         self.assertTrue(os.path.exists(expected))
 
+    def test_mark_2nd_report_upload(self):
+        '''mark_2nd_report_upload()'''
+        upload = os.path.join(apport.fileutils.report_dir, 'report.upload')
+        with open(upload, 'w'):
+            pass
+        uploaded = os.path.join(apport.fileutils.report_dir, 'report.uploaded')
+        with open(uploaded, 'w'):
+            pass
+        time.sleep(1)
+        report = os.path.join(apport.fileutils.report_dir, 'report.crash')
+        with open(report, 'w'):
+            pass
+        time.sleep(1)
+        apport.fileutils.mark_report_upload(report)
+        upload_st = os.stat(upload)
+        report_st = os.stat(report)
+        self.assertTrue(upload_st.st_mtime > report_st.st_mtime)
+
     def test_get_all_reports(self):
         '''get_all_reports()'''