diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2014-03-29 14:09:01 +0000 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2014-03-29 14:09:01 +0000 |
commit | 207e6f5a3271611484bb097854f306aaaa92faee (patch) | |
tree | 4f91935f1ee59ff5c6a308e0a05235ff4a2eec34 /net-firewall/ufw-frontends | |
parent | Fix typo in updated preference file, bug #506144 (diff) | |
download | gentoo-2-207e6f5a3271611484bb097854f306aaaa92faee.tar.gz gentoo-2-207e6f5a3271611484bb097854f306aaaa92faee.tar.bz2 gentoo-2-207e6f5a3271611484bb097854f306aaaa92faee.zip |
Revbump with upstream patch to fix crash when no log file is found. Thanks to Sławomir Nizio <slawomir.nizio@sabayon.org>
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 09BF4F54C2BA7F3C!)
Diffstat (limited to 'net-firewall/ufw-frontends')
3 files changed, 136 insertions, 1 deletions
diff --git a/net-firewall/ufw-frontends/ChangeLog b/net-firewall/ufw-frontends/ChangeLog index 016b5bd28c73..1c8c91e99e69 100644 --- a/net-firewall/ufw-frontends/ChangeLog +++ b/net-firewall/ufw-frontends/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-firewall/ufw-frontends # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw-frontends/ChangeLog,v 1.9 2014/02/16 11:28:02 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw-frontends/ChangeLog,v 1.10 2014/03/29 14:09:00 hwoarang Exp $ + +*ufw-frontends-0.3.2-r2 (29 Mar 2014) + + 29 Mar 2014; Markos Chandras <hwoarang@gentoo.org> + +ufw-frontends-0.3.2-r2.ebuild, + +files/ufw-frontends-0.3.2-no-log-crash.patch: + Revbump with upstream patch to fix crash when no log file is found. Thanks to + Sławomir Nizio <slawomir.nizio@sabayon.org> 16 Feb 2014; Markos Chandras <hwoarang@gentoo.org> -ufw-frontends-0.3.2.ebuild: diff --git a/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch b/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch new file mode 100644 index 000000000000..f4adb49826ec --- /dev/null +++ b/net-firewall/ufw-frontends/files/ufw-frontends-0.3.2-no-log-crash.patch @@ -0,0 +1,61 @@ +From e7bcf87788588c3a38ce18c9a8d69bbe156860e9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org> +Date: Mon, 3 Mar 2014 08:31:47 +0100 +Subject: [PATCH] Fix crash when no log in supported location can be found + +This can happen for example on systems that use Journal +from systemd. + +In this case, ufw-gtk exits with a traceback containing: +IOError: [Errno 2] No such file or directory: '/var/log/messages.log' +(this is the last log file tried). + +The patch works around the issue by handling the error +and disabling the widget in the "Events" tab. +--- + gfw/frontend_gtk.py | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/gfw/frontend_gtk.py b/gfw/frontend_gtk.py +index 75ebb33..75dfde0 100644 +--- a/gfw/frontend_gtk.py ++++ b/gfw/frontend_gtk.py +@@ -33,14 +33,21 @@ from gfw.frontend import Frontend + + class Notifier(gfw.event.Notifier): + +- def __init__(self, callback): +- gfw.event.Notifier.__init__(self, callback) ++ def __init__(self, callback, inactive_handler): ++ self._active = False ++ try: ++ gfw.event.Notifier.__init__(self, callback) ++ except IOError: ++ inactive_handler() ++ return ++ self._active = True + self._w = gobject.io_add_watch(self._fd, gobject.IO_IN | gobject.IO_PRI, + self._trigger) + + def __del__(self): +- gfw.event.Notifier.__del__(self) +- gobject.source_remove(self._w) ++ if self._active: ++ gfw.event.Notifier.__del__(self) ++ gobject.source_remove(self._w) + + + class Builder(gtk.Builder): +@@ -90,7 +97,8 @@ class GtkFrontend(Frontend): + data = (timestamp, event, conn['IN'], conn['OUT'], conn['PROTO'], + conn['SRC'], spt, conn['DST'], dpt) + self.ui.events_model.append(data) +- self._notifier = Notifier(callback) ++ self._notifier = Notifier(callback, ++ lambda: self.ui.events_view.set_sensitive(False)) + self.ui.main_window.show_all() + ## FIXME: for the 0.3.0 release, hide the tab for the connections view + page = self.ui.view.get_nth_page(2) +-- +1.9.0 + diff --git a/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r2.ebuild b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r2.ebuild new file mode 100644 index 000000000000..5b9f7b176a1f --- /dev/null +++ b/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r2.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw-frontends/ufw-frontends-0.3.2-r2.ebuild,v 1.1 2014/03/29 14:09:00 hwoarang Exp $ + +EAPI=5 +PYTHON_COMPAT=( python2_6 python2_7 ) +inherit distutils-r1 + +DESCRIPTION="Provides graphical frontend to ufw" +HOMEPAGE="http://code.google.com/p/ufw-frontends/" +SRC_URI="http://ufw-frontends.googlecode.com/files/${P}.tar.gz" + +# CC-BY-NC-SA-3.0 is for a png file +LICENSE="GPL-3 CC-BY-NC-SA-3.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="kde policykit" + +DEPEND="" +RDEPEND="${DEPEND} + dev-python/pygobject:2[${PYTHON_USEDEP}] + dev-python/pygtk[${PYTHON_USEDEP}] + dev-python/pyinotify[${PYTHON_USEDEP}] + net-firewall/ufw + !policykit? ( + kde? ( kde-base/kdesu ) ) + policykit? ( sys-auth/polkit ) +" + +python_prepare_all() { + if use policykit; then + sed -i 's/^Exec=su-to-root -X -c/Exec=pkexec/' \ + share/ufw-gtk.desktop || die + elif use kde; then + sed -i 's/^Exec=su-to-root -X -c/Exec=kdesu/' \ + share/ufw-gtk.desktop || die + fi + + # don't try to override run() to install the script + # under /usr/sbin; it does not work with distutils-r1 + # and so it is handled differently (in python_install) + sed -i '/cmdclass=/d' setup.py || die + + # Qt version is unusable + rm gfw/frontend_qt.py || die + distutils-r1_python_prepare_all + + # fix crash when no ufw logs in supported locations can + # be found + epatch "${FILESDIR}/${P}-no-log-crash.patch" +} + +python_install() { + distutils-r1_python_install --install-scripts="/usr/sbin" +} + +python_install_all() { + distutils-r1_python_install_all + + if use policykit; then + insinto /usr/share/polkit-1/actions/ + doins "${FILESDIR}"/org.gentoo.pkexec.ufw-gtk.policy + elif ! use kde; then + rm "${D}usr/share/applications/ufw-gtk.desktop" || die + fi +} |