diff options
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/docbook/__init__.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/packaging/__init__.py | 16 | ||||
-rw-r--r-- | src/engine/SCons/Tool/packaging/ipk.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/packaging/msi.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/packaging/rpm.py | 9 | ||||
-rw-r--r-- | src/engine/SCons/Tool/rpm.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Tool/swig.py | 9 |
9 files changed, 32 insertions, 24 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 2621cf9..efd2e33 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -340,7 +340,7 @@ symlinks for the platform we are on""" if version: # here we need the full pathname so the links end up in the right directory - libname = getattr(target[0].attributes, 'shlibpath', target[0].path) + libname = getattr(target[0].attributes, 'shlibpath', target[0].get_internal_path()) if Verbose: print "VerShLib: target lib is = ", libname print "VerShLib: name is = ", target[0].name diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py index 26a1a95..aead43c 100644 --- a/src/engine/SCons/Tool/docbook/__init__.py +++ b/src/engine/SCons/Tool/docbook/__init__.py @@ -448,7 +448,7 @@ def DocbookEpub(env, target, source=None, *args, **kw): Ensure all the resources in the manifest are present in the OEBPS directory. """ hrefs = [] - content_file = os.path.join(source[0].abspath, 'content.opf') + content_file = os.path.join(source[0].get_abspath(), 'content.opf') if not os.path.isfile(content_file): return @@ -491,9 +491,9 @@ def DocbookEpub(env, target, source=None, *args, **kw): for href in hrefs: # If the resource was not already created by DocBook XSL itself, # copy it into the OEBPS folder - referenced_file = os.path.join(source[0].abspath, href) + referenced_file = os.path.join(source[0].get_abspath(), href) if not os.path.exists(referenced_file): - shutil.copy(href, os.path.join(source[0].abspath, href)) + shutil.copy(href, os.path.join(source[0].get_abspath(), href)) # Init list of targets/sources target, source = __extend_targets_sources(target, source) diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index 37af34e..69baa43 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -208,7 +208,7 @@ def embedManifestDllCheck(target, source, env): """Function run by embedManifestDllCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestDllAction if so.""" if env.get('WINDOWS_EMBED_MANIFEST', 0): - manifestSrc = target[0].abspath + '.manifest' + manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): ret = (embedManifestDllAction) ([target[0]],None,env) if ret: @@ -222,7 +222,7 @@ def embedManifestExeCheck(target, source, env): """Function run by embedManifestExeCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestExeAction if so.""" if env.get('WINDOWS_EMBED_MANIFEST', 0): - manifestSrc = target[0].abspath + '.manifest' + manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): ret = (embedManifestExeAction) ([target[0]],None,env) if ret: diff --git a/src/engine/SCons/Tool/packaging/__init__.py b/src/engine/SCons/Tool/packaging/__init__.py index 95311a2..1a979ab 100644 --- a/src/engine/SCons/Tool/packaging/__init__.py +++ b/src/engine/SCons/Tool/packaging/__init__.py @@ -80,7 +80,7 @@ def Tag(env, target, source, *more_tags, **kw_tags): #if not k.startswith('PACKAGING_'): if k[:10] != 'PACKAGING_': k='PACKAGING_'+k - setattr(t, k, v) + t.Tag(k, v) def Package(env, target=None, source=None, **kw): """ Entry point for the package tool. @@ -235,9 +235,11 @@ def copy_attr(f1, f2): #pattrs = [x for x in dir(f1) if not hasattr(f2, x) and\ # x.startswith('PACKAGING_')] copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_' - pattrs = list(filter(copyit, dir(f1))) - for attr in pattrs: - setattr(f2, attr, getattr(f1, attr)) + if f1._tags: + pattrs = list(filter(copyit, f1._tags)) + for attr in pattrs: + f2.Tag(attr, f1.GetTag(attr)) + def putintopackageroot(target, source, env, pkgroot, honor_install_location=1): """ Uses the CopyAs builder to copy all source files to the directory given in pkgroot. @@ -262,9 +264,9 @@ def putintopackageroot(target, source, env, pkgroot, honor_install_location=1): if file.is_under(pkgroot): new_source.append(file) else: - if hasattr(file, 'PACKAGING_INSTALL_LOCATION') and\ + if file.GetTag('PACKAGING_INSTALL_LOCATION') and\ honor_install_location: - new_name=make_path_relative(file.PACKAGING_INSTALL_LOCATION) + new_name=make_path_relative(file.GetTag('PACKAGING_INSTALL_LOCATION')) else: new_name=make_path_relative(file.get_path()) @@ -301,7 +303,7 @@ def stripinstallbuilder(target, source, env): for ss in s.sources: n_source.append(ss) copy_attr(s, ss) - setattr(ss, 'PACKAGING_INSTALL_LOCATION', s.get_path()) + ss.Tag('PACKAGING_INSTALL_LOCATION', s.get_path()) return (target, n_source) diff --git a/src/engine/SCons/Tool/packaging/ipk.py b/src/engine/SCons/Tool/packaging/ipk.py index 6549445..84f4e20 100644 --- a/src/engine/SCons/Tool/packaging/ipk.py +++ b/src/engine/SCons/Tool/packaging/ipk.py @@ -120,7 +120,7 @@ def build_specfiles(source, target, env): return opened_files[needle] except KeyError: file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0] - opened_files[needle]=open(file.abspath, 'w') + opened_files[needle]=open(file.get_abspath(), 'w') return opened_files[needle] control_file=open_file('control', target) diff --git a/src/engine/SCons/Tool/packaging/msi.py b/src/engine/SCons/Tool/packaging/msi.py index fe78c9c..172038f 100644 --- a/src/engine/SCons/Tool/packaging/msi.py +++ b/src/engine/SCons/Tool/packaging/msi.py @@ -189,7 +189,7 @@ def build_wxsfile(target, source, env): """ compiles a .wxs file from the keywords given in env['msi_spec'] and by analyzing the tree of source nodes and their tags. """ - file = open(target[0].abspath, 'w') + file = open(target[0].get_abspath(), 'w') try: # Create a document with the Wix root tag diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py index 2bc3063..656d8fb 100644 --- a/src/engine/SCons/Tool/packaging/rpm.py +++ b/src/engine/SCons/Tool/packaging/rpm.py @@ -130,8 +130,7 @@ def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ - file = open(target[0].abspath, 'w') - str = "" + file = open(target[0].get_abspath(), 'w') try: file.write( build_specfile_header(env) ) @@ -279,7 +278,9 @@ def build_specfile_filesection(spec, files): tags = {} for k in supported_tags.keys(): try: - tags[k]=getattr(file, k) + v = file.GetTag(k) + if v: + tags[k] = v except AttributeError: pass @@ -287,7 +288,7 @@ def build_specfile_filesection(spec, files): str = str + SimpleTagCompiler(supported_tags, mandatory=0).compile( tags ) str = str + ' ' - str = str + file.PACKAGING_INSTALL_LOCATION + str = str + file.GetTag('PACKAGING_INSTALL_LOCATION') str = str + '\n\n' return str diff --git a/src/engine/SCons/Tool/rpm.py b/src/engine/SCons/Tool/rpm.py index 1f6eafe..b7d65a8 100644 --- a/src/engine/SCons/Tool/rpm.py +++ b/src/engine/SCons/Tool/rpm.py @@ -51,11 +51,11 @@ def get_cmd(source, env): if SCons.Util.is_List(source): tar_file_with_included_specfile = source[0] return "%s %s %s"%(env['RPM'], env['RPMFLAGS'], - tar_file_with_included_specfile.abspath ) + tar_file_with_included_specfile.get_abspath() ) def build_rpm(target, source, env): # create a temporary rpm build root. - tmpdir = os.path.join( os.path.dirname( target[0].abspath ), 'rpmtemp' ) + tmpdir = os.path.join( os.path.dirname( target[0].get_abspath() ), 'rpmtemp' ) if os.path.exists(tmpdir): shutil.rmtree(tmpdir) @@ -87,7 +87,7 @@ def build_rpm(target, source, env): expected = os.path.basename(input.get_path()) assert expected == rpm_output, "got %s but expected %s" % (rpm_output, expected) - shutil.copy( output, input.abspath ) + shutil.copy( output, input.get_abspath() ) # cleanup before leaving. diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index f166174..a315182 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -42,6 +42,7 @@ import SCons.Defaults import SCons.Scanner import SCons.Tool import SCons.Util +import SCons.Node SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR') @@ -117,9 +118,13 @@ def _swigEmitter(target, source, env): if outdir: java_files = [os.path.join(outdir, j) for j in java_files] java_files = list(map(env.fs.File, java_files)) + def t_from_s(t, p, s, x): + return t.dir + tsm = SCons.Node._target_from_source_map + tkey = len(tsm) + tsm[tkey] = t_from_s for jf in java_files: - t_from_s = lambda t, p, s, x: t.dir - SCons.Util.AddMethod(jf, t_from_s, 'target_from_source') + jf._func_target_from_source = tkey target.extend(java_files) return (target, source) |