Add the apport script coming from Ubuntu, thanks to them again

This commit is contained in:
Laurent Bigonville 2019-08-18 15:29:41 +02:00
parent 034bb3e28f
commit 6d1061719e
6 changed files with 55 additions and 1 deletions

3
debian/changelog vendored
View file

@ -6,8 +6,9 @@ nut (2.7.4-10) UNRELEASED; urgency=medium
x32 x32
* debian/tests: Import changes from the ubuntu package, thanks to them. * debian/tests: Import changes from the ubuntu package, thanks to them.
Add psmisc to the dependencies as it's not installed by default in debian Add psmisc to the dependencies as it's not installed by default in debian
* Add the apport script coming from Ubuntu, thanks to them again
-- Laurent Bigonville <bigon@debian.org> Sun, 04 Aug 2019 20:52:43 +0200 -- Laurent Bigonville <bigon@debian.org> Sun, 18 Aug 2019 15:29:14 +0200
nut (2.7.4-9) unstable; urgency=medium nut (2.7.4-9) unstable; urgency=medium

View file

@ -12,6 +12,7 @@ debian/tmp/lib/systemd/system/nut-monitor.service
debian/tmp/lib/systemd/system/ups-monitor.service debian/tmp/lib/systemd/system/ups-monitor.service
debian/tmp/sbin/upsmon debian/tmp/sbin/upsmon
debian/tmp/sbin/upssched debian/tmp/sbin/upssched
debian/tmp/usr/share/apport/package-hooks/source_nut-client.py
debian/tmp/usr/share/augeas/lenses/nuthostsconf.aug debian/tmp/usr/share/augeas/lenses/nuthostsconf.aug
debian/tmp/usr/share/augeas/lenses/nutnutconf.aug debian/tmp/usr/share/augeas/lenses/nutnutconf.aug
debian/tmp/usr/share/augeas/lenses/nutupsconf.aug debian/tmp/usr/share/augeas/lenses/nutupsconf.aug

View file

@ -59,5 +59,6 @@ debian/tmp/lib/systemd/system/nut-driver.service
debian/tmp/lib/systemd/system/nut-server.service debian/tmp/lib/systemd/system/nut-server.service
debian/tmp/sbin/upsd debian/tmp/sbin/upsd
debian/tmp/sbin/upsdrvctl debian/tmp/sbin/upsdrvctl
debian/tmp/usr/share/apport/package-hooks/source_nut-server.py
debian/tmp/usr/share/nut/cmdvartab debian/tmp/usr/share/nut/cmdvartab
debian/tmp/usr/share/nut/driver.list debian/tmp/usr/share/nut/driver.list

1
debian/nut.install vendored Normal file
View file

@ -0,0 +1 @@
debian/tmp/usr/share/apport/package-hooks/source_nut.py

7
debian/rules vendored
View file

@ -93,6 +93,10 @@ override_dh_auto_install-arch:
ln -s nut-monitor.service $(CURDIR)/debian/tmp/lib/systemd/system/nut-client.service ln -s nut-monitor.service $(CURDIR)/debian/tmp/lib/systemd/system/nut-client.service
ln -s /dev/null $(CURDIR)/debian/tmp/lib/systemd/system/ups-monitor.service ln -s /dev/null $(CURDIR)/debian/tmp/lib/systemd/system/ups-monitor.service
# install apport hooks
install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut-server.py
install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut-client.py
override_dh_auto_install-indep: override_dh_auto_install-indep:
#install documentation #install documentation
mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf
@ -105,6 +109,9 @@ override_dh_auto_install-indep:
cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \ cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \
done done
# install apport hooks
install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut.py
override_dh_installinit: override_dh_installinit:
dh_installinit --error-handler=handle_start_failure dh_installinit --error-handler=handle_start_failure

43
debian/source_nut.py vendored Normal file
View file

@ -0,0 +1,43 @@
#!/usr/bin/python
'''nut Apport interface
Copyright (C) 2010 Canonical Ltd.
Author: Chuck Short <chuck.short@canonical.com>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See http://www.gnu.org/copyleft/gpl.html for
the full text of the license.
'''
from apport.hookutils import *
def add_info(report,ui):
response = ui.yesno("The contents of your nut configuration files may help developers diagnose your bug more quickly, however, it may contain sensitive information. Do you want to include it in your bug report?")
if response == None: #use cancelled
raise StropIteration
elif response == True:
attach_file(report, '/etc/nut/ups.conf', 'UpsConf')
elif response == False:
ui.information("The contents of your nut configuration files will NOT be included in the bug report")
report['USBDevices'] = command_output(['lsusb'])
packages = ['nut', 'nut-client','nut-server', 'nut-cgi', 'nut-snmp', 'nut-hal-drivers', 'nut-xml', 'libupsclient1',
'libupsclient1-dev', 'python-nut', 'nut-monitor']
versions = ''
for package in packages:
try:
version = packaging.get_version(package)
except ValueError:
version = 'N/A'
if version is None:
version = 'N/A'
versions += '%s %s\n' %(package, version)
report['NutInstalledVersions'] = versions
report['KernelVersion'] = command_output(['uname', '-a'])