diff -Nru kubuntu-notification-helper-14.04ubuntu7/data/whoopsie-upload-all kubuntu-notification-helper-14.04ubuntu8/data/whoopsie-upload-all --- kubuntu-notification-helper-14.04ubuntu7/data/whoopsie-upload-all 2014-02-23 16:39:54.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/data/whoopsie-upload-all 2014-03-17 12:29:37.000000000 +0000 @@ -18,6 +18,8 @@ import time import subprocess import argparse +import dbus +import dbus.service import apport.fileutils import apport @@ -57,20 +59,24 @@ print('%s already has info collected' % report) else: print('Collecting info for %s...' % report) - r.add_os_info() - r.add_gdb_info() try: + r.add_os_info() + r.add_gdb_info() r.add_package_info() - except (SystemError, ValueError) as e: - sys.stderr.write('ERROR: cannot add package info on %s: %s\n' % + except (OSError, SystemError, ValueError) as e: + sys.stderr.write('ERROR: cannot add apport info on %s: %s\n' % (report, str(e))) return None # write updated report - with open(report, 'ab') as f: - os.chmod(report, 0) - r.write(f, only_new=True) - os.chmod(report, 0o640) + try: + with open(report, 'ab') as f: + os.chmod(report, 0) + r.write(f, only_new=True) + os.chmod(report, 0o640) + except (PermissionError, Exception) as e: + sys.stderr.write('ERROR: cannot update %s: %s\n' % (report, str(e))) + return None # now tell whoopsie to upload the report print('Marking %s for whoopsie upload' % report) @@ -123,13 +129,22 @@ return False +session_bus = dbus.SessionBus() +try: + session_bus.get_object("org.kubuntu.whoopsie_upload_all", "/UniqueApplication") + print("INFO: whoopsie-upload-all already running") + sys.exit(0) +except dbus.DBusException: + # This will 'take' the DBUS name + bus_name = dbus.service.BusName("org.kubuntu.whoopsie_upload_all", bus=session_bus) + # # main # parser = argparse.ArgumentParser(description='Noninteractively upload all ' 'Apport crash reports to errors.ubuntu.com') -parser.add_argument('-t', '--timeout', default=1800, type=int, - help='seconds to wait for whoopsie to upload the reports (default: 1800s)') +parser.add_argument('-t', '--timeout', default=900, type=int, + help='seconds to wait for whoopsie to upload the reports (default: 900s)') opts = parser.parse_args() # parse args diff -Nru kubuntu-notification-helper-14.04ubuntu7/debian/changelog kubuntu-notification-helper-14.04ubuntu8/debian/changelog --- kubuntu-notification-helper-14.04ubuntu7/debian/changelog 2014-02-23 16:41:45.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/debian/changelog 2014-03-17 12:32:10.000000000 +0000 @@ -1,7 +1,30 @@ +kubuntu-notification-helper (14.04ubuntu8) trusty; urgency=medium + + * Catch another source of PermissionError in whoopsie-upload-all, + this should now handle all sources of permission errors LP: #1281884 + * Implement simple unique application tracking by registering on dbus, + this prevents multiple invocation triggers. Also, the long + upload timeout is less concerning with a unique application. + + Depends on python3-dbus + * Upload timeout reduced from 30 minutes to 15 minutes. This is just as + arbitrary a value, but really 15 minutes should be more than enough time + for most systems. With a 30 minute timeout and a bad connection one + can easily get into a situation where upload-all is running 24/7, reducing + the timeout improves this at least slightly. + * Try apport report add_*() and except (OSError, SystemError, ValueError) to + prevent unhandled exceptions when the system runs out of disk space for + example LP: #1292766 + + -- Harald Sitter Mon, 17 Mar 2014 13:06:34 +0100 + kubuntu-notification-helper (14.04ubuntu7) trusty; urgency=medium [ Rohan Garg ] * Really fix LP: #1282074 + * Fix LP: #1282107 by making the kcm write PCI values + and the kded module reading them. + * Implement enabling/disabling notifications for + Driver Events (LP: #1282107) [ Harald Sitter ] * Catch PermissionError in whoopsie-upload-all open() diff -Nru kubuntu-notification-helper-14.04ubuntu7/debian/control kubuntu-notification-helper-14.04ubuntu8/debian/control --- kubuntu-notification-helper-14.04ubuntu7/debian/control 2014-02-23 16:41:26.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/debian/control 2014-03-17 12:26:30.000000000 +0000 @@ -14,7 +14,7 @@ Package: kubuntu-notification-helper Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, konsole | x-terminal-emulator, - qapt-batch, kubuntu-driver-manager + qapt-batch, kubuntu-driver-manager, python3-dbus Recommends: apport-kde | apport-gtk Description: Kubuntu system notification helper Kubuntu Notification Helper is a daemon that presents various notifications diff -Nru kubuntu-notification-helper-14.04ubuntu7/src/daemon/driverevent/driverevent.cpp kubuntu-notification-helper-14.04ubuntu8/src/daemon/driverevent/driverevent.cpp --- kubuntu-notification-helper-14.04ubuntu7/src/daemon/driverevent/driverevent.cpp 2014-02-23 16:39:13.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/src/daemon/driverevent/driverevent.cpp 2014-02-28 10:41:46.000000000 +0000 @@ -28,6 +28,8 @@ #include #include +#include +#include DriverEvent::DriverEvent(QObject *parent, QString name) @@ -61,30 +63,38 @@ if (!m_aptBackend->openXapianIndex()) { return; } + m_manager = new OrgKubuntuDriverManagerInterface("org.kubuntu.DriverManager", "/DriverManager", QDBusConnection::sessionBus()); + m_manager->getDriverDict(false); + connect(m_manager, SIGNAL(dataReady(QVariantMapMap)), SLOT(driverDictFinished(QVariantMapMap)), Qt::UniqueConnection); - if (m_manager->isValid()) { - m_manager->getDriverDict(false); - connect(m_manager, SIGNAL(dataReady(QVariantMapMap)), SLOT(driverDictFinished(QVariantMapMap)), Qt::UniqueConnection); - } } void DriverEvent::driverDictFinished(QVariantMapMap data) { + kDebug(); if (data.isEmpty()) { return; } + KConfig driver_manager("kcmdrivermanagerrc"); + KConfigGroup pciGroup( &driver_manager, "PCI" ); + Q_FOREACH(const QString &key,data.keys()) { - QDBusPendingReply driverForDeviceMap = m_manager->getDriverMapForDevice(key); - QDBusPendingCallWatcher *async = new QDBusPendingCallWatcher(driverForDeviceMap, this); - connect(async, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(driverMapFinished(QDBusPendingCallWatcher*))); + if (pciGroup.readEntry(key) != QLatin1String("true")) { + QDBusPendingReply driverForDeviceMap = m_manager->getDriverMapForDevice(key); + QDBusPendingCallWatcher *async = new QDBusPendingCallWatcher(driverForDeviceMap, this); + connect(async, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(driverMapFinished(QDBusPendingCallWatcher*))); + } else { + kDebug() << key << "has already been processed by the KCM"; + } } } void DriverEvent::driverMapFinished(QDBusPendingCallWatcher *data) { + kDebug(); if (!data->isError()) { QDBusPendingReply mapReply = *data; QVariantMapMap map = mapReply.value(); diff -Nru kubuntu-notification-helper-14.04ubuntu7/src/daemon/notificationhelpermodule.cpp kubuntu-notification-helper-14.04ubuntu8/src/daemon/notificationhelpermodule.cpp --- kubuntu-notification-helper-14.04ubuntu7/src/daemon/notificationhelpermodule.cpp 2014-02-20 15:36:13.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/src/daemon/notificationhelpermodule.cpp 2014-02-28 10:41:46.000000000 +0000 @@ -71,7 +71,7 @@ // Delay init by 3 minutes to speed up start of kded and prevent a notification // wall on login. - QTimer::singleShot(3*60*1000, this, SLOT(init())); + QTimer::singleShot(1000, this, SLOT(init())); } NotificationHelperModule::~NotificationHelperModule() @@ -83,11 +83,11 @@ m_configWatcher = new ConfigWatcher(this); m_apportEvent = new ApportEvent(this, "Apport"); + m_driverEvent = new DriverEvent(this, "Driver"); m_hookEvent = new HookEvent(this, "Hook"); m_installEvent = new InstallEvent(this, "Install"); m_l10nEvent = new L10nEvent(this, "L10n"); m_rebootEvent = new RebootEvent(this, "Restart"); - m_driverEvent = new DriverEvent(this, "Driver"); const bool apportHidden = m_apportEvent->isHidden(); const bool apportKde = QFile::exists("/usr/share/apport/apport-kde"); diff -Nru kubuntu-notification-helper-14.04ubuntu7/src/kcmodule/notificationhelperconfigmodule.cpp kubuntu-notification-helper-14.04ubuntu8/src/kcmodule/notificationhelperconfigmodule.cpp --- kubuntu-notification-helper-14.04ubuntu7/src/kcmodule/notificationhelperconfigmodule.cpp 2014-02-20 09:03:48.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/src/kcmodule/notificationhelperconfigmodule.cpp 2014-02-28 10:41:46.000000000 +0000 @@ -42,6 +42,7 @@ NotificationHelperConfigModule::NotificationHelperConfigModule(QWidget* parent, const QVariantList&) : KCModule(NotificationHelperConfigFactory::componentData(), parent) , m_apportCheckBox(nullptr) + , m_driverCheckBox(nullptr) , m_hookCheckBox(nullptr) , m_installCheckBox(nullptr) , m_l10nCheckBox(nullptr) @@ -68,12 +69,14 @@ label->setText(i18n("Show notifications for:")); m_apportCheckBox = new QCheckBox(i18n("Application crashes"), this); + m_driverCheckBox = new QCheckBox(i18n("Proprietary Driver availability"), this); m_hookCheckBox = new QCheckBox(i18n("Upgrade information"), this); m_installCheckBox = new QCheckBox(i18n("Restricted codec availability"), this); m_l10nCheckBox = new QCheckBox(i18n("Incomplete language support"), this); m_rebootCheckBox = new QCheckBox(i18n("Required reboots"), this); connect(m_apportCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); + connect(m_driverCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); connect(m_hookCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); connect(m_installCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); connect(m_l10nCheckBox, SIGNAL(clicked()), this, SLOT(configChanged())); @@ -102,6 +105,7 @@ lay->addWidget(label); lay->addWidget(m_apportCheckBox); + lay->addWidget(m_driverCheckBox); lay->addWidget(m_hookCheckBox); lay->addWidget(m_installCheckBox); lay->addWidget(m_l10nCheckBox); @@ -124,6 +128,7 @@ KConfigGroup notifyGroup(&cfg, "Event"); m_apportCheckBox->setChecked(!notifyGroup.readEntry("hideApportNotifier", false)); + m_driverCheckBox->setChecked(!notifyGroup.readEntry("hideDriverNotifier", false)); m_hookCheckBox->setChecked(!notifyGroup.readEntry("hideHookNotifier", false)); m_installCheckBox->setChecked(!notifyGroup.readEntry("hideInstallNotifier", false)); m_l10nCheckBox->setChecked(!notifyGroup.readEntry("hideL10nNotifier", false)); @@ -147,6 +152,7 @@ KConfigGroup notifyGroup(&cfg, "Event"); notifyGroup.writeEntry("hideApportNotifier", !m_apportCheckBox->isChecked()); + notifyGroup.writeEntry("hideDriverNotifier", !m_driverCheckBox->isChecked()); notifyGroup.writeEntry("hideHookNotifier", !m_hookCheckBox->isChecked()); notifyGroup.writeEntry("hideInstallNotifier", !m_installCheckBox->isChecked()); notifyGroup.writeEntry("hideL10nNotifier", !m_l10nCheckBox->isChecked()); @@ -171,6 +177,7 @@ void NotificationHelperConfigModule::defaults() { m_apportCheckBox->setChecked(true); + m_driverCheckBox->setChecked(true); m_hookCheckBox->setChecked(true); m_installCheckBox->setChecked(true); m_l10nCheckBox->setChecked(true); diff -Nru kubuntu-notification-helper-14.04ubuntu7/src/kcmodule/notificationhelperconfigmodule.h kubuntu-notification-helper-14.04ubuntu8/src/kcmodule/notificationhelperconfigmodule.h --- kubuntu-notification-helper-14.04ubuntu7/src/kcmodule/notificationhelperconfigmodule.h 2014-02-20 09:03:48.000000000 +0000 +++ kubuntu-notification-helper-14.04ubuntu8/src/kcmodule/notificationhelperconfigmodule.h 2014-02-28 10:41:46.000000000 +0000 @@ -44,6 +44,7 @@ private: QCheckBox *m_apportCheckBox; + QCheckBox *m_driverCheckBox; QCheckBox *m_hookCheckBox; QCheckBox *m_installCheckBox; QCheckBox *m_l10nCheckBox;