summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-04 11:00:42 +1000
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:25 +1000
commit1883ee6dbc2482a34ce531cec3c1c7e5e85af1e7 (patch)
treeaadeca78d8c2cb90afb691293fa5a1d6d7d15c0f /buildtools
parent3ed6d7e76f9e2936e2d27ceeee8984950ea900a3 (diff)
downloadsamba-1883ee6dbc2482a34ce531cec3c1c7e5e85af1e7.tar.gz
samba-1883ee6dbc2482a34ce531cec3c1c7e5e85af1e7.tar.bz2
samba-1883ee6dbc2482a34ce531cec3c1c7e5e85af1e7.zip
s4-waf: avoid having to run waf configure before waf dist
This should be useful for building tarballs from a clean checkout
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/testwaf.sh1
-rw-r--r--buildtools/wafsamba/samba_dist.py23
2 files changed, 11 insertions, 13 deletions
diff --git a/buildtools/testwaf.sh b/buildtools/testwaf.sh
index 3be5ef96a9..a007bc8611 100755
--- a/buildtools/testwaf.sh
+++ b/buildtools/testwaf.sh
@@ -18,6 +18,7 @@ for d in $tests; do
pushd $d || exit 1
rm -rf bin
type waf
+ waf dist || exit 1
waf configure -C --enable-developer --prefix=$PREFIX || exit 1
time waf build || exit 1
time waf build || exit 1
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py
index eacc7c0534..3663bc0bf5 100644
--- a/buildtools/wafsamba/samba_dist.py
+++ b/buildtools/wafsamba/samba_dist.py
@@ -4,6 +4,8 @@
import Utils, os, sys, tarfile, stat, Scripting
from samba_utils import *
+dist_dirs = None
+
def add_tarfile(tar, fname, abspath):
'''add a file to the tarball'''
tinfo = tar.gettarinfo(name=abspath, arcname=fname)
@@ -17,19 +19,13 @@ def add_tarfile(tar, fname, abspath):
def dist():
-
appname = Utils.g_module.APPNAME
version = Utils.g_module.VERSION
- env = LOAD_ENVIRONMENT()
srcdir = os.path.normpath(os.path.join(os.path.dirname(Utils.g_module.root_path), Utils.g_module.srcdir))
- if not env.DIST_DIRS:
- print('You must use conf.DIST_DIRS() to set which directories to package')
- sys.exit(1)
-
- if not env.GIT:
- print('You need git installed to run waf dist')
+ if not dist_dirs:
+ print('You must use samba_dist.DIST_DIRS() to set which directories to package')
sys.exit(1)
dist_base = '%s-%s' % (appname, version)
@@ -37,14 +33,14 @@ def dist():
tar = tarfile.open(dist_name, 'w:gz')
- for dir in env.DIST_DIRS.split():
+ for dir in dist_dirs.split():
if dir.find(':') != -1:
destdir=dir.split(':')[1]
dir=dir.split(':')[0]
else:
destdir = '.'
absdir = os.path.join(srcdir, dir)
- git_cmd = [ env.GIT, 'ls-files', '--full-name', absdir ]
+ git_cmd = [ 'git', 'ls-files', '--full-name', absdir ]
try:
files = Utils.cmd_output(git_cmd).split()
except:
@@ -65,9 +61,10 @@ def dist():
@conf
-def DIST_DIRS(conf, dirs):
+def DIST_DIRS(dirs):
'''set the directories to package, relative to top srcdir'''
- if not conf.env.DIST_DIRS:
- conf.env.DIST_DIRS = dirs
+ global dist_dirs
+ if not dist_dirs:
+ dist_dirs = dirs
Scripting.dist = dist