summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu-system.am2
-rw-r--r--gnu/packages/patches/wicd-bitrate-none-fix.patch24
-rw-r--r--gnu/packages/patches/wicd-get-selected-profile-fix.patch16
-rw-r--r--gnu/packages/wicd.scm4
4 files changed, 45 insertions, 1 deletions
diff --git a/gnu-system.am b/gnu-system.am
index 43ea021536..dc945c9b96 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -659,6 +659,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/vtk-mesa-10.patch			\
   gnu/packages/patches/w3m-fix-compile.patch			\
   gnu/packages/patches/weex-vacopy.patch			\
+  gnu/packages/patches/wicd-bitrate-none-fix.patch		\
+  gnu/packages/patches/wicd-get-selected-profile-fix.patch	\
   gnu/packages/patches/wicd-template-instantiation.patch	\
   gnu/packages/patches/wicd-urwid-1.3.patch			\
   gnu/packages/patches/wmctrl-64-fix.patch			\
diff --git a/gnu/packages/patches/wicd-bitrate-none-fix.patch b/gnu/packages/patches/wicd-bitrate-none-fix.patch
new file mode 100644
index 0000000000..1809b7217d
--- /dev/null
+++ b/gnu/packages/patches/wicd-bitrate-none-fix.patch
@@ -0,0 +1,24 @@
+Fix copied from https://bugs.launchpad.net/wicd/+bug/1432423/comments/1
+
+--- wicd-1.7.3/curses/netentry_curses.py	1969-12-31 19:00:00.000000000 -0500
++++ wicd-1.7.3/curses/netentry_curses.py	2015-08-11 23:26:19.999999649 -0400
+@@ -538,11 +538,16 @@
+         self.bitrates = wireless.GetAvailableBitrates()
+         self.bitrates.append('auto')
+         self.bitrate_combo.set_list(self.bitrates)
++
++        # bitrate property is sometimes None
++        chosen_bitrate = wireless.GetWirelessProperty(networkID, 'bitrate')
++        if chosen_bitrate not in self.bitrates:
++            chosen_bitrate = 'auto'
++
+         self.bitrate_combo.set_focus(
+-            self.bitrates.index(
+-                wireless.GetWirelessProperty(networkID, 'bitrate')
+-            )
++            self.bitrates.index(chosen_bitrate)
+         )
++
+         self.allow_lower_bitrates_chkbox.set_state(
+             to_bool(self.format_entry(networkID, 'allow_lower_bitrates'))
+         )
diff --git a/gnu/packages/patches/wicd-get-selected-profile-fix.patch b/gnu/packages/patches/wicd-get-selected-profile-fix.patch
new file mode 100644
index 0000000000..3042a87308
--- /dev/null
+++ b/gnu/packages/patches/wicd-get-selected-profile-fix.patch
@@ -0,0 +1,16 @@
+Fix copied from https://bugs.launchpad.net/wicd/+bug/1421918/comments/2
+
+--- wicd-1.7.3/curses/wicd-curses.py	2014-12-21 16:57:33 +0000
++++ wicd-1.7.3/curses/wicd-curses.py	2015-02-24 23:41:01 +0000
+@@ -532,7 +532,10 @@
+     def get_selected_profile(self):
+         """Get the selected wired profile"""
+         loc = self.get_focus()[1]
+-        return self.theList[loc]
++        if len(self.theList) > loc:
++            return self.theList[loc]
++        else:
++            return self.theList[-1]
+ 
+ 
+ class AdHocDialog(Dialog2):
diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm
index 908b15e30b..26b1c7d3f9 100644
--- a/gnu/packages/wicd.scm
+++ b/gnu/packages/wicd.scm
@@ -46,7 +46,9 @@
        (sha256
         (base32 "00c4rq753bhg64rv1v9yl834ssq7igyy7cz3swp287b5n5bqiqwi"))
        (patches (map search-patch
-                     '("wicd-urwid-1.3.patch"
+                     '("wicd-bitrate-none-fix.patch"
+                       "wicd-get-selected-profile-fix.patch"
+                       "wicd-urwid-1.3.patch"
                        "wicd-template-instantiation.patch")))))
     (build-system python-build-system)
     (native-inputs `(("gettext" ,gnu-gettext)))