[SCM] Samba Shared Repository - branch master updated
Andrew Tridgell
tridge at samba.org
Sun Apr 11 19:19:20 MDT 2010
The branch, master has been updated
via 98942c8... build: use a common autogen-waf.sh for all builds
via 9ffd6c0... build: cope with symlinks between build components in waf dist
from 47c4e88... s4-net: Add definition of outf.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 98942c8d840745d72f0ef19636752128236a9bbd
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Apr 12 11:12:22 2010 +1000
build: use a common autogen-waf.sh for all builds
the symlink will get updated with the right target when waf dist is
used in each directory
commit 9ffd6c0ec339aa6e70543cfecfb2bab93705e603
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Apr 12 11:09:44 2010 +1000
build: cope with symlinks between build components in waf dist
This will allow us to have autogen-waf.sh be a symlink to
../buildtools/scripts/autogen-waf.sh in each library.
That will prevent people from updating only the script in source4/,
and forgetting to udpate the scripts in the other libs, as happened
with commit f3f82496
-----------------------------------------------------------------------
Summary of changes:
{source4 => buildtools/scripts}/autogen-waf.sh | 0
buildtools/wafsamba/samba_dist.py | 52 +++++++++++++++++++++++-
lib/replace/autogen-waf.sh | 23 +----------
lib/talloc/autogen-waf.sh | 23 +----------
lib/tdb/autogen-waf.sh | 23 +----------
lib/tevent/autogen-waf.sh | 23 +----------
source4/autogen-waf.sh | 28 +------------
source4/lib/ldb/autogen-waf.sh | 23 +----------
8 files changed, 56 insertions(+), 139 deletions(-)
copy {source4 => buildtools/scripts}/autogen-waf.sh (100%)
mode change 100755 => 120000 lib/replace/autogen-waf.sh
mode change 100755 => 120000 lib/talloc/autogen-waf.sh
mode change 100755 => 120000 lib/tdb/autogen-waf.sh
mode change 100755 => 120000 lib/tevent/autogen-waf.sh
mode change 100755 => 120000 source4/autogen-waf.sh
mode change 100755 => 120000 source4/lib/ldb/autogen-waf.sh
Changeset truncated at 500 lines:
diff --git a/source4/autogen-waf.sh b/buildtools/scripts/autogen-waf.sh
similarity index 100%
copy from source4/autogen-waf.sh
copy to buildtools/scripts/autogen-waf.sh
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py
index aea45c5..0586550 100644
--- a/buildtools/wafsamba/samba_dist.py
+++ b/buildtools/wafsamba/samba_dist.py
@@ -6,8 +6,56 @@ from samba_utils import *
dist_dirs = None
-def add_tarfile(tar, fname, abspath):
+def add_symlink(tar, fname, abspath, basedir):
+ '''handle symlinks to directories that may move during packaging'''
+ if not os.path.islink(abspath):
+ return False
+ tinfo = tar.gettarinfo(name=abspath, arcname=fname)
+ tgt = os.readlink(abspath)
+
+ if dist_dirs:
+ # we need to find the target relative to the main directory
+ # this is here to cope with symlinks into the buildtools
+ # directory from within the standalone libraries in Samba. For example,
+ # a symlink to ../../builtools/scripts/autogen-waf.sh needs
+ # to be rewritten as a symlink to buildtools/scripts/autogen-waf.sh
+ # when the tarball for talloc is built
+
+ # the filename without the appname-version
+ rel_fname = '/'.join(fname.split('/')[1:])
+
+ # join this with the symlink target
+ tgt_full = os.path.join(os.path.dirname(rel_fname), tgt)
+
+ # join with the base directory
+ tgt_base = os.path.normpath(os.path.join(basedir, tgt_full))
+
+ # see if this is inside one of our dist_dirs
+ for dir in dist_dirs.split():
+ if dir.find(':') != -1:
+ destdir=dir.split(':')[1]
+ dir=dir.split(':')[0]
+ else:
+ destdir = '.'
+ if dir == basedir:
+ # internal links don't get rewritten
+ continue
+ if dir == tgt_base[0:len(dir)] and tgt_base[len(dir)] == '/':
+ new_tgt = destdir + tgt_base[len(dir):]
+ tinfo.linkname = new_tgt
+ break
+
+ tinfo.uid = 0
+ tinfo.gid = 0
+ tinfo.uname = 'root'
+ tinfo.gname = 'root'
+ tar.addfile(tinfo)
+ return True
+
+def add_tarfile(tar, fname, abspath, basedir):
'''add a file to the tarball'''
+ if add_symlink(tar, fname, abspath, basedir):
+ return
try:
tinfo = tar.gettarinfo(name=abspath, arcname=fname)
except OSError:
@@ -61,7 +109,7 @@ def dist(appname='',version=''):
if destdir != '.':
f = destdir + '/' + f
fname = dist_base + '/' + f
- add_tarfile(tar, fname, abspath)
+ add_tarfile(tar, fname, abspath, dir)
tar.close()
diff --git a/lib/replace/autogen-waf.sh b/lib/replace/autogen-waf.sh
deleted file mode 100755
index 9cb144a..99150f3
--- a/lib/replace/autogen-waf.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d $d; do d="../$d"; done
-
-echo "Found buildtools in $d"
-
-echo "Setting up configure"
-rm -f configure
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/configure.waf" > configure
-chmod +x configure
-
-echo "Setting up makefile"
-# this relies on the fact that make looks for 'makefile' before 'Makefile'
-rm -f makefile
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/Makefile.waf" > makefile
-
-echo "done. Now run ./configure or ./configure.developer then make"
diff --git a/lib/replace/autogen-waf.sh b/lib/replace/autogen-waf.sh
new file mode 120000
index 9cb144a..99150f3
--- /dev/null
+++ b/lib/replace/autogen-waf.sh
@@ -0,0 +1 @@
+../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
diff --git a/lib/talloc/autogen-waf.sh b/lib/talloc/autogen-waf.sh
deleted file mode 100755
index 9cb144a..99150f3
--- a/lib/talloc/autogen-waf.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d $d; do d="../$d"; done
-
-echo "Found buildtools in $d"
-
-echo "Setting up configure"
-rm -f configure
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/configure.waf" > configure
-chmod +x configure
-
-echo "Setting up makefile"
-# this relies on the fact that make looks for 'makefile' before 'Makefile'
-rm -f makefile
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/Makefile.waf" > makefile
-
-echo "done. Now run ./configure or ./configure.developer then make"
diff --git a/lib/talloc/autogen-waf.sh b/lib/talloc/autogen-waf.sh
new file mode 120000
index 9cb144a..99150f3
--- /dev/null
+++ b/lib/talloc/autogen-waf.sh
@@ -0,0 +1 @@
+../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
diff --git a/lib/tdb/autogen-waf.sh b/lib/tdb/autogen-waf.sh
deleted file mode 100755
index 9cb144a..99150f3
--- a/lib/tdb/autogen-waf.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d $d; do d="../$d"; done
-
-echo "Found buildtools in $d"
-
-echo "Setting up configure"
-rm -f configure
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/configure.waf" > configure
-chmod +x configure
-
-echo "Setting up makefile"
-# this relies on the fact that make looks for 'makefile' before 'Makefile'
-rm -f makefile
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/Makefile.waf" > makefile
-
-echo "done. Now run ./configure or ./configure.developer then make"
diff --git a/lib/tdb/autogen-waf.sh b/lib/tdb/autogen-waf.sh
new file mode 120000
index 9cb144a..99150f3
--- /dev/null
+++ b/lib/tdb/autogen-waf.sh
@@ -0,0 +1 @@
+../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
diff --git a/lib/tevent/autogen-waf.sh b/lib/tevent/autogen-waf.sh
deleted file mode 100755
index 9cb144a..99150f3
--- a/lib/tevent/autogen-waf.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d $d; do d="../$d"; done
-
-echo "Found buildtools in $d"
-
-echo "Setting up configure"
-rm -f configure
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/configure.waf" > configure
-chmod +x configure
-
-echo "Setting up makefile"
-# this relies on the fact that make looks for 'makefile' before 'Makefile'
-rm -f makefile
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/Makefile.waf" > makefile
-
-echo "done. Now run ./configure or ./configure.developer then make"
diff --git a/lib/tevent/autogen-waf.sh b/lib/tevent/autogen-waf.sh
new file mode 120000
index 9cb144a..99150f3
--- /dev/null
+++ b/lib/tevent/autogen-waf.sh
@@ -0,0 +1 @@
+../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
diff --git a/source4/autogen-waf.sh b/source4/autogen-waf.sh
deleted file mode 100755
index 7a6e94c..153637b
--- a/source4/autogen-waf.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-p=`dirname $0`
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d "$p/$d"; do d="../$d"; done
-
-echo "Found buildtools in $p/$d"
-
-echo "Setting up configure"
-rm -f $p/configure $p/include/config*.h*
-sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure
-chmod +x $p/configure
-
-echo "Setting up Makefile"
-rm -f $p/makefile $p/Makefile
-sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile
-
-echo "done. Now run $p/configure or $p/configure.developer then make."
-if [ $p != "." ]; then
- echo "Notice: The build invoke path is not 'source4'! Use make with the parameter"
- echo "-C <'source4' path>. Example: make -C source4 all"
-fi
diff --git a/source4/autogen-waf.sh b/source4/autogen-waf.sh
new file mode 120000
index 7a6e94c..153637b
--- /dev/null
+++ b/source4/autogen-waf.sh
@@ -0,0 +1 @@
+../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
diff --git a/source4/lib/ldb/autogen-waf.sh b/source4/lib/ldb/autogen-waf.sh
deleted file mode 100755
index 9cb144a..672a86b
--- a/source4/lib/ldb/autogen-waf.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-echo "Setting up for waf build"
-
-echo "Looking for the buildtools directory"
-
-d="buildtools"
-while test \! -d $d; do d="../$d"; done
-
-echo "Found buildtools in $d"
-
-echo "Setting up configure"
-rm -f configure
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/configure.waf" > configure
-chmod +x configure
-
-echo "Setting up makefile"
-# this relies on the fact that make looks for 'makefile' before 'Makefile'
-rm -f makefile
-sed "s|BUILDTOOLS|$d|g" < "$d/scripts/Makefile.waf" > makefile
-
-echo "done. Now run ./configure or ./configure.developer then make"
diff --git a/source4/lib/ldb/autogen-waf.sh b/source4/lib/ldb/autogen-waf.sh
new file mode 120000
index 9cb144a..672a86b
--- /dev/null
+++ b/source4/lib/ldb/autogen-waf.sh
@@ -0,0 +1 @@
+../../../buildtools/scripts/autogen-waf.sh
\ No newline at end of file
--
Samba Shared Repository
More information about the samba-cvs
mailing list