Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
David Cantrell
4ed1559ef6 Initialize appGui._wired_showing in __init__ (#731163) 2011-08-19 14:57:41 -04:00
David Cantrell
a149b229e9 Actually apply the D-Bus connection failure patch (#713109) 2011-08-09 21:01:11 -04:00
David Cantrell
88b1811c74 Catch D-Bus connection failures and prevent abrt reporting (#713109) 2011-08-05 11:14:53 -04:00
David Cantrell
5484559175 - Use cPickle instead of deepcopy in configmanager.py (#645251) 2010-10-22 10:37:17 -10:00
David Cantrell
d45f6383c4 Remove hard dependency on the base package by wicd-common.
Remove hard dependency on the base package by wicd-common.  The
base package is arch-specific and contains optional components
for wicd.  If it is present, wicd will make use of it, but it is
not required for normal functionality.
2010-08-25 06:34:32 -10:00
d4516944cb - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild 2010-07-31 02:53:34 +02:00
4 changed files with 148 additions and 5 deletions

View file

@ -0,0 +1,50 @@
diff -up wicd-1.7.0/cli/wicd-cli.py.orig wicd-1.7.0/cli/wicd-cli.py
--- wicd-1.7.0/cli/wicd-cli.py.orig 2010-01-14 23:49:11.000000000 -0500
+++ wicd-1.7.0/cli/wicd-cli.py 2011-08-05 11:09:57.561058338 -0400
@@ -43,6 +43,10 @@ except dbus.DBusException:
print 'Error: Could not connect to the daemon. Please make sure it is running.'
sys.exit(3)
+if daemon is None:
+ print 'Error connecting to wicd via D-Bus. Please make sure the wicd service is running.'
+ sys.exit(3)
+
parser = optparse.OptionParser()
parser.add_option('--network', '-n', type='int', default=-1)
diff -up wicd-1.7.0/curses/wicd-curses.py.orig wicd-1.7.0/curses/wicd-curses.py
--- wicd-1.7.0/curses/wicd-curses.py.orig 2010-01-14 23:49:11.000000000 -0500
+++ wicd-1.7.0/curses/wicd-curses.py 2011-08-05 11:09:00.248056606 -0400
@@ -1016,6 +1016,10 @@ def setup_dbus(force=True):
wireless = dbus_ifaces['wireless']
wired = dbus_ifaces['wired']
+ if daemon is None:
+ print 'Error connecting to wicd via D-Bus. Please make sure the wicd service is running.'
+ sys.exit(3)
+
netentry_curses.dbus_init(dbus_ifaces)
return True
diff -up wicd-1.7.0/gtk/gui.py.orig wicd-1.7.0/gtk/gui.py
--- wicd-1.7.0/gtk/gui.py.orig 2010-01-14 23:49:11.000000000 -0500
+++ wicd-1.7.0/gtk/gui.py 2011-08-05 10:49:08.392177338 -0400
@@ -146,6 +146,17 @@ class appGui(object):
""" Initializes everything needed for the GUI. """
setup_dbus()
+ if daemon is None:
+ errmsg = "Error connecting to wicd service via D-Bus." + \
+ "Please ensure the wicd service is running."
+ d = gtk.MessageDialog(parent=None,
+ flags=gtk.DIALOG_MODAL,
+ type=gtk.MESSAGE_ERROR,
+ buttons=gtk.BUTTONS_OK,
+ message_format=errmsg)
+ d.run()
+ sys.exit(1)
+
self.tray = tray
gladefile = os.path.join(wpath.gtk, "wicd.glade")
diff -up wicd-1.7.0/gtk/wicd-client.py.orig wicd-1.7.0/gtk/wicd-client.py

50
wicd-1.7.0-deepcopy.patch Normal file
View file

@ -0,0 +1,50 @@
diff -up wicd-1.7.0/wicd/configmanager.py.deepcopy wicd-1.7.0/wicd/configmanager.py
--- wicd-1.7.0/wicd/configmanager.py.deepcopy 2010-01-14 18:49:11.000000000 -1000
+++ wicd-1.7.0/wicd/configmanager.py 2010-10-22 10:18:14.000000000 -1000
@@ -25,6 +25,7 @@ reusable for other purposes as well.
#
import os, copy
+import cPickle
from ConfigParser import RawConfigParser
@@ -35,7 +36,7 @@ from dbus import Int32
class ConfigManager(RawConfigParser):
""" A class that can be used to manage a given configuration file. """
def __init__(self, path, debug=False, mark_whitespace="`'`"):
- RawConfigParser.__init__(self)
+ RawConfigParser.__init__(self, allow_no_value = True)
self.config_file = path
self.debug = debug
self.mrk_ws = mark_whitespace
@@ -67,7 +68,7 @@ class ConfigManager(RawConfigParser):
if value.startswith(' ') or value.endswith(' '):
value = "%(ws)s%(value)s%(ws)s" % {"value" : value,
"ws" : self.mrk_ws}
- RawConfigParser.set(self, section, str(option), value)
+ RawConfigParser.set(self, section, str(option), "None" if value is None else value)
if write:
self.write()
@@ -176,9 +177,7 @@ class ConfigManager(RawConfigParser):
def _copy_section(self, name):
- # Yes, deepcopy sucks, but it is robust to changes in both
- # this class and RawConfigParser.
- p = copy.deepcopy(self)
+ p = cPickle.loads(cPickle.dumps(self, -1))
for sname in p.sections():
if sname != name:
p.remove_section(sname)
@@ -188,8 +187,7 @@ class ConfigManager(RawConfigParser):
def write(self):
""" Writes the loaded config file to disk. """
- # Really don't like this deepcopy.
- p = copy.deepcopy(self)
+ p = cPickle.loads(cPickle.dumps(self, -1))
for sname in p.sections():
fname = p.get_option(sname, '_filename_')
if fname and fname != self.config_file:

View file

@ -0,0 +1,11 @@
diff -up wicd-1.7.0/gtk/gui.py.orig wicd-1.7.0/gtk/gui.py
--- wicd-1.7.0/gtk/gui.py.orig 2011-08-19 14:53:37.667180427 -0400
+++ wicd-1.7.0/gtk/gui.py 2011-08-19 14:55:43.657056952 -0400
@@ -220,6 +220,7 @@ class appGui(object):
self.refreshing = False
self.prev_state = None
self.update_cb = None
+ self._wired_showing = False
self.network_list.set_sensitive(False)
label = gtk.Label("%s..." % language['scanning'])
self.network_list.pack_start(label)

View file

@ -7,7 +7,7 @@
Name: wicd
Version: 1.7.0
Release: 1%{?dist}
Release: 7%{?dist}
Summary: Wireless and wired network connection manager
Group: System Environment/Base
@ -17,13 +17,16 @@ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.ta
Source1: wicd.logrotate
Patch0: wicd-1.7.0-remove-WHEREAREMYFILES.patch
Patch1: wicd-1.7.0-initscript.patch
Patch2: wicd-1.7.0-deepcopy.patch
Patch3: wicd-1.7.0-dbus-failure.patch
Patch4: wicd-1.7.0-wired_showing.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
BuildRequires: python2-devel
BuildRequires: desktop-file-utils
Requires: pm-utils >= 1.2.4
Requires: wicd-common = %{version}-%{release}
Requires: %{name}-common = %{version}-%{release}
%description
Wicd is designed to give the user as much control over behavior of network
@ -47,7 +50,6 @@ Requires: logrotate
Requires: net-tools
Requires: wireless-tools
Requires: wpa_supplicant
Requires: %{name} = %{version}-%{release}
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
@ -60,7 +62,7 @@ This package provides the main wicd daemon and the wicd-cli front-end.
Summary: Curses client for wicd
Group: Applications/System
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: %{name}-common = %{version}-%{release}
Requires: python-urwid >= 0.9.8.3
%description curses
@ -70,7 +72,7 @@ Client program for wicd that uses a curses interface.
Summary: GTK+ client for wicd
Group: Applications/Internet
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: %{name}-common = %{version}-%{release}
Requires: pygtk2-libglade >= 2.10
%description gtk
@ -88,6 +90,15 @@ Client program for wicd that uses a GTK+ interface.
# Reported upstream: https://bugs.launchpad.net/wicd/+bug/587690
%patch1 -p1
# Use cPickle instead of deepcopy in configmanager.py
%patch2 -p1
# Handle D-Bus connection failures a little better
%patch3 -p1
# Initialize appGui._wired_showing in __init__
%patch4 -p1
%build
# NOTE: --etc is where dhclient.conf.template goes
%{__python} setup.py configure \
@ -253,5 +264,26 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_datadir}/icons/hicolor/scalable/apps/wicd-gtk.svg
%changelog
* Fri Aug 19 2011 David Cantrell <dcantrell@redhat.com> - 1.7.0-7
- Initialize appGui._wired_showing in __init__ (#731163)
* Tue Aug 09 2011 David Cantrell <dcantrell@redhat.com> - 1.7.0-6
- Actually apply the D-Bus connection failure patch (#713109)
* Fri Aug 05 2011 David Cantrell <dcantrell@redhat.com> - 1.7.0-5
- Catch D-Bus connection failures and prevent abrt reporting (#713109)
* Fri Oct 22 2010 David Cantrell <dcantrell@redhat.com> - 1.7.0-4
- Use cPickle instead of deepcopy in configmanager.py (#645251)
* Wed Aug 25 2010 David Cantrell <dcantrell@redhat.com> - 1.7.0-3
- Remove hard dependency on the base package by wicd-common. The
base package is arch-specific and contains optional components
for wicd. If it is present, wicd will make use of it, but it is
not required for normal functionality.
* Fri Jul 30 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Mon Jun 21 2010 David Cantrell <dcantrell@redhat.com> - 1.7.0-1
- Initial package