3
# Wrapper script to run Ubiquity as root using the appropriate privilege
4
# escalation method for the frontend.
16
while i < len(sys.argv):
17
if sys.argv[i] == '--desktop':
18
desktop = sys.argv[i + 1]
20
# strip option and argument from newargv
22
elif not sys.argv[i].startswith('-'):
23
frontend = sys.argv[i]
24
newargv.append(sys.argv[i])
28
# no privilege escalation required
32
# Try to detect which frontend will be used by looking for a
35
import ubiquity.frontend
36
frontend_names = ['gtkui', 'kde-ui']
37
for f in frontend_names:
39
imp.find_module(f, ubiquity.frontend.__path__)
45
if frontend == 'gtkui':
48
toexec.extend(['--desktop', desktop])
50
elif frontend == 'kde-ui':
51
toexec = ['kdesu', '--nonewdcop', '--']
55
toexec.append('/usr/lib/ubiquity/bin/ubiquity')
56
toexec.extend(newargv)
58
if 'UBIQUITY_WRAPPER_DEBUG' in os.environ:
59
print >>sys.stderr, toexec
60
os.execvp(toexec[0], toexec)
63
if __name__ == '__main__':