From 5828ee03e92f401fc5d49ad3cd3965bbd697f96d Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 26 Dec 2007 19:48:48 +0000 Subject: [PATCH] account for freebsd path for gtkmozembed --- scripts/deluge | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/scripts/deluge b/scripts/deluge index 978d2b283..09086e583 100755 --- a/scripts/deluge +++ b/scripts/deluge @@ -46,21 +46,31 @@ import deluge._dbus as dbus import deluge.interface import deluge.pref -print "checking for ubuntu..." -if not deluge.common.windows_check(): - if os.WEXITSTATUS(os.system('grep -iq "Ubuntu" /etc/issue')) == 0: - print "found and fixing ubuntu" - if os.environ.get("MOZILLA_FIVE_HOME") != "/usr/lib/firefox": - os.environ["MOZILLA_FIVE_HOME"] = "/usr/lib/firefox" - os.environ["LD_LIBRARY_PATH"] = "/usr/lib/firefox" - os.system("/usr/bin/deluge") - raise SystemExit - parser = OptionParser(usage="%prog [options] [torrents to add]", version=deluge.common.PROGRAM_VERSION) parser.add_option("-c", "--config", dest="config", help="Sets the configuration path") (options, args) = parser.parse_args() +print "checking for ubuntu..." +print options +print args +if not deluge.common.windows_check(): + import platform + if platform.system() == "Linux": # Add this, FreeBSD and other OSs than Linux do not have /etc/issue. + if os.WEXITSTATUS(os.system('grep -iq "Ubuntu" /etc/issue')) == 0: + print "found and fixing ubuntu" + if os.environ.get("MOZILLA_FIVE_HOME") != "/usr/lib/firefox": + os.environ["MOZILLA_FIVE_HOME"] = "/usr/lib/firefox" + os.environ["LD_LIBRARY_PATH"] = "/usr/lib/firefox" + os.system("/usr/bin/deluge %s %s" %(options, args)) + raise SystemExit + elif platform.system() == "FreeBSD": + if os.environ.get("MOZILLA_FIVE_HOME") != "/usr/local/lib/firefox": + os.environ["MOZILLA_FIVE_HOME"] = "/usr/local/lib/firefox" + os.environ["LD_LIBRARY_PATH"] = "/usr/local/lib/firefox" + os.system("/usr/local/bin/deluge %s %s" %(options, args)) + raise SystemExit + if (options.config != None): deluge.common.CONFIG_DIR = options.config