diff options
Diffstat (limited to 'admin/generic.py')
-rw-r--r-- | admin/generic.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/admin/generic.py b/admin/generic.py index b5c8dd5..e0fa6b1 100644 --- a/admin/generic.py +++ b/admin/generic.py @@ -37,7 +37,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ ## Global cache directory ## Put all project files in it so a rm -rf cache will clean up the config - if not env.has_key('CACHEDIR'): + if not 'CACHEDIR' in env: env['CACHEDIR'] = os.getcwd()+'/cache/' if not os.path.isdir(env['CACHEDIR']): os.mkdir(env['CACHEDIR']) @@ -51,7 +51,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ # Special trick for installing rpms ... env['DESTDIR']='' - if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'): + if 'install' in env['TARGS'] and 'DESTDIR' in os.environ: env['DESTDIR']=os.environ['DESTDIR']+'/' print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']) @@ -75,19 +75,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ import SCons.Util # configure the environment if needed - if 'configure' in env['TARGS'] or not env.has_key('ISCONFIGURED'): + if 'configure' in env['TARGS'] or not 'ISCONFIGURED' in env: # be paranoid, unset existing variables - if env.has_key('KDECXXFLAGS'): + if 'KDECXXFLAGS' in env: env.__delitem__('KDECXXFLAGS') - if env.has_key('KDECCFLAGS'): + if 'KDECCFLAGS' in env: env.__delitem__('KDECCFLAGS') - if env.has_key('KDELINKFLAGS'): + if 'KDELINKFLAGS' in env: env.__delitem__('KDELINKFLAGS') - if env.has_key('PREFIX'): + if 'PREFIX' in env: env.__delitem__('PREFIX') - if env.has_key('EXTRAINCLUDES'): + if 'EXTRAINCLUDES' in env: env.__delitem__('EXTRAINCLUDES') - if env.has_key('ISCONFIGURED'): + if 'ISCONFIGURED' in env: env.__delitem__('ISCONFIGURED') if env['ARGS'].get('debug', None): @@ -98,19 +98,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ else: env['KDECXXFLAGS'] = ['-DDEBUG', '-g'] else: - if os.environ.has_key('CXXFLAGS'): + if 'CXXFLAGS' in os.environ: # user-defined flags (gentooers will be elighted) env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] ) env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] ) else: env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG']) - if os.environ.has_key('CFLAGS'): + if 'CFLAGS' in os.environ: env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] ) ## FreeBSD settings (contributed by will at freebsd dot org) if os.uname()[0] == "FreeBSD": - if os.environ.has_key('PTHREAD_LIBS'): + if 'PTHREAD_LIBS' in os.environ: env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) ) else: syspf = os.popen('/sbin/sysctl kern.osreldate') @@ -129,14 +129,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ if env['ARGS'].get('prefix', None): env['PREFIX'] = env['ARGS'].get('prefix', None) print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL) - elif env.has_key('PREFIX'): + elif 'PREFIX' in env: env.__delitem__('PREFIX') # User-specified include paths env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None) if env['ARGS'].get('extraincludes', None): print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL) - elif env.has_key('EXTRAINCLUDES'): + elif 'EXTRAINCLUDES' in env: env.__delitem__('EXTRAINCLUDES') env['ISCONFIGURED']=1 @@ -144,16 +144,16 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ # And finally save the options in the cache opts.Save(cachefile, env) - if env.has_key('KDECXXFLAGS'): + if 'KDECXXFLAGS' in env: env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] ) - if env.has_key('KDECCFLAGS'): + if 'KDECCFLAGS' in env: env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] ) - if env.has_key('KDELINKFLAGS'): + if 'KDELINKFLAGS' in env: env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] ) - if env.has_key('EXTRAINCLUDES'): + if 'EXTRAINCLUDES' in env: incpaths = [] for dir in str(env['EXTRAINCLUDES']).split(':'): incpaths.append( dir ) |