--- /usr/bin/distcc-config 2005-11-21 09:48:25.000000000 -0600 +++ distcc-config 2005-11-21 10:48:31.000000000 -0600 @@ -73,11 +73,10 @@ print 'Configuring',path+file+'...' os.chown(path+file,user,group) -def installlinks(chost=''): +def installlinks(chost): + path = '/usr/lib/distcc/bin/' for file in ['gcc', 'cc', 'c++', 'g++']: - path = '/usr/lib/distcc/bin/' - if not chost == '': - file = chost+'-'+file + file = chost + '-' + file if os.path.exists('/usr/bin/'+file): if verbose: print 'Creating',path+file,'symlink...' @@ -86,6 +85,25 @@ else: if verbose: print 'Already exists. Skipping...' + for file in ['gcc', 'cc', 'c++', 'g++']: + if os.path.exists('/usr/bin/' + file): + if verbose: + print 'Creating',path+file,'wrapper script...' + if os.path.exists(path + file): + if verbose: + print 'File already exists...removing' + os.unlink(path + file) + try: + tmpfile = file + if file == "cc": tmpfile = "gcc" + wrapper = open(path + file, "w") + wrapper.write("#!/bin/bash\n\nexec " + path + chost + "-" + tmpfile + " \"@$\"\n") + wrapper.close() + os.chmod(path + file, 755) + if verbose: + print 'Wrapper script created successfully' + except: + print 'Could not create wrapper!!!' def createdistccdir(dir): if not os.path.exists(dir): @@ -150,9 +168,8 @@ group = foobar[3] if portage.settings.has_key('CHOST'): - chost portage.settings['CHOST']makeconf = open('/etc/make.conf', 'r').read() + chost = portage.settings['CHOST'] print 'Creating symlinks...' - installlinks() installlinks(chost) print 'Checking permissions...'