The branch, master has been updated via e4eba98 waf/samba_version: Simplify git show command. via 8d07e6d samba_version: Make COMMIT_IS_CLEAN an int rather than a string. via 7d961dd samba_version: Simplify dirty tree detection. via c338ded waf/samba_version: Support integer defines. via ed22f13 s3: Rename GIT_COMMIT_{TIME,DATE} to COMMIT_{TIME,DATE}. via 9ebb55d s4: Remove obsolete mkversion.sh via 7b964c7 samba_version: When working from git checkout, display git revision SHA1 rather than Bazaar revision ids. via a0c2040 samba_version: Support retrieving snapshot identity from bzr. via 45af495 samba_version: Cope with building snapshots in directories without git checkout. via d9a0a18 Put git tree finding into a separate function. via 80e2adc sambaversion.py: Some cleanups, make less git-specific. via e3b7ce8 wafsamba: Support make dist from bzr checkout. via 5a482a6 torture: Only add in tests for socket_wrapper/nss_wrapper when they have been enabled. via 7e8ea2c unix_privs: Add missing dependency on libreplace. via 1f853ee socket_wrapper: Only add as global dependency when enabled. via 32889f8 heimdal_build: Add missing dependency on replace, necessary because replace.h is included. from 5cf904b s4-waf: Only enable various wrappers if they're actually used.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e4eba98f831b869bf3894c2940a8131a7a6862be Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 18:27:46 2010 +0100 waf/samba_version: Simplify git show command. Autobuild-User: Jelmer Vernooij <jel...@samba.org> Autobuild-Date: Fri Nov 12 18:38:21 UTC 2010 on sn-devel-104 commit 8d07e6d986322c4954a385b9bfea73f0931b3053 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 18:20:02 2010 +0100 samba_version: Make COMMIT_IS_CLEAN an int rather than a string. commit 7d961ddc443a31d71cd3d2c02a397128da9be120 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 18:19:00 2010 +0100 samba_version: Simplify dirty tree detection. commit c338dede1b5bdab240a237581644158ba56249b3 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 18:06:43 2010 +0100 waf/samba_version: Support integer defines. commit ed22f13e7ead1b1ed2fd9dde51a479b9cfaf67aa Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 18:06:20 2010 +0100 s3: Rename GIT_COMMIT_{TIME,DATE} to COMMIT_{TIME,DATE}. This avoids some special casing in the waf code. commit 9ebb55d1cb1280a5b8a4d82ec35568c034898e41 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:59:07 2010 +0100 s4: Remove obsolete mkversion.sh commit 7b964c72698054337e1c40df23550edad96de8b5 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:54:41 2010 +0100 samba_version: When working from git checkout, display git revision SHA1 rather than Bazaar revision ids. commit a0c2040ab698c8f053d12b4f53b0ac76a8f5ebac Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:26:06 2010 +0100 samba_version: Support retrieving snapshot identity from bzr. commit 45af495695a83636e79a810e212542d7c292a9ac Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:18:30 2010 +0100 samba_version: Cope with building snapshots in directories without git checkout. Error out when run in a git checkout in which git fails. commit d9a0a18ddabe9b91e73cc8bf1582af46d208ff27 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:13:37 2010 +0100 Put git tree finding into a separate function. commit 80e2adc9c3412ac7d22ef9ebb0c8451768841b08 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:08:09 2010 +0100 sambaversion.py: Some cleanups, make less git-specific. commit e3b7ce85e2db8cf09202fc2da843cf043e64e81c Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 17:00:42 2010 +0100 wafsamba: Support make dist from bzr checkout. commit 5a482a641e9631e269684d4394864659791b5dec Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 16:23:03 2010 +0100 torture: Only add in tests for socket_wrapper/nss_wrapper when they have been enabled. commit 7e8ea2ca34462669810f540f7b09cd7475a87a7c Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 16:22:43 2010 +0100 unix_privs: Add missing dependency on libreplace. commit 1f853ee51b46b5a1a3b4e8e2c13023ddcc034fa2 Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 16:22:16 2010 +0100 socket_wrapper: Only add as global dependency when enabled. commit 32889f83465a5e943beb47c059572b8cd108df9c Author: Jelmer Vernooij <jel...@samba.org> Date: Fri Nov 12 16:12:14 2010 +0100 heimdal_build: Add missing dependency on replace, necessary because replace.h is included. ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/samba_dist.py | 14 ++- buildtools/wafsamba/samba_patterns.py | 4 +- buildtools/wafsamba/samba_version.py | 189 ++++++++++++++++++++++----------- lib/socket_wrapper/wscript | 6 +- lib/util/wscript_build | 1 + source3/m4/samba_version.m4 | 14 ++-- source3/script/mkversion.sh | 8 +- source3/smbd/trans2.c | 4 +- source3/wscript | 2 +- source4/heimdal_build/wscript_build | 4 +- source4/script/mkversion.sh | 133 ----------------------- source4/torture/local/local.c | 4 + source4/torture/local/wscript_build | 16 +++- source4/wscript | 2 +- 14 files changed, 177 insertions(+), 224 deletions(-) delete mode 100755 source4/script/mkversion.sh Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 7cd4d54..b62f256 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -103,11 +103,17 @@ def dist(appname='',version=''): else: destdir = '.' absdir = os.path.join(srcdir, dir) - git_cmd = [ 'git', 'ls-files', '--full-name', absdir ] + if os.path.isdir(os.path.join(absdir, ".git")): + ls_files_cmd = [ 'git', 'ls-files', '--full-name', absdir ] + elif os.path.isdir(os.path.join(absdir, ".bzr")): + ls_files_cmd = [ 'bzr', 'ls', '--from-root', '--recursive', '-d', absdir ] + else: + Logs.error('unknown or no vcs for %s' % absdir) + sys.exit(1) try: - files = Utils.cmd_output(git_cmd).split() + files = Utils.cmd_output(ls_files_cmd).split() except: - Logs.error('git command failed: %s' % ' '.join(git_cmd)) + Logs.error('command failed: %s' % ' '.join(ls_files_cmd)) sys.exit(1) for f in files: abspath = os.path.join(srcdir, f) @@ -124,6 +130,8 @@ def dist(appname='',version=''): blacklisted = True if blacklisted: continue + if os.path.isdir(abspath): + continue if destdir != '.': f = destdir + '/' + f fname = dist_base + '/' + f diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py index 4307bf2..9693c59 100644 --- a/buildtools/wafsamba/samba_patterns.py +++ b/buildtools/wafsamba/samba_patterns.py @@ -12,9 +12,9 @@ def write_version_header(task): have_git = 'GIT' in task.env - version = samba_version_file(src, have_git=have_git) + version = samba_version_file(src, task.env.srcdir, have_git=have_git) string = str(version) - + f = open(tgt, 'w') s = f.write(string) f.close() diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py index 735a700..69f36eb 100644 --- a/buildtools/wafsamba/samba_version.py +++ b/buildtools/wafsamba/samba_version.py @@ -1,7 +1,78 @@ -import Utils; - -class samba_version(object): - def __init__(self, version_dict, have_git=False): +import os +import Utils + +def bzr_version_summary(path): + try: + from bzrlib import branch, osutils, workingtree + except ImportError: + return ("BZR-UNKNOWN", {}) + + from bzrlib.plugin import load_plugins + load_plugins() + + b = branch.Branch.open(path) + (revno, revid) = b.last_revision_info() + rev = b.repository.get_revision(revid) + + fields = { + "BZR_REVISION_ID": revid, + "BZR_REVNO": revno, + "COMMIT_DATE": osutils.format_date_with_offset_in_original_timezone(rev.timestamp, + rev.timezone or 0), + "COMMIT_TIME": int(rev.timestamp), + "BZR_BRANCH": rev.properties.get("branch-nick", ""), + } + + # If possible, retrieve the git sha + try: + from bzrlib.plugins.git.object_store import get_object_store + except ImportError: + # No git plugin + ret = "BZR-%d" % revno + else: + store = get_object_store(b.repository) + full_rev = store._lookup_revision_sha1(revid) + fields["GIT_COMMIT_ABBREV"] = full_rev[:7] + fields["GIT_COMMIT_FULLREV"] = full_rev + ret = "GIT-" + fields["GIT_COMMIT_ABBREV"] + + if workingtree.WorkingTree.open(path).has_changes(): + fields["COMMIT_IS_CLEAN"] = 0 + ret += "+" + else: + fields["COMMIT_IS_CLEAN"] = 1 + return (ret, fields) + + +def git_version_summary(path, have_git): + # Get version from GIT + if not have_git: + return ("GIT-UNKNOWN", {}) + + git = Utils.cmd_output(env={"GIT_DIR": "%s/.git" % path}, cmd=["git", "show", '--pretty=format:%h%n%ct%n%H%n%cd', "--stat", "HEAD"]) + + lines = git.splitlines() + fields = { + "GIT_COMMIT_ABBREV": lines[0], + "GIT_COMMIT_FULLREV": lines[2], + "COMMIT_TIME": int(lines[1]), + "COMMIT_DATE": lines[3], + } + + ret = "GIT-" + fields["GIT_COMMIT_ABBREV"] + + clean = Utils.cmd_output('git diff HEAD | wc -l', silent=True) + if clean == "0\n": + fields["COMMIT_IS_CLEAN"] = 1 + else: + fields["COMMIT_IS_CLEAN"] = 0 + ret += "+" + return (ret, fields) + + +class SambaVersion(object): + + def __init__(self, version_dict, path, have_git=False): '''Determine the version number of samba See VERSION for the format. Entries on that file are @@ -16,7 +87,7 @@ also accepted as dictionary entries here self.ALPHA_RELEASE=None self.PRE_RELEASE=None self.RC_RELEASE=None - self.IS_GIT_SNAPSHOT=True + self.IS_SNAPSHOT=True self.RELEASE_NICKNAME=None self.VENDOR_SUFFIX=None self.VENDOR_PATCH=None @@ -28,10 +99,12 @@ also accepted as dictionary entries here setattr(self, a, b) if self.IS_GIT_SNAPSHOT == "yes": - self.IS_GIT_SNAPSHOT=True + self.IS_SNAPSHOT=True elif self.IS_GIT_SNAPSHOT == "no": - self.IS_GIT_SNAPSHOT=False - + self.IS_SNAPSHOT=False + else: + raise Exception("Unknown value for IS_GIT_SNAPSHOT: %s" % self.IS_GIT_SNAPSHOT) + ## ## start with "3.0.22" ## @@ -49,7 +122,7 @@ also accepted as dictionary entries here SAMBA_VERSION_STRING += self.REVISION if self.TP_RELEASE is not None: self.TP_RELEASE = int(self.TP_RELEASE) - SAMBA_VERSION_STRING += ("tp%u" % self.TP_RELEASE) + SAMBA_VERSION_STRING += "tp%u" % self.TP_RELEASE if self.ALPHA_RELEASE is not None: self.ALPHA_RELEASE = int(self.ALPHA_RELEASE) SAMBA_VERSION_STRING += ("alpha%u" % self.ALPHA_RELEASE) @@ -60,32 +133,19 @@ also accepted as dictionary entries here self.RC_RELEASE = int(self.RC_RELEASE) SAMBA_VERSION_STRING += ("rc%u" % self.RC_RELEASE) - if self.IS_GIT_SNAPSHOT: - #Get version from GIT - if have_git: - git = Utils.cmd_output('git show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True) + if self.IS_SNAPSHOT: + if os.path.exists(os.path.join(path, ".git")): + suffix, self.vcs_fields = git_version_summary(path, have_git) + elif os.path.exists(os.path.join(path, ".bzr")): + suffix, self.vcs_fields = bzr_version_summary(path) else: - git = '' - - if git == '': - SAMBA_VERSION_STRING += "-GIT-UNKNOWN" - else: - lines = git.splitlines(); - self.GIT_COMMIT_ABBREV = lines[0] - self.GIT_COMMIT_TIME = lines[1] - self.GIT_COMMIT_FULLREV = lines[2] - self.GIT_COMMIT_DATE = lines[3] - - SAMBA_VERSION_STRING += ("-GIT-" + self.GIT_COMMIT_ABBREV) - - clean = Utils.cmd_output('git diff HEAD | wc -l', silent=True) - if clean == "0\n": - self.GIT_COMMIT_IS_CLEAN = True - else: - self.GIT_COMMIT_IS_CLEAN = False - SAMBA_VERSION_STRING += "+" + suffix = "UNKNOWN" + self.vcs_fields = {} + SAMBA_VERSION_STRING += "-" + suffix + else: + self.vcs_fields = {} - self.OFFICIAL_STRING=SAMBA_VERSION_STRING + self.OFFICIAL_STRING = SAMBA_VERSION_STRING if self.VENDOR_SUFFIX is not None: SAMBA_VERSION_STRING += ("-" + self.VENDOR_SUFFIX) @@ -102,7 +162,7 @@ also accepted as dictionary entries here self.RELEASE_NICKNAME = self.RELEASE_NICKNAME else: self.STRING_WITH_NICKNAME = self.STRING - + def __str__(self): string="/* Autogenerated by waf */\n" string+="#define SAMBA_VERSION_MAJOR %u\n" % self.MAJOR @@ -123,15 +183,16 @@ also accepted as dictionary entries here if self.RC_RELEASE is not None: string+="#define SAMBA_VERSION_RC_RELEASE %u\n" % self.RC_RELEASE - try: - string+="#define SAMBA_VERSION_GIT_COMMIT_ABBREV \"" + self.GIT_COMMIT_ABBREV + "\"\n" - string+="#define SAMBA_VERSION_GIT_COMMIT_FULLREV \"" + self.GIT_COMMIT_FULLREV + "\"\n" - string+="#define SAMBA_VERSION_GIT_COMMIT_DATE \"" + self.GIT_COMMIT_DATE + "\"\n" - string+="#define SAMBA_VERSION_GIT_COMMIT_TIME " + self.GIT_COMMIT_TIME + "\n" - if self.GIT_COMMIT_IS_CLEAN: - string+="#define SAMBA_VERSION_GIT_COMMIT_IS_CLEAN 1\n" - except AttributeError: - pass + for name in sorted(self.vcs_fields.keys()): + string+="#define SAMBA_VERSION_%s " % name + value = self.vcs_fields[name] + if isinstance(value, basestring): + string += "\"%s\"" % value + elif type(value) is int: + string += "%d" % value + else: + raise Exception("Unknown type for %s: %r" % (name, value)) + string += "\n" string+="#define SAMBA_VERSION_OFFICIAL_STRING \"" + self.OFFICIAL_STRING + "\"\n" @@ -156,24 +217,24 @@ also accepted as dictionary entries here return string -class samba_version_file(samba_version): - def __init__(self, version_file, have_git=False): - '''Parse the version information from a VERSION file''' - f = open(version_file, 'r') - version_dict = {} - for line in f: - try: - line = line.strip() - if line == '': - continue - if line.startswith("#"): - continue - split_line=line.split("=") - if split_line[1] != "": - value = split_line[1].strip('"') - version_dict[split_line[0]] = value - except: - print("Failed to parse line %s from %s" % (line, version_file)) - raise - - super(samba_version_file, self).__init__(version_dict, have_git=have_git) +def samba_version_file(version_file, path, have_git=False): + '''Parse the version information from a VERSION file''' + + f = open(version_file, 'r') + version_dict = {} + for line in f: + line = line.strip() + if line == '': + continue + if line.startswith("#"): + continue + try: + split_line = line.split("=") + if split_line[1] != "": + value = split_line[1].strip('"') + version_dict[split_line[0]] = value + except: + print("Failed to parse line %s from %s" % (line, version_file)) + raise + + return SambaVersion(version_dict, path, have_git=have_git) diff --git a/lib/socket_wrapper/wscript b/lib/socket_wrapper/wscript index 70474d7..9da578f 100644 --- a/lib/socket_wrapper/wscript +++ b/lib/socket_wrapper/wscript @@ -3,13 +3,13 @@ import Options def set_options(opt): - gr = opt.option_group('developer options') - gr.add_option('--enable-socket-wrapper', + gr = opt.option_group('developer options') + gr.add_option('--enable-socket-wrapper', help=("Turn on socket wrapper library (default=no)"), action="store_true", dest='enable_socket_wrapper', default=False) def configure(conf): if (Options.options.enable_socket_wrapper or Options.options.developer or Options.options.enable_selftest): conf.DEFINE('SOCKET_WRAPPER', 1) - conf.ADD_GLOBAL_DEPENDENCY('socket_wrapper') + conf.ADD_GLOBAL_DEPENDENCY('socket_wrapper') diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 799d7b1..0cff28f 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -20,6 +20,7 @@ bld.SAMBA_SUBSYSTEM('ASN1_UTIL', bld.SAMBA_SUBSYSTEM('UNIX_PRIVS', source='unix_privs.c', autoproto='unix_privs.h', + deps='replace', local_include=False, ) diff --git a/source3/m4/samba_version.m4 b/source3/m4/samba_version.m4 index 4d749e9..dbea1f3 100644 --- a/source3/m4/samba_version.m4 +++ b/source3/m4/samba_version.m4 @@ -15,15 +15,15 @@ SAMBA_VERSION_GIT_COMMIT_FULLREV=`cat $srcdir/include/version.h | grep 'SAMBA_VE if test -n "${SAMBA_VERSION_GIT_COMMIT_FULLREV}";then echo "BUILD COMMIT REVISION: ${SAMBA_VERSION_GIT_COMMIT_FULLREV}" fi -SAMBA_VERSION_GIT_COMMIT_DATE=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_DATE' | cut -d ' ' -f3-` -if test -n "${SAMBA_VERSION_GIT_COMMIT_DATE}";then - echo "BUILD COMMIT DATE: ${SAMBA_VERSION_GIT_COMMIT_DATE}" +SAMBA_VERSION_COMMIT_DATE=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_COMMIT_DATE' | cut -d ' ' -f3-` +if test -n "${SAMBA_VERSION_COMMIT_DATE}";then + echo "BUILD COMMIT DATE: ${SAMBA_VERSION_COMMIT_DATE}" fi -SAMBA_VERSION_GIT_COMMIT_TIME=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_TIME' | cut -d ' ' -f3-` -if test -n "${SAMBA_VERSION_GIT_COMMIT_TIME}";then - echo "BUILD COMMIT TIME: ${SAMBA_VERSION_GIT_COMMIT_TIME}" +SAMBA_VERSION_COMMIT_TIME=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_COMMIT_TIME' | cut -d ' ' -f3-` +if test -n "${SAMBA_VERSION_COMMIT_TIME}";then + echo "BUILD COMMIT TIME: ${SAMBA_VERSION_COMMIT_TIME}" # just to keep the build-farm gui happy for now... - echo "BUILD REVISION: ${SAMBA_VERSION_GIT_COMMIT_TIME}" + echo "BUILD REVISION: ${SAMBA_VERSION_COMMIT_TIME}" fi diff --git a/source3/script/mkversion.sh b/source3/script/mkversion.sh index ce9d2af..5ad197d 100755 --- a/source3/script/mkversion.sh +++ b/source3/script/mkversion.sh @@ -76,9 +76,9 @@ if test x"${SAMBA_VERSION_IS_GIT_SNAPSHOT}" = x"yes";then HAVEGIT=no GIT_INFO=`git show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD 2>/dev/null` GIT_COMMIT_ABBREV=`printf "%s" "${GIT_INFO}" | sed -n 1p` - GIT_COMMIT_TIME=`printf "%s" "${GIT_INFO}" | sed -n 2p` + COMMIT_TIME=`printf "%s" "${GIT_INFO}" | sed -n 2p` GIT_COMMIT_FULLREV=`printf "%s" "${GIT_INFO}" | sed -n 3p` - GIT_COMMIT_DATE=`printf "%s" "${GIT_INFO}" | sed -n 4p` + COMMIT_DATE=`printf "%s" "${GIT_INFO}" | sed -n 4p` if test -n "${GIT_COMMIT_ABBREV}";then HAVEGIT=yes HAVEVER=yes @@ -89,9 +89,9 @@ if test x"${SAMBA_VERSION_IS_GIT_SNAPSHOT}" = x"yes";then SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-GIT-${GIT_COMMIT_ABBREV}" echo "#define SAMBA_VERSION_GIT_COMMIT_ABBREV \"${GIT_COMMIT_ABBREV}\"" >> $OUTPUT_FILE - echo "#define SAMBA_VERSION_GIT_COMMIT_TIME ${GIT_COMMIT_TIME}" >> $OUTPUT_FILE + echo "#define SAMBA_VERSION_COMMIT_TIME ${COMMIT_TIME}" >> $OUTPUT_FILE echo "#define SAMBA_VERSION_GIT_COMMIT_FULLREV \"${GIT_COMMIT_FULLREV}\"" >> $OUTPUT_FILE - echo "#define SAMBA_VERSION_GIT_COMMIT_DATE \"${GIT_COMMIT_DATE}\"" >> $OUTPUT_FILE + echo "#define SAMBA_VERSION_COMMIT_DATE \"${COMMIT_DATE}\"" >> $OUTPUT_FILE else SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-GIT-UNKNOWN" fi diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 7ca5f50..30794e0 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2892,8 +2892,8 @@ static void samba_extended_info_version(struct smb_extended_info *extended_info) extended_info->samba_subversion |= (SAMBA_VERSION_VENDOR_PATCH & 0xffff); #endif extended_info->samba_gitcommitdate = 0; -#ifdef SAMBA_VERSION_GIT_COMMIT_TIME - unix_to_nt_time(&extended_info->samba_gitcommitdate, SAMBA_VERSION_GIT_COMMIT_TIME); +#ifdef SAMBA_VERSION_COMMIT_TIME + unix_to_nt_time(&extended_info->samba_gitcommitdate, SAMBA_VERSION_COMMIT_TIME); #endif memset(extended_info->samba_version_string, 0, diff --git a/source3/wscript b/source3/wscript index 5bab1a1..1164ff1 100644 --- a/source3/wscript +++ b/source3/wscript @@ -21,7 +21,7 @@ def load_version(have_git=False): if not have_git: env = samba_utils.LOAD_ENVIRONMENT() have_git = 'GIT' in env - version = wafsamba.samba_version_file("./VERSION", have_git=have_git) + version = wafsamba.samba_version_file("./VERSION", "..", have_git=have_git) Utils.g_module.VERSION = version.STRING return version diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index 8d0a831..058541e 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -471,7 +471,7 @@ if not bld.CONFIG_SET('USING_SYSTEM_ROKEN'): HEIMDAL_LIBRARY('roken', ROKEN_SOURCE, includes='../heimdal/lib/roken ../heimdal/include', - deps='resolv util', + deps='resolv util replace', vnum='19.0.1', ) @@ -830,7 +830,7 @@ HEIMDAL_SUBSYSTEM('HEIMDAL_VERS_HOSTCC', HEIMDAL_SUBSYSTEM('HEIMDAL_VERS', 'lib/vers/print_version.c ../heimdal_build/version.c', group='build_compilers', - deps='roken') + deps='roken replace') # here is the asn1 compiler build rule HEIMDAL_BINARY('asn1_compile', diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh deleted file mode 100755 index da912ac..0000000 --- a/source4/script/mkversion.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh - -VERSION_FILE=$1 -OUTPUT_FILE=$2 - -if test -z "$VERSION_FILE";then - VERSION_FILE="VERSION" -fi - -if test -z "$OUTPUT_FILE";then - OUTPUT_FILE="version.h" -fi - -SOURCE_DIR=$3 - -SAMBA_VERSION_MAJOR=`sed -n 's/^SAMBA_VERSION_MAJOR=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_MINOR=`sed -n 's/^SAMBA_VERSION_MINOR=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_RELEASE=`sed -n 's/^SAMBA_VERSION_RELEASE=//p' $SOURCE_DIR$VERSION_FILE` - -SAMBA_VERSION_REVISION=`sed -n 's/^SAMBA_VERSION_REVISION=//p' $SOURCE_DIR$VERSION_FILE` - -SAMBA_VERSION_TP_RELEASE=`sed -n 's/^SAMBA_VERSION_TP_RELEASE=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_ALPHA_RELEASE=`sed -n 's/^SAMBA_VERSION_ALPHA_RELEASE=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_PRE_RELEASE=`sed -n 's/^SAMBA_VERSION_PRE_RELEASE=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_RC_RELEASE=`sed -n 's/^SAMBA_VERSION_RC_RELEASE=//p' $SOURCE_DIR$VERSION_FILE` - -SAMBA_VERSION_IS_GIT_SNAPSHOT=`sed -n 's/^SAMBA_VERSION_IS_GIT_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE` - -SAMBA_VERSION_RELEASE_NICKNAME=`sed -n 's/^SAMBA_VERSION_RELEASE_NICKNAME=//p' $SOURCE_DIR$VERSION_FILE` - -SAMBA_VERSION_VENDOR_SUFFIX=`sed -n 's/^SAMBA_VERSION_VENDOR_SUFFIX=//p' $SOURCE_DIR$VERSION_FILE` -SAMBA_VERSION_VENDOR_PATCH=`sed -n 's/^SAMBA_VERSION_VENDOR_PATCH=//p' $SOURCE_DIR$VERSION_FILE` - -echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE - -echo "#define SAMBA_VERSION_MAJOR ${SAMBA_VERSION_MAJOR}" >> $OUTPUT_FILE -echo "#define SAMBA_VERSION_MINOR ${SAMBA_VERSION_MINOR}" >> $OUTPUT_FILE -echo "#define SAMBA_VERSION_RELEASE ${SAMBA_VERSION_RELEASE}" >> $OUTPUT_FILE - - -## -## start with "3.0.22" -## -SAMBA_VERSION_STRING="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}" - - -## -## maybe add "3.0.22a" or "4.0.0tp11" or "4.0.0alpha1" or "3.0.22pre1" or "3.0.22rc1" -## We do not do pre or rc version on patch/letter releases -## -if test -n "${SAMBA_VERSION_REVISION}";then - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}${SAMBA_VERSION_REVISION}" - echo "#define SAMBA_VERSION_REVISION \"${SAMBA_VERSION_REVISION}\"" >> $OUTPUT_FILE -elif test -n "${SAMBA_VERSION_TP_RELEASE}";then - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}tp${SAMBA_VERSION_TP_RELEASE}" - echo "#define SAMBA_VERSION_TP_RELEASE ${SAMBA_VERSION_TP_RELEASE}" >> $OUTPUT_FILE -elif test -n "${SAMBA_VERSION_ALPHA_RELEASE}";then - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}alpha${SAMBA_VERSION_ALPHA_RELEASE}" - echo "#define SAMBA_VERSION_ALPHA_RELEASE ${SAMBA_VERSION_ALPHA_RELEASE}" >> $OUTPUT_FILE -elif test -n "${SAMBA_VERSION_PRE_RELEASE}";then -- Samba Shared Repository