summaryrefslogtreecommitdiff
path: root/lib/talloc/script
diff options
context:
space:
mode:
Diffstat (limited to 'lib/talloc/script')
-rwxr-xr-xlib/talloc/script/abi_checks.sh27
-rw-r--r--lib/talloc/script/mksyms.awk19
-rwxr-xr-xlib/talloc/script/mksyms.sh19
-rwxr-xr-xlib/talloc/script/release-script.sh58
4 files changed, 87 insertions, 36 deletions
diff --git a/lib/talloc/script/abi_checks.sh b/lib/talloc/script/abi_checks.sh
index ba60ed003a..66c4e60e45 100755
--- a/lib/talloc/script/abi_checks.sh
+++ b/lib/talloc/script/abi_checks.sh
@@ -33,6 +33,7 @@ LANG=C; export LANG
LC_ALL=C; export LC_ALL
LC_COLLATE=C; export LC_COLLATE
+exit_status=0
script=$0
dir_name=$(dirname ${script})
@@ -58,34 +59,22 @@ signatures_file_check=${signatures_file}.check
${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
+cat ${headers} | ${dir_name}/mksigs.pl | sort| uniq > ${signatures_file_check} 2> /dev/null
-cat ${headers} | ${dir_name}/mksigs.pl > ${signatures_file_check} 2> /dev/null
-
-normalize_exports_file() {
- filename=$1
- cat ${filename} \
- | sed -e 's/^[ \t]*//g' \
- | sed -e 's/^$//g' \
- | sed -e 's/^#.*$//g' \
- | sort | uniq > ${filename}.sort
-}
-
-normalize_exports_file ${exports_file}
-normalize_exports_file ${exports_file_check}
-
-normalize_exports_file ${signatures_file}
-normalize_exports_file ${signatures_file_check}
-
-diff -u ${exports_file}.sort ${exports_file_check}.sort
+diff -u ${exports_file} ${exports_file_check}
if test "x$?" != "x0" ; then
echo "WARNING: possible ABI change detected in exports!"
+ let exit_status++
else
echo "exports check: OK"
fi
-diff -u ${signatures_file}.sort ${signatures_file_check}.sort
+diff -u ${signatures_file} ${signatures_file_check}
if test "x$?" != "x0" ; then
echo "WARNING: possible ABI change detected in signatures!"
+ let exit_status++
else
echo "signatures check: OK"
fi
+
+exit $exit_status
diff --git a/lib/talloc/script/mksyms.awk b/lib/talloc/script/mksyms.awk
index ca14da0f21..8775faff3f 100644
--- a/lib/talloc/script/mksyms.awk
+++ b/lib/talloc/script/mksyms.awk
@@ -8,25 +8,12 @@
#
BEGIN {
inheader=0;
- current_file="";
- print "#"
- print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
- print "#"
- print "{"
- print "\tglobal:"
}
END {
- print""
- print "\tlocal: *;"
- print "};"
}
{
- if (FILENAME!=current_file) {
- print "\t\t# The following definitions come from",FILENAME
- current_file=FILENAME
- }
if (inheader) {
if (match($0,"[)][^()]*[;][ \t]*$")) {
inheader = 0;
@@ -42,7 +29,7 @@ END {
/^extern[ \t]+[^()]+[;][ \t]*$/ {
gsub(/[^ \t]+[ \t]+/, "");
sub(/[;][ \t]*$/, "");
- printf "\t\t%s;\n", $0;
+ printf " %s;\n", $0;
next;
}
@@ -61,7 +48,7 @@ END {
sub(/[(].*$/, "");
gsub(/[^ \t]+[ \t]+/, "");
gsub(/^[*]+/, "");
- printf "\t\t%s;\n",$0;
+ printf " %s;\n",$0;
next;
}
@@ -70,7 +57,7 @@ END {
sub(/[(].*$/, "");
gsub(/[^ \t]+[ \t]+/, "");
gsub(/^[*]/, "");
- printf "\t\t%s;\n",$0;
+ printf " %s;\n",$0;
next;
}
diff --git a/lib/talloc/script/mksyms.sh b/lib/talloc/script/mksyms.sh
index 714d55abae..089344f8f0 100755
--- a/lib/talloc/script/mksyms.sh
+++ b/lib/talloc/script/mksyms.sh
@@ -34,7 +34,24 @@ echo creating $symsfile
mkdir -p `dirname $symsfile`
-${awk} -f `dirname $0`/mksyms.awk $proto_src > $symsfile_tmp
+#Write header
+cat > $symsfile_tmp << EOF
+# This file is autogenerated, please DO NOT EDIT
+{
+ global:
+EOF
+
+#loop on each header
+for i in $proto_src; do
+${awk} -f `dirname $0`/mksyms.awk $i | sort >> $symsfile_tmp
+done;
+
+#Write tail
+cat >> $symsfile_tmp << EOF
+
+ local: *;
+};
+EOF
if cmp -s $symsfile $symsfile_tmp 2>/dev/null
then
diff --git a/lib/talloc/script/release-script.sh b/lib/talloc/script/release-script.sh
new file mode 100755
index 0000000000..4804f6ff58
--- /dev/null
+++ b/lib/talloc/script/release-script.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+if [ "$1" = "" ]; then
+ echo "Please provide version string, eg: 1.2.0"
+ exit 1
+fi
+
+if [ ! -d "lib/talloc" ]; then
+ echo "Run this script from the samba base directory."
+ exit 1
+fi
+
+# Check exports and signatures are up to date
+pushd lib/talloc
+./script/abi_checks.sh talloc talloc.h
+abicheck=$?
+popd
+if [ ! "$abicheck" = "0" ]; then
+ echo "ERROR: ABI Checks produced warnings!"
+ exit 1
+fi
+
+git clean -f -x -d lib/talloc
+git clean -f -x -d lib/replace
+
+curbranch=`git-branch |grep "^*" | tr -d "* "`
+
+version=$1
+strver=`echo ${version} | tr "." "-"`
+
+# Checkout the release tag
+git branch -f talloc-release-script-${strver} talloc-${strver}
+if [ ! "$?" = "0" ]; then
+ echo "Unable to checkout talloc-${strver} release"
+ exit 1
+fi
+
+git checkout talloc-release-script-${strver}
+
+# Test configure agrees with us
+confver=`grep "^AC_INIT" lib/talloc/configure.ac | tr -d "AC_INIT(talloc, " | tr -d ")"`
+if [ ! "$confver" = "$version" ]; then
+ echo "Wrong version, requested release for ${version}, found ${confver}"
+ exit 1
+fi
+
+# Now build tarball
+cp -a lib/talloc talloc-${version}
+cp -a lib/replace talloc-${version}/libreplace
+pushd talloc-${version}
+./autogen.sh
+popd
+tar cvzf talloc-${version}.tar.gz talloc-${version}
+rm -fr talloc-${version}
+
+#Clean up
+git checkout $curbranch
+git branch -d talloc-release-script-${strver}