[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Oct 21 12:28:02 UTC 2015


The branch, master has been updated
       via  f99d0b9 script/release.sh: make it possible to create stable .x releases (x >= 1)
       via  800437c autobuild: add some system information to the autobuild tarball
      from  f1835d8 dynconfig: Use replace.h and memory.h directly, not via includes.h

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f99d0b917419756b11f0ebfecbe84b3ebab7fa0a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Oct 21 10:02:33 2015 +0200

    script/release.sh: make it possible to create stable .x releases (x >= 1)
    
    This version was used to create samba-4.3.1.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Karolin Seeger <kseeger at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Oct 21 14:27:53 CEST 2015 on sn-devel-104

commit 800437c1b1dd036661b834abd764433ef1cffc06
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Jul 1 10:45:47 2015 +1200

    autobuild: add some system information to the autobuild tarball
    
    When running multiple autobuilds on VMs with various parameters, you
    can easily get confused about which was which, and the tarball doesn't
    help much. This adds an extra file with information about the system.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 script/autobuild.py |  12 ++
 script/release.sh   | 483 ++++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 364 insertions(+), 131 deletions(-)


Changeset truncated at 500 lines:

diff --git a/script/autobuild.py b/script/autobuild.py
index c91ff2c..209ad1f 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -362,6 +362,16 @@ class buildlist(object):
         self.kill_kids()
         return (0, None, None, None, "All OK")
 
+    def write_system_info(self):
+        filename = 'system-info.txt'
+        f = open(filename, 'w')
+        for cmd in ['uname -a', 'free', 'cat /proc/cpuinfo']:
+            print >>f, '### %s' % cmd
+            print >>f, run_cmd(cmd, output=True, checkfail=False)
+            print >>f
+        f.close()
+        return filename
+
     def tarlogs(self, fname):
         tar = tarfile.open(fname, "w:gz")
         for b in self.tlist:
@@ -369,6 +379,8 @@ class buildlist(object):
             tar.add(b.stderr_path, arcname="%s.stderr" % b.tag)
         if os.path.exists("autobuild.log"):
             tar.add("autobuild.log")
+        sys_info = self.write_system_info()
+        tar.add(sys_info)
         tar.close()
 
     def remove_logs(self):
diff --git a/script/release.sh b/script/release.sh
index 6771b65..e5d93a7 100755
--- a/script/release.sh
+++ b/script/release.sh
@@ -127,6 +127,31 @@ verify_samba_rc() {
 	return 0
 }
 
+load_samba_stable_versions() {
+	check_args "${FUNCNAME}" "$#" "0" || return 1
+
+	test -n "${version-}" && {
+		return 0
+	}
+
+	local SAMBA_VERSION_MAJOR=$(grep '^SAMBA_VERSION_MAJOR=' VERSION | cut -d '=' -f2 | xargs)
+	local SAMBA_VERSION_MINOR=$(grep '^SAMBA_VERSION_MINOR=' VERSION | cut -d '=' -f2 | xargs)
+	local SAMBA_VERSION_RELEASE=$(grep '^SAMBA_VERSION_RELEASE=' VERSION | cut -d '=' -f2 | xargs)
+
+	version="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
+	tagname="${productbase}-${version}"
+
+	test ${SAMBA_VERSION_RELEASE} -gt 0 || {
+		return 0
+	}
+
+	oldversion="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.$(expr ${SAMBA_VERSION_RELEASE} - 1)"
+	oldtagname="${productbase}-${oldversion}"
+	patchfile="${productbase}-${oldversion}-${version}.diffs"
+
+	return 0
+}
+
 verify_samba_stable() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 
@@ -159,17 +184,32 @@ verify_samba_stable() {
 		}
 	done
 
-	local SAMBA_VERSION_MAJOR=$(grep '^SAMBA_VERSION_MAJOR=' VERSION | cut -d '=' -f2 | xargs)
-	local SAMBA_VERSION_MINOR=$(grep '^SAMBA_VERSION_MINOR=' VERSION | cut -d '=' -f2 | xargs)
-	local SAMBA_VERSION_RELEASE=$(grep '^SAMBA_VERSION_RELEASE=' VERSION | cut -d '=' -f2 | xargs)
+	load_samba_stable_versions
+
+	test x"${product}" = x"samba-stable" && {
+		test -f "announce.${tagname}.quotation.txt" || {
+			echo ""
+			echo "announce.${tagname}.quotation.txt missing!"
+			echo ""
+			echo "Please create it and retry"
+			echo ""
+			echo "The content should look like this:"
+			echo "cat announce.${tagname}.quotation.txt"
+			echo '======================================================'
+			echo '                "Some text'
+			echo '                 from someone."'
+			echo ''
+			echo '                 The author'
+			echo '======================================================'
+			echo ""
+			return 1
+		}
+	}
 
-	test ${SAMBA_VERSION_RELEASE} -gt 0 || {
+	test -n "${oldtagname}" || {
 		return 0
 	}
 
-	local old_release=$(expr ${SAMBA_VERSION_RELEASE} - 1)
-	oldtagname="${productbase}-${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${old_release}"
-
 	local verify_out="${TMPDIR}/verify-${oldtagname}.out"
 
 	echo "Verifying oldtagname: ${oldtagname}"
@@ -230,6 +270,19 @@ create_release() {
 
 	echo "Releasing product ${product}"
 
+	test -n "${tagname}" && {
+		git tag -l "${tagname}" | grep -q "${tagname}" && {
+			echo "tagname[${tagname}] already exist"
+			return 1
+		}
+
+		local _tgzname="${tagname}.tar.gz"
+		test -e "${_tgzname}" && {
+			echo "_tgzname[${_tgzname}] already exist"
+			return 1
+		}
+	}
+
 	echo "Building release tarball"
 	local tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
 	test -f "${tgzname}" || {
@@ -244,6 +297,15 @@ create_release() {
 		return 1
 	}
 
+	local _tagname=$(basename ${tgzname} .tar.gz)
+	test -n "${tagname}" && {
+		test x"${_tagname}" = x"${tagname}" || {
+			echo "Invalid tgzname[${tgzname}]"
+			return 1
+		}
+	}
+	tagname="${_tagname}"
+
 	local tarname=$(basename ${tgzname} .gz)
 	echo "Tarball: ${tarname}"
 	gunzip -f ${tgzname} || {
@@ -257,7 +319,6 @@ create_release() {
 	CLEANUP_FILES="${CLEANUP_FILES} ${tarname}"
 
 	# tagname is global
-	tagname=$(basename ${tarname} .tar)
 	echo "Tagging as ${tagname}"
 	git tag -u ${GPG_KEYID} -s "${tagname}" -m "${productbase}: tag release ${tagname}" || {
 		return 1
@@ -288,18 +349,15 @@ patch_release() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
-	test -n "${oldtagname}" || {
+	test -n "${patchfile}" || {
 		return 0
 	}
 
-	local oldversion=$(echo "${oldtagname}" | sed -e "s!^${productbase}-!!")
-	local version=$(echo "${tagname}" | sed -e "s!^${productbase}-!!")
-
 	local oldpwd=$(pwd)
-
-	local patchfile="patch-${oldversion}-${version}.diffs"
 	echo "Generating ${patchfile}"
 	(
+		set -e
+		set -u
 		pushd "${TMPDIR}"
 		tar xfz "${oldpwd}/${oldtagname}.tar.gz"
 		tar xfz "${oldpwd}/${tagname}.tar.gz"
@@ -348,11 +406,23 @@ check_nopatch() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
-	git tag -v "${tagname}" || {
-		echo "failed to verify tag[${tagname}]"
+	local verify_out="${TMPDIR}/verify-${oldtagname}.out"
+
+	echo "Verifying tagname: ${tagname}"
+
+	git tag -v "${tagname}" >${verify_out} 2>&1 || {
+		echo "failed to verify old tag[${oldtagname}]"
+		return 1
+	}
+	grep -q "${GPG_KEYID}" "${verify_out}" || {
+		echo "tagname[${tagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
+		echo ""
+		cat "${verify_out}"
 		return 1
 	}
 
+	echo "Verifying ${tagname}.tar.gz and ${tagname}.tar.asc"
+
 	test -f "${tagname}.tar.gz" || {
 		echo "${tagname}.tar.gz does not exist"
 		return 1
@@ -363,20 +433,45 @@ check_nopatch() {
 		return 1
 	}
 
+	zcat "${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} || {
+		echo "Failed to verify ${tagname}.tar.asc"
+		return 1
+	}
+	grep -q "${GPG_KEYID}" "${verify_out}" || {
+		echo "${tagname}.tar.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
+		echo ""
+		cat "${verify_out}"
+		return 1
+	}
+
 	ls -la ${tagname}.*
 
 	return 0
 }
 
-check_withpatch() {
+check_samba_stable() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
-	git tag -v "${tagname}" || {
-		echo "failed to verify tag[${tagname}]"
+	load_samba_stable_versions
+
+	local verify_out="${TMPDIR}/verify-${oldtagname}.out"
+
+	echo "Verifying tagname: ${tagname}"
+
+	git tag -v "${tagname}" >${verify_out} 2>&1 || {
+		echo "failed to verify old tag[${oldtagname}]"
+		return 1
+	}
+	grep -q "${GPG_KEYID}" "${verify_out}" || {
+		echo "tagname[${tagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
+		echo ""
+		cat "${verify_out}"
 		return 1
 	}
 
+	echo "Verifying ${tagname}.tar.gz and ${tagname}.tar.asc"
+
 	test -f "${tagname}.tar.gz" || {
 		echo "${tagname}.tar.gz does not exist"
 		return 1
@@ -387,12 +482,24 @@ check_withpatch() {
 		return 1
 	}
 
-	ls -la ${tagname}.*
+	zcat "${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} || {
+		echo "Failed to verify ${tagname}.tar.asc"
+		return 1
+	}
+	grep -q "${GPG_KEYID}" "${verify_out}" || {
+		echo "${tagname}.tar.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
+		echo ""
+		cat "${verify_out}"
+		return 1
+	}
 
 	test -n "${patchfile}" || {
+		ls -lart ${tagname}.*
 		return 0
 	}
 
+	echo "Verifying ${patchfile}.gz and ${patchfile}.asc"
+
 	test -f "${patchfile}.gz" || {
 		echo "${patchfile}.gz does not exist"
 		return 1
@@ -403,6 +510,18 @@ check_withpatch() {
 		return 1
 	}
 
+	zcat "${patchfile}.gz" | gpg --verify "${patchfile}.asc" - 2>${verify_out} || {
+		echo "Failed to verify ${patchfile}.asc"
+		return 1
+	}
+	grep -q "${GPG_KEYID}" "${verify_out}" || {
+		echo "${patchfile}.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
+		echo ""
+		cat "${verify_out}"
+		return 1
+	}
+
+	ls -lart ${tagname}.* ${patchfile}.*
 	return 0
 }
 
@@ -430,12 +549,12 @@ push_release() {
 	return 0
 }
 
-upload_release() {
+upload_nopatch() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
 	echo "Upload ${tagname}.* to '${upload_url}'"
-	rsync -Pav ${tagname}.* "${upload_url}/" || {
+	rsync -Pav --delay-updates ${tagname}.* "${upload_url}/" || {
 		return 1
 	}
 	rsync ${upload_url}/${tagname}.*
@@ -443,7 +562,49 @@ upload_release() {
 	return 0
 }
 
-announce_samba_rc() {
+upload_samba_stable() {
+	check_args "${FUNCNAME}" "$#" "0" || return 1
+	require_tagname "${FUNCNAME}"
+
+	load_samba_stable_versions
+
+	local release_url="${upload_url}samba/stable/"
+	local patch_url="${upload_url}samba/patches/"
+
+	echo "Upload ${tagname}.tar.* to '${release_url}'"
+	ls -lart ${tagname}.tar.*
+	rsync -Pav --delay-updates ${tagname}.tar.* "${release_url}/" || {
+		return 1
+	}
+	rsync ${release_url}/${tagname}.tar.*
+
+	test -n "${patchfile}" || {
+		return 0
+	}
+
+	echo "Upload ${patchfile}.* to '${patch_url}'"
+	ls -lart ${patchfile}.*
+	rsync -Pav --delay-updates ${patchfile}.* "${patch_url}/" || {
+		return 1
+	}
+	rsync ${patch_url}/${patchfile}.*
+
+	return 0
+}
+
+upload_release() {
+	check_args "${FUNCNAME}" "$#" "0" || return 1
+
+	test -n "${upload_fn}" || {
+		echo "upload_fn variable empty"
+		return 1
+	}
+
+	echo "Running ${upload_fn}"
+	${upload_fn}
+}
+
+announcement_samba_rc() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
@@ -453,8 +614,6 @@ announce_samba_rc() {
 	}
 
 	local t=""
-	local utcdate=$(date --utc +"%d %B %Y")
-	local utctime=$(date --utc +"%Y%m%d-%H%M%S")
 	local version=$(echo "${tagname}" | sed -e 's!^samba-!!')
 	local href="#${version}"
 	local series=$(echo "${version}" | cut -d '.' -f1-2)
@@ -478,16 +637,17 @@ announce_samba_rc() {
 		;;
 	esac
 
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.to.txt"
 	{
 		echo "samba-announce at lists.samba.org, samba at lists.samba.org, samba-technical at lists.samba.org"
 	} > announce.${tagname}.to.txt
-	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.to.txt"
 
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.subject.txt"
 	{
 		echo "[Announce] Samba ${version} Available for Download"
 	} > announce.${tagname}.subject.txt
-	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.subject.txt"
 
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mail.txt"
 	{
 		cat ${tagname}.WHATSNEW.txt
 		echo ""
@@ -511,27 +671,27 @@ announce_samba_rc() {
 		echo "                        --Enjoy"
 		echo "                        The Samba Team"
 	} > announce.${tagname}.mail.txt
-	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mail.txt"
 
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
 	{
 		echo -n "-i announce.${tagname}.mail.txt "
 		echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
 		echo -n "$(cat announce.${tagname}.to.txt | xargs)"
 	} > announce.${tagname}.mutt-arguments.txt
-	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
 
-	local headlinefile="${utctime}.${version}.headline.html"
+	local headlinefile="posted_news/@UTCTIME at .${version}.headline.html"
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.headline.html"
 	{
-		echo "<!-- BEGIN: posted_news/${headlinefile} -->"
-		echo "<li> ${utcdate} <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
-		echo "<!-- END: posted_news/${headlinefile} -->"
-	} > ${headlinefile}
-	CLEANUP_FILES="${CLEANUP_FILES} ${headlinefile}"
+		echo "<!-- BEGIN: ${headlinefile} -->"
+		echo "<li> @UTCDATE@ <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
+		echo "<!-- END: ${headlinefile} -->"
+	} > announce.${tagname}.headline.html
 
-	local bodyfile="${utctime}.${version}.body.html"
+	local bodyfile="posted_news/@UTCTIME at .${version}.body.html"
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.body.html"
 	{
-		echo "<!-- BEGIN: posted_news/${bodyfile} -->"
-		echo "<h5><a name=\"${version}\">${utcdate}</a></h5>"
+		echo "<!-- BEGIN: ${bodyfile} -->"
+		echo "<h5><a name=\"${version}\">@UTCDATE@</a></h5>"
 		echo "<p class="headline">Samba ${version} Available for Download</p>"
 		echo "<p>"
 		echo "This is the ${rcname} release candidate of the upcoming Samba ${series} release series."
@@ -541,33 +701,23 @@ announce_samba_rc() {
 		echo "The source code can be <a href=\"${download_url}${tagname}.tar.gz\">downloaded now</a>."
 		echo "See <a href=\"${download_url}${tagname}.WHATSNEW.txt\">the release notes for more info</a>."
 		echo "</p>"
-		echo "<!-- END: posted_news/${bodyfile} -->"
-		echo ""
-	} > ${bodyfile}
-	CLEANUP_FILES="${CLEANUP_FILES} ${bodyfile}"
+		echo "<!-- END: ${bodyfile} -->"
+	} > announce.${tagname}.body.html
 
+	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.todo.txt"
 	{
-		ls -lart announce.${tagname}.* ${headlinefile} ${bodyfile}
+		ls -lart announce.${tagname}.*
 		echo ""
 		echo "NOTICE:"
 		echo "You need to do the following manual steps in order"
 		echo "to finish the announcement of ${tagname}!"
 		echo ""
-		echo "Copy the following files into the posted_news/"
-		echo "subdirectory of the samba-web.git repository and commit them:"
-		echo "  ${headlinefile}"
-		echo "  ${bodyfile}"
-		echo ""
-		echo "  cp -a ${utctime}.${version}.*.html /path/to/samba-web/posted_news/"
-		echo "  pushd /path/to/samba-web"
-		echo "  git add posted_news/${utctime}.${version}.*.html"
-		echo "  git commit --signoff --message \"NEWS[${version}]: Samba ${version} Available for Download\""
-		echo "  git show -p --stat HEAD"
-		echo "  git push ..."
-		echo "  popd"
+		echo "Change to a samba-web checkout and run"
+		echo "  ./announce_samba_release.sh ${version} $(pwd)/announce.${tagname}.patch.txt"
 		echo ""
 		echo "Once the resulting commit is pushed a cron job will update "
-		echo "the content exported by the webserver every 5mins."
+		echo "the content exported by the webserver every 5-10 mins."
+		echo "Check https://www.samba.org"
 		echo ""
 		echo "If the web content is updated, you need to send the announce mail (gpg signed)."
 		echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
@@ -580,31 +730,35 @@ announce_samba_rc() {
 		echo "See: announce.${tagname}.todo.txt"
 		echo ""
 	} > announce.${tagname}.todo.txt
-	CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.todo.txt"
-
-	cat announce.${tagname}.todo.txt
 
+	ls -lart announce.${tagname}.*
 	return 0
 }
 
-announce_samba_stable() {
+announcement_samba_stable() {
 	check_args "${FUNCNAME}" "$#" "0" || return 1
 	require_tagname "${FUNCNAME}"
 
+	load_samba_stable_versions
+
 	test -f "${tagname}.tar.gz" || {
 		echo "${tagname}.tar.gz does not exist"
 		return 1
 	}
 
+	test -f "announce.${tagname}.quotation.txt" || {
+		echo "announce.${tagname}.quotation.txt missing!"
+		return 1
+	}
+
+	local release_url="${download_url}samba/stable/"
+	local patch_url="${download_url}samba/patches/"
+


-- 
Samba Shared Repository



More information about the samba-cvs mailing list