SCons build:
Changed the way, distribution archives are build: - env.ExtraDist() names the file to be distributed, no matter if they are generated. - For automatically collecting the sources, env.DistSourcesOf() is used now. git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@407 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
parent
65438ac13a
commit
22240a9365
10
SConscript
10
SConscript
|
@ -11,11 +11,9 @@ env.AddPostAction([cronfile, rcfile], Chmod('$TARGETS', 0755))
|
|||
|
||||
env.Alias('install', [
|
||||
env.Install('$docdir', Split('COPYING NEWS README AUTHORS')),
|
||||
#env.InstallAs('$sysconfdir/init.d/capisuite', rcfile),
|
||||
#env.InstallAs('$sysconfdir/cron.daily/capisuite', cronfile),
|
||||
#env.InstallAs('$pkgsysconfdir/cronjob.conf','cronjob.conf'),
|
||||
])
|
||||
|
||||
# Since these are not installed, we need to list them for
|
||||
# distribuition explicitly
|
||||
env.ExtraDist([cronfile, rcfile, 'cronjob.conf'])
|
||||
# Since these are not installed, we need to list explicitly
|
||||
# them for distribuition
|
||||
env.DistSourcesOf([cronfile, rcfile])
|
||||
env.ExtraDist('cronjob.conf')
|
||||
|
|
35
SConstruct
35
SConstruct
|
@ -87,15 +87,31 @@ class InstallableEnv(Environment):
|
|||
"""Install specified files in the given directory."""
|
||||
dir = self.arg2nodes(dir, self.BasedDir)
|
||||
files = Environment.Install(self, dir, source)
|
||||
env.ExtraDist(files)
|
||||
#self.SourceDist(files)
|
||||
self.DistSourcesOf(files)
|
||||
return files
|
||||
|
||||
def InstallAs(self, target, source):
|
||||
"""Install sources as targets."""
|
||||
target = self.arg2nodes(target, self.BasedFile)
|
||||
files = Environment.InstallAs(self, target, source)
|
||||
self.ExtraDist(files)
|
||||
self.DistSourcesOf(files)
|
||||
return files
|
||||
|
||||
def DistSourcesOf(self, files):
|
||||
"""
|
||||
Add all sourcefiles of the given files to the distribution archive.
|
||||
"""
|
||||
files = self.arg2nodes(files, self.File)
|
||||
files = map(self.DistSourceOfFile, files)
|
||||
#self.DistTar('$DIST_ARCHIVE', files)
|
||||
self.Append(DIST_FILES=files)
|
||||
return files
|
||||
|
||||
def ExtraDist(self, files):
|
||||
"""Additional files to be distributed."""
|
||||
files = self.arg2nodes(files, self.File)
|
||||
#self.DistTar('$DIST_ARCHIVE', files)
|
||||
self.Append(DIST_FILES=files)
|
||||
return files
|
||||
|
||||
_valid_man_extensions = '0123456789ln' # from info automake
|
||||
|
@ -126,11 +142,6 @@ class InstallableEnv(Environment):
|
|||
result.extend(res)
|
||||
return result
|
||||
|
||||
def ExtraDist(self, files):
|
||||
"""Collect Additional files to be distributed."""
|
||||
files = self.arg2nodes(files, self.File)
|
||||
env.Append(__SOURCES=files)
|
||||
|
||||
#
|
||||
# Support functions for linking with Python
|
||||
#
|
||||
|
@ -257,8 +268,9 @@ env = InstallableEnv(tools=Split('default sourcetar filesubst'),
|
|||
spooldir = '${localstatedir}/spool/${PACKAGE}',
|
||||
docdir = '${pkgdatadir}/doc/${PACKAGE}',
|
||||
|
||||
# required for ExtraDist
|
||||
__SOURCES = [],
|
||||
# Distribution of files and sources:
|
||||
DIST_ARCHIVE = '#/dist/${PACKAGE}-${VERSION}.tar.gz',
|
||||
DIST_FILES = [],
|
||||
|
||||
# used for distcheck
|
||||
SCONS = 'scons',
|
||||
|
@ -439,8 +451,7 @@ env.Alias('install', env.Alias('install-man'))
|
|||
# 'Dist' target
|
||||
#
|
||||
if is_dist or 'rpms' in COMMAND_LINE_TARGETS:
|
||||
dist = env.DistTar('#/dist/${PACKAGE}-${VERSION}.tar.gz', env['__SOURCES'],
|
||||
TARFLAGS='-c -z')[0]
|
||||
dist = env.DistTar('$DIST_ARCHIVE', env['DIST_FILES'])[0]
|
||||
|
||||
###---####---###---####---###---####---###---####---###---####---###---###
|
||||
#
|
||||
|
|
|
@ -5,7 +5,7 @@ Import('env')
|
|||
specs = []
|
||||
for f in Split('capisuite-mdk-9.2.spec'):
|
||||
#env.ExtraDist(File(f, Dir('.')))
|
||||
env.ExtraDist(f)
|
||||
env.DistSourcesOf(f)
|
||||
specs.append(env.FileSubst(f, '%s.in' % f))
|
||||
|
||||
#env.ExtraDist(specs)
|
||||
|
|
|
@ -5,26 +5,32 @@ SCons builder for creating source tars.
|
|||
|
||||
import SCons
|
||||
from SCons.Node.FS import Base
|
||||
from SCons.Node.Python import Value
|
||||
|
||||
class DistSourceOfFile(Value): pass
|
||||
|
||||
def _e_dist(target, source, env):
|
||||
|
||||
def collect_sources(sources, collected, done, dbg=''):
|
||||
def collect_sources(sources, collected, done):
|
||||
for s in sources:
|
||||
if s in done.keys(): continue
|
||||
if done.has_key(s): continue
|
||||
done[s] = None
|
||||
if not s.is_derived(): # this node is not built (nor side-effect)
|
||||
#assert not s.all_children()
|
||||
if isinstance(s, Base) and s.is_under(env.fs.Dir('#')):
|
||||
#print s
|
||||
collected[s] = None
|
||||
else:
|
||||
collect_sources(s.all_children(scan=1), collected,done)
|
||||
return collected
|
||||
collect_sources(s.all_children(scan=1), collected, done)
|
||||
|
||||
def cmp_path(a, b):
|
||||
return cmp(a.get_path(), b.get_path())
|
||||
|
||||
collected = collect_sources(source, {}, {})
|
||||
collected = {}; done = {}
|
||||
for s in source:
|
||||
if isinstance(s, DistSourceOfFile):
|
||||
collect_sources([s.value], collected, done)
|
||||
else:
|
||||
collected[s] = None
|
||||
collected = [ c.srcnode() for c in collected.keys() ]
|
||||
for c in collected:
|
||||
if not c.exists():
|
||||
|
@ -53,13 +59,13 @@ _builder = SCons.Builder.Builder(
|
|||
_builder_dist = SCons.Builder.Builder(
|
||||
action=SCons.Action.Action(DistTar,strfunction=_str_DistTar),
|
||||
emitter = _e_dist,
|
||||
multi = 0,
|
||||
|
||||
multi = 1,
|
||||
)
|
||||
|
||||
def generate(env):
|
||||
env['BUILDERS']['SourceTar'] = _builder
|
||||
env['BUILDERS']['DistTar'] = _builder_dist
|
||||
env.DistSourceOfFile = DistSourceOfFile
|
||||
|
||||
def exists(env):
|
||||
import SCons.Tools.tar
|
||||
|
|
Loading…
Reference in New Issue