1
From: Jonas Smedegaard <dr@jones.dk>
2
Subject: look for wpa_passphrase command at multiple paths
3
Origin: http://git.sugarlabs.org/projects/jhconvert/repos/mainline/blobs/master/patches/0.84/sugar-1137.patch
5
Last-Update: 2009-11-06
6
diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
7
--- a/src/jarabe/desktop/keydialog.py
8
+++ b/src/jarabe/desktop/keydialog.py
12
from gettext import gettext as _
18
@@ -238,8 +238,14 @@ class WPAKeyDialog(KeyDialog):
20
elif len(key) >= 8 and len(key) <= 63:
22
+ if os.path.exists('/usr/sbin/wpa_passphrase'):
23
+ wpa_passphrase = '/usr/sbin/wpa_passphrase'
24
+ elif os.path.exists('/usr/bin/wpa_passphrase'):
25
+ wpa_passphrase = '/usr/bin/wpa_passphrase'
27
+ raise RuntimeError("Can't find wpa_passphrase command")
28
from subprocess import Popen, PIPE
29
- p = Popen(['/usr/sbin/wpa_passphrase', ssid, key], stdout=PIPE)
30
+ p = Popen([wpa_passphrase, ssid, key], stdout=PIPE)
32
if line.strip().startswith("psk="):
33
real_key = line.strip()[4:]