1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-22 05:48:03 +01:00

Fixed (I think) the pkg-config and kde-config tests. This needs more

testing though before I'm sure.  Big thanks to "nanotube" for the
  suggestions and code for this.
This commit is contained in:
Robby Workman
2008-12-13 22:06:00 +00:00
parent f6b8b51f15
commit 7c3f9ca5c1

View File

@@ -162,20 +162,33 @@ class configure(Command):
'Please report this warning, along with the name of your ' + \ 'Please report this warning, along with the name of your ' + \
'distribution, to the wicd developers.' 'distribution, to the wicd developers.'
# Decide whether to override the pm-utils file locations # Try to get the pm-utils sleep hooks directory from pkg-config and
# the kde prefix from kde-config
# Don't run these in a shell because it's not needed and because shell
# swallows the OSError we would get if {pkg,kde}-config do not exist
# If we don't get anything from *-config, or it didn't run properly,
# or the path is not a proper absolute path, raise an error
try: try:
pmtemp = subprocess.Popen("pkg-config" + " --variable=pm_sleephooks pm-utils", shell=True, stdout=subprocess.PIPE pmtemp = subprocess.Popen(["pkg-config","--variable=pm_sleephooks","pm-utils"], stdout=subprocess.PIPE)
); returncode = pmtemp.wait() # let it finish, and get the exit code
except: pmutils_candidate = pmtemp.stdout.readline().strip() # read stdout
len(pmtemp.stdout) == 0; if len(pmutils_candidate) == 0 or returncode != 0 or not os.path.isabs(pmutils_candidate):
self.pmutils = pmtemp.stdout.readline().strip(); raise ValueError
else:
self.pmutils = pmutils_candidate
except (OSError, ValueError):
pass # use our default
# Decide whether to override the kde autostart path
try: try:
kdetemp = subprocess.Popen("kde-config" + " --prefix", shell=True, stdout=subprocess.PIPE); kdetemp = subprocess.Popen(["kde-config","--prefix"], stdout=subprocess.PIPE)
except: returncode = kdetemp.wait() # let it finish, and get the exit code
len(kdetemp.stdout) == 0; kdedir_candidate = kdetemp.stdout.readline().strip() # read stdout
self.kdedir = kdetemp.stdout.readline().strip(); if len(kdedir_candidate) == 0 or returncode != 0 or not os.path.isabs(kdedir_candidate):
raise ValueError
else:
self.kdedir = kdedir_candidate
except (OSError, ValueError):
pass # use our default
self.python = '/usr/bin/python' self.python = '/usr/bin/python'
self.pidfile = '/var/run/wicd/wicd.pid' self.pidfile = '/var/run/wicd/wicd.pid'