summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/packaging
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2015-02-26 23:44:19 (GMT)
committerDirk Baechle <dl9obn@darc.de>2015-02-26 23:44:19 (GMT)
commit354388a26c7ff2ed69e4e34f41880e0e1bfb0cb1 (patch)
treee4e8f3ef044c39a930235a39bb7301d35b0300ff /src/engine/SCons/Tool/packaging
parent8447a9187ac80c0a7e980510154542b49577ddaa (diff)
downloadSCons-354388a26c7ff2ed69e4e34f41880e0e1bfb0cb1.zip
SCons-354388a26c7ff2ed69e4e34f41880e0e1bfb0cb1.tar.gz
SCons-354388a26c7ff2ed69e4e34f41880e0e1bfb0cb1.tar.bz2
- switching Node class and NodeInfo/Binfo to using slots
- memoizer subsystem now uses decorators instead of the metaclass approach
Diffstat (limited to 'src/engine/SCons/Tool/packaging')
-rw-r--r--src/engine/SCons/Tool/packaging/__init__.py16
-rw-r--r--src/engine/SCons/Tool/packaging/ipk.py2
-rw-r--r--src/engine/SCons/Tool/packaging/msi.py2
-rw-r--r--src/engine/SCons/Tool/packaging/rpm.py9
4 files changed, 16 insertions, 13 deletions
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