--- setup.py 2004-06-14 18:04:11.000000000 -0400
+++ setup.py.new 2006-12-27 20:28:20.000000000 -0500
@@ -16,14 +16,6 @@
os.chdir ('%s/translations' % (curdir))
os.system ('./update-translations.sh')
- pipe = os.popen ('./list-mos.sh')
- while True:
- line = pipe.readline ().strip ()
- if line == '':
- break
- data.append (('share/locale/%s/LC_MESSAGES' % (line), ['translations/%s/galternatives.mo' % (line)]))
- pipe.close ()
- print data
os.chdir (curdir)
if __name__ == '__main__' :
--- galternatives/main.py 2005-08-17 21:21:04.000000000 -0400
+++ galternatives/main.py.new 2006-12-27 22:30:19.000000000 -0500
@@ -1,8 +1,11 @@
#!/usr/bin/python
import pygtk
pygtk.require ('2.0')
-import gtk, gobject
-from gtk import glade
+try:
+ import gtk, gobject
+ from gtk import glade
+except RuntimeError:
+ pass
from common import PACKAGE
import sys, os, gettext
--- galternatives/alternative.py 2004-11-21 23:02:33.000000000 -0500
+++ galternatives/alternative.py.new 2005-11-10 01:00:25.000000000 -0500
@@ -64,7 +64,7 @@
pass
# now get the real information!
- altfile = open ('/var/lib/dpkg/alternatives/%s' % (unixname))
+ altfile = open ('/var/lib/alternatives/%s' % (unixname))
# parsing file
self.option_status = altfile.readline ().strip ()
@@ -99,7 +99,18 @@
odict = {}
odict['path'] = line
- odict['priority'] = altfile.readline ().strip ()
+
+ # Here is an altercation to the upstream code to cater for the
+ # Redhat specific --initscript option
+ line = altfile.readline ().strip ()
+ ls = line.split()
+ if len(ls) == 2:
+ odict['priority'] = ls[0]
+ odict['service'] = ls[1]
+ else:
+ odict['priority'] = line
+ odict['service'] = ''
+
print_debug (odict)
optslaves = []
for count in range(len (self.slaves)):
--- galternatives/main.py 2005-08-17 21:21:04.000000000 -0400
+++ galternatives/main.py.new 2005-11-10 01:01:12.000000000 -0500
@@ -282,8 +282,16 @@
alt = self.alternative
unixname = alt.get_unixname ()
option = self.options_model.get_value (iter, self.OPTIONS)
+ # Here is an altercation to the upstream code to cater for the
+ # Redhat specific --initscript option
+ for opt in alt.get_options ():
+ inits = opt['service']
- result = os.system ('/usr/sbin/update-alternatives --set %s %s > /dev/null 2>&1' % (unixname, option))
+ if inits == '':
+ result = os.system ('/usr/sbin/update-alternatives --set %s %s > /dev/null 2>&1' % (unixname, option))
+ else:
+ result = os.system ('/usr/sbin/update-alternatives --set %s %s > /dev/null 2>&1' % (unixname, option))
+ result2 = os.system ('/sbin/chkconfig %s on > /dev/null 2>&1' % (inits))
print_debug ('/usr/sbin/update-alternatives --set %s %s > /dev/null 2>&1' % (unixname, option))
print_debug ('Result: %d' % (result))
@@ -347,7 +353,7 @@
text=self.SLAVEPATH)
self.slaves_tv.append_column (column)
- def update_alternatives (self, directory='/var/lib/dpkg/alternatives/'):
+ def update_alternatives (self, directory='/var/lib/alternatives/'):
self.alternatives_model.clear ()
alternatives = os.listdir (directory)
alternatives.sort ()