From d7a622545bfa88a1ddf4258a7d6a5eda301db1be Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:34 +0800 Subject: [PATCH 01/14] Debian patch: 03-fix_typo_wicd-cli.patch --- cli/wicd-cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/wicd-cli.py b/cli/wicd-cli.py index 2087e5c..a7be3d7 100644 --- a/cli/wicd-cli.py +++ b/cli/wicd-cli.py @@ -143,7 +143,7 @@ if options.network_details: # network properties if options.network_property: - options.network_property = option.network_property.lower() + options.network_property = options.network_property.lower() if options.wireless: if options.network >= 0: is_valid_wireless_network_id(options.network) From 72b794df96f3c6d032f13dd8b11361f02add84ac Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:34 +0800 Subject: [PATCH 02/14] Debian patch: 05-use_binsh.patch --- in/scripts=wicd-client.in | 2 +- in/scripts=wicd-curses.in | 2 +- in/scripts=wicd.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/in/scripts=wicd-client.in b/in/scripts=wicd-client.in index 54a55ff..db6214d 100755 --- a/in/scripts=wicd-client.in +++ b/in/scripts=wicd-client.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh BOLD=$(tput bold) BLUE=$(tput setaf 4) NC=$(tput sgr0) diff --git a/in/scripts=wicd-curses.in b/in/scripts=wicd-curses.in index 45fc544..d70d9d0 100755 --- a/in/scripts=wicd-curses.in +++ b/in/scripts=wicd-curses.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ ! -d "$HOME/.wicd" ]; then mkdir -p "$HOME/.wicd" fi diff --git a/in/scripts=wicd.in b/in/scripts=wicd.in index c8abe3e..3206f2b 100755 --- a/in/scripts=wicd.in +++ b/in/scripts=wicd.in @@ -1,3 +1,3 @@ -#!/bin/bash +#!/bin/sh exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@ From 930b7dc57bb9069b1960b2c538c18bb6773f0573 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:35 +0800 Subject: [PATCH 03/14] Debian patch: 06-dont_bomb_out_on_configparser_error.patch --- wicd/configmanager.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 430cbb5..0dee326 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -26,7 +26,7 @@ reusable for other purposes as well. import os, copy -from ConfigParser import RawConfigParser +from ConfigParser import RawConfigParser, ParsingError from wicd.misc import Noneify, to_unicode @@ -39,8 +39,17 @@ class ConfigManager(RawConfigParser): self.config_file = path self.debug = debug self.mrk_ws = mark_whitespace - self.read(path) - + try: + self.read(path) + except ParsingError, e: + self.write() + try: + self.read(path) + except ParsingError, p: + import sys + print "Could not start wicd: %s" % p.message + sys.exit(1) + def __repr__(self): return self.config_file From 77f83875ff3b3fd07e28541480fe6dfaeb98c509 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:35 +0800 Subject: [PATCH 04/14] Debian patch: 08-fix_help_message.patch --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index c088ee9..d32b19d 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1026,7 +1026,7 @@ setup_dbus() ######################################## if __name__ == '__main__': try: - parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) + parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello()), prog="wicd-curses") except Exception, e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m') From 08d01d87cb74c78df20d151806a64606ede82761 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:35 +0800 Subject: [PATCH 05/14] Debian patch: 11-fix_gui_showing_from_tray.patch --- gtk/gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gui.py b/gtk/gui.py index 2e52d1c..b5c341d 100644 --- a/gtk/gui.py +++ b/gtk/gui.py @@ -791,6 +791,7 @@ class appGui(object): """ self.window.present() + self.window.deiconify() self.wait_for_events() self.is_visible = True daemon.SetGUIOpen(True) From ec650ac2a36ab772d0d946e651400b5e1aa46a07 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:36 +0800 Subject: [PATCH 06/14] Debian patch: 18-dont_run_unexpected_files_in_scripts.patch --- wicd/misc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicd/misc.py b/wicd/misc.py index a358add..da42782 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -186,6 +186,8 @@ def ExecuteScripts(scripts_dir, verbose=False, extra_parameters=()): if not os.path.exists(scripts_dir): return for obj in sorted(os.listdir(scripts_dir)): + if obj.startswith(".") or obj.endswith(("~", ".new", ".orig")): + continue obj = os.path.abspath(os.path.join(scripts_dir, obj)) if os.path.isfile(obj) and os.access(obj, os.X_OK): ExecuteScript(os.path.abspath(obj), verbose=verbose, From 1548ff463da000b91881d7b87a32abb61537eb1c Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:36 +0800 Subject: [PATCH 07/14] Debian patch: 21-fix_ESSID_setting.patch --- wicd/wnettools.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 6ab4ebf..b1d4dbb 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -1088,9 +1088,7 @@ class BaseWirelessInterface(BaseInterface): bssid -- bssid of the network """ - cmd = ['iwconfig', self.iface, 'essid', essid] - if self.verbose: print str(cmd) - misc.Run(cmd) + self.SetEssid(essid) base = "iwconfig %s" % self.iface if channel and str(channel).isdigit(): cmd = "%s channel %s" % (base, str(channel)) From e4a5452342459442b02ab56b738eab3968a8f840 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:37 +0800 Subject: [PATCH 08/14] Debian patch: 22-fix_deprecation.patch --- gtk/gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gui.py b/gtk/gui.py index b5c341d..9027f2b 100644 --- a/gtk/gui.py +++ b/gtk/gui.py @@ -429,7 +429,7 @@ class appGui(object): gobject.idle_add(self.all_network_list.set_sensitive, True) gobject.idle_add(self.status_area.hide_all) if self.statusID: - gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.status_bar.remove_message, 1, self.statusID) def set_connecting_state(self, info): if not self.connecting: @@ -444,7 +444,7 @@ class appGui(object): gobject.idle_add(self.all_network_list.set_sensitive, False) gobject.idle_add(self.status_area.show_all) if self.statusID: - gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.status_bar.remove_message, 1, self.statusID) if info[0] == "wireless": gobject.idle_add(self.set_status, str(info[1]) + ': ' + language[str(wireless.CheckWirelessConnectingMessage())]) @@ -700,7 +700,7 @@ class appGui(object): cancel_button.set_sensitive(True) self.all_network_list.set_sensitive(False) if self.statusID: - gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.status_bar.remove_message, 1, self.statusID) gobject.idle_add(self.set_status, language["disconnecting_active"]) gobject.idle_add(self.status_area.show_all) self.wait_for_events() From b48c24a215975b378e8172bbe929f942e9562861 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:37 +0800 Subject: [PATCH 09/14] Debian patch: 24-wait_for_DHCP_client.patch --- wicd/wnettools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index b1d4dbb..656a91e 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -619,6 +619,7 @@ class BaseInterface(object): else: print "ERROR: no dhcp client found" ret = None + self.dhcp_object.wait() return ret @neediface(False) From 3d3fa8d6a0b5b2d583bf7ad625c7d28ac80a8e1a Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:38 +0800 Subject: [PATCH 10/14] Debian patch: 27-fix_resolv.conf_perms.patch --- wicd/wicd-daemon.py | 4 ++++ wicd/wnettools.py | 1 + 2 files changed, 5 insertions(+) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index b528901..c4a28e7 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -948,12 +948,14 @@ class WicdDaemon(dbus.service.Object): os.chmod(app_conf.get_config(), 0600) os.chmod(wireless_conf, 0600) os.chmod(wired_conf, 0600) + os.chmod(dhclient_conf, 0644) # Make root own them print "chowning configuration files root:root..." os.chown(app_conf.get_config(), 0, 0) os.chown(wireless_conf, 0, 0) os.chown(wired_conf, 0, 0) + os.chown(dhclient_conf, 0, 0) print "Using wireless interface..." + self.GetWirelessInterface() print "Using wired interface..." + self.GetWiredInterface() @@ -1702,6 +1704,7 @@ def main(argv): # wicd exploded if not os.path.exists(backup_location): shutil.copy2('/etc/resolv.conf', backup_location) + os.chmod(backup_location, 0644) except IOError: print 'error backing up resolv.conf' @@ -1748,6 +1751,7 @@ def main(argv): # restore resolv.conf on quit try: shutil.move(wpath.varlib + 'resolv.conf.orig', '/etc/resolv.conf') + os.chmod('/etc/resolv.conf', 0644) except IOError: print 'error restoring resolv.conf' diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 656a91e..4d6d80e 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -325,6 +325,7 @@ class BaseInterface(object): output_conf.close() dhclient_template.close() + os.chmod(dhclient_conf_path, 0644) if not client_name or not cmd: print "WARNING: Failed to find a valid dhcp client!" From 70a4518ab07a3f7b959099d924010902971ef9af Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:38 +0800 Subject: [PATCH 11/14] Debian patch: 28-announce_dhclient.conf.template.patch --- in/man=wicd.8.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/in/man=wicd.8.in b/in/man=wicd.8.in index 11aa43b..b635e40 100644 --- a/in/man=wicd.8.in +++ b/in/man=wicd.8.in @@ -118,6 +118,12 @@ This file contains settings related to the wireless interface. .br See this file's own man page for more information about it. +.B %ETC%dhclient.conf.template +.br +This is used to replace /etc/dhclient.conf during Wicd activity, +if you're using dhclient(1) as DHCP client. See dhclient.conf(5) +for more information. + .B %ENCRYPTION% .br This directory contains various templates for encrypted (WEP, WPA, etcetera) @@ -156,6 +162,7 @@ log if you are having connection or other problems. .BR wicd-manager-settings.conf (5), .BR wicd-wired-settings.conf (5), .BR wicd-wireless-settings.conf (5), +.BR dhclient.conf (5), .BR wicd-curses (8), .BR ifconfig (8), .BR iwconfig (8), From f463fab451babca434ff38e26404cc8c5f6dd31f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:39 +0800 Subject: [PATCH 12/14] Debian patch: 29-document_variables_passed_to_scripts.patch --- in/man=wicd.8.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/in/man=wicd.8.in b/in/man=wicd.8.in index b635e40..be25f98 100644 --- a/in/man=wicd.8.in +++ b/in/man=wicd.8.in @@ -138,6 +138,12 @@ when the specified event is preformed upon connection or disconnect from or to any network. Please note that pre/post disconnect scripts may be executed multiple times on already-disconnected interfaces. .br +The scripts will be passed different parameters, depending if Wicd is +acting on a wired or a wireless network. In the former case, "wired +wired wired" will be passed (three times, just for compatibility with +the wireless case). If Wicd is acting on a wireless network, it will +pass "wireless ESSID BSSID" to the script. +.br Available directories are: .br %SCRIPTS%predisconnect From dbe4bcf395ffca86add5a31e3d5a339a6e79b2cb Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:39 +0800 Subject: [PATCH 13/14] Debian patch: 30-make_connection_info_selectable.patch --- gtk/wicd-client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/wicd-client.py b/gtk/wicd-client.py index 128c75d..52f67f6 100644 --- a/gtk/wicd-client.py +++ b/gtk/wicd-client.py @@ -550,6 +550,7 @@ class TrayIcon(object): # Create labels self.label = gtk.Label() self.data = gtk.Label() + self.data.set_selectable(True) self.label.show() self.data.show() self.list = [] From 4871474859f39c12673ec8f51cc062af07cf9886 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 29 May 2010 17:32:40 +0800 Subject: [PATCH 14/14] Debian patch: xx-get_translations.patch --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e97ea6e..2234dac 100644 --- a/setup.py +++ b/setup.py @@ -436,7 +436,10 @@ class get_translations(Command): import urllib, shutil if os.path.exists('translations'): shutil.rmtree('translations/') + if os.path.exists('po'): + shutil.rmtree('po/') os.makedirs('translations') + os.makedirs('po') filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/') id_file = open(filename, 'r') lines = id_file.readlines() @@ -452,11 +455,10 @@ class get_translations(Command): except: print >> sys.stderr, 'error downloading language %s' % id else: - shutil.move(pofile, lang_identifier+'.po') + shutil.move(pofile, 'po/'+lang_identifier+'.po') os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES') os.system('msgfmt --output-file=translations/' + lang_identifier + - '/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po') - os.remove(lang_identifier+'.po') + '/LC_MESSAGES/wicd.mo po/' + lang_identifier + '.po') class uninstall(Command):