2 # make a release of Samba or a library
15 CONF_REPO_URL
="ssh://git.samba.org/data/git/samba.git"
16 CONF_UPLOAD_URL
="samba-bugs@download-master.samba.org:/home/data/ftp/pub"
17 CONF_DOWNLOAD_URL
="https://download.samba.org/pub"
18 CONF_HISTORY_URL
="https://www.samba.org"
20 test -d ".git" -o -r ".git" ||
{
21 echo "Run this script from the top-level directory in the"
28 echo "Usage: script/release.sh <PRODUCT> <COMMAND>"
30 echo "PRODUCT: ldb, talloc, tevent, tdb, samba-rc, samba-stable"
31 echo "COMMAND: fullrelease, create, push, upload, announce"
36 test -x "script/release.sh" ||
{
38 echo "Run this script from the top-level directory in the"
39 echo "repository: as 'script/release.sh'"
49 test x
"${got_args}" = x
"${take_args}" ||
{
51 echo "cmd[${cmd}] takes ${take_args} instead of ${got_args}"
64 test "${got_args}" -ge "${min_args}" ||
{
66 echo "cmd[${cmd}] takes at least ${min_args} instead of ${got_args}"
73 min_args
"$0" "$#" "2"
86 min_args
"${FUNCNAME}" "$#" "1" ||
return 1
89 test -n "${tagname}" ||
{
90 echo "cmd[${cmd}] requires '\${tagname}' variable to be set"
94 local name
=$
(echo "${tagname}" | cut
-d '-' -f1)
95 test x
"${name}" = x
"${productbase}" ||
{
96 echo "Invalid tagname[${tgzname}]"
105 min_args
"${FUNCNAME}" "$#" "2" ||
return 1
109 echo "$@" |
grep -q "\<${cmd}\>" ||
{
118 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
121 echo "VERSION doesn't exist"
125 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION ||
{
126 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
130 grep -q '^SAMBA_VERSION_RC_RELEASE=' VERSION ||
{
131 echo "SAMBA_VERSION_RC_RELEASE= missing"
135 grep -q '^SAMBA_VERSION_RC_RELEASE=$' VERSION
&& {
136 echo "SAMBA_VERSION_RC_RELEASE= missing the rc version"
143 load_samba_stable_versions
()
145 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
147 test -n "${version-}" && {
151 local SAMBA_VERSION_MAJOR
=$
(grep '^SAMBA_VERSION_MAJOR=' VERSION | cut
-d '=' -f2 |
xargs)
152 local SAMBA_VERSION_MINOR
=$
(grep '^SAMBA_VERSION_MINOR=' VERSION | cut
-d '=' -f2 |
xargs)
153 local SAMBA_VERSION_RELEASE
=$
(grep '^SAMBA_VERSION_RELEASE=' VERSION | cut
-d '=' -f2 |
xargs)
155 version
="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
156 tagname
="${productbase}-${version}"
158 test ${SAMBA_VERSION_RELEASE} -gt 0 ||
{
162 oldversion
="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.$(expr ${SAMBA_VERSION_RELEASE} - 1)"
163 oldtagname
="${productbase}-${oldversion}"
164 patchfile
="${productbase}-${oldversion}-${version}.diffs"
169 verify_samba_stable
()
171 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
174 echo "VERSION doesn't exist"
178 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION ||
{
179 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
184 VARS
="${VARS} SAMBA_VERSION_REVISION"
185 VARS
="${VARS} SAMBA_VERSION_TP_RELEASE"
186 VARS
="${VARS} SAMBA_VERSION_ALPHA_RELEASE"
187 VARS
="${VARS} SAMBA_VERSION_BETA_RELEASE"
188 VARS
="${VARS} SAMBA_VERSION_PRE_RELEASE"
189 VARS
="${VARS} SAMBA_VERSION_RC_RELEASE"
190 VARS
="${VARS} SAMBA_VERSION_RELEASE_NICKNAME"
191 VARS
="${VARS} SAMBA_VERSION_VENDOR_SUFFIX"
192 VARS
="${VARS} SAMBA_VERSION_VENDOR_PATCH"
193 for var
in ${VARS}; do
194 grep -q "^${var}" VERSION
&& {
195 grep -q "^${var}=$" VERSION ||
{
196 echo "${var} found in stable version"
202 load_samba_stable_versions
204 test -n "${oldtagname}" ||
{
208 local verify_out
="${TMPDIR}/verify-${oldtagname}.out"
210 echo "Verifying oldtagname: ${oldtagname}"
212 git tag
-v "${oldtagname}" >${verify_out} 2>&1 ||
{
213 echo "failed to verify old tag[${oldtagname}]"
219 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
220 echo "oldtagname[${oldtagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
226 echo "Verifying ${oldtagname}.tar.gz and ${oldtagname}.tar.asc"
228 test -f "${oldtagname}.tar.gz" ||
{
229 echo "${oldtagname}.tar.gz does not exist"
233 test -f "${oldtagname}.tar.asc" ||
{
234 echo "${oldtagname}.tar.asc does not exist"
238 zcat
"${oldtagname}.tar.gz" | gpg --verify "${oldtagname}.tar.asc" - 2>${verify_out} || {
239 echo "Failed to verify
${oldtagname}.
tar.asc
"
243 grep -q "${GPG_KEYID}" "${verify_out}" || {
244 echo "${oldtagname}.
tar.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
255 check_args "${FUNCNAME}" "$#" "0" || return 1
257 test -n "${verify_fn}" || {
258 echo "verify_fn variable empty
"
262 echo "Running
${verify_fn}"
268 check_args "${FUNCNAME}" "$#" "0" || return 1
270 echo "Releasing product
${product}"
272 test -n "${tagname}" && {
273 git tag -l "${tagname}" | grep -q "${tagname}" && {
274 echo "tagname
[${tagname}] already exist
"
278 local _tgzname="${tagname}.
tar.gz
"
279 test -e "${_tgzname}" && {
280 echo "_tgzname
[${_tgzname}] already exist
"
285 echo "Building release tarball
"
286 local tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
287 test -f "${tgzname}" || {
288 echo "Failed to create tarball
"
291 CLEANUP_FILES="${CLEANUP_FILES} ${tgzname}"
293 local name=$(echo "${tgzname}" | cut -d '-' -f1)
294 test x"${name}" = x"${productbase}" || {
295 echo "Invalid tgzname
[${tgzname}]"
299 local _tagname=$(basename ${tgzname} .tar.gz)
300 test -n "${tagname}" && {
301 test x"${_tagname}" = x"${tagname}" || {
302 echo "Invalid tgzname
[${tgzname}]"
306 tagname="${_tagname}"
308 local tarname=$(basename ${tgzname} .gz)
309 echo "Tarball
: ${tarname}"
310 gunzip -f ${tgzname} || {
311 echo "Failed to decompress tarball
${tarname}"
314 test -f "${tarname}" || {
315 echo "Failed to decompress tarball
${tarname}"
318 CLEANUP_FILES="${CLEANUP_FILES} ${tarname}"
321 echo "Tagging as
${tagname}"
322 git tag -u ${GPG_KEYID} -s "${tagname}" -m "${productbase}: tag release ${tagname}" ||
{
325 CLEANUP_TAGS
="${CLEANUP_TAGS} ${tagname}"
327 echo "Signing ${tarname} => ${tarname}.asc"
328 rm -f "${tarname}.asc"
329 gpg
--default-key "${GPG_KEYID}" --detach-sign --armor ${tarname} ||
{
332 test -f "${tarname}.asc" ||
{
333 echo "Failed to create signature ${tarname}.asc"
336 CLEANUP_FILES
="${CLEANUP_FILES} ${tarname}.asc"
337 echo "Compressing ${tarname} => ${tgzname}"
338 gzip -f -9 ${tarname}
339 test -f "${tgzname}" ||
{
340 echo "Failed to compress ${tgzname}"
349 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
350 require_tagname
"${FUNCNAME}"
352 test -n "${patchfile}" ||
{
357 echo "Generating ${patchfile}"
362 tar xfz
"${oldpwd}/${oldtagname}.tar.gz"
363 tar xfz
"${oldpwd}/${tagname}.tar.gz"
364 diff -Npur "${oldtagname}/" "${tagname}/" >"${patchfile}"
367 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}"
368 mv "${TMPDIR}/${patchfile}" "${patchfile}" ||
{
369 echo "failed cmd[mv ${TMPDIR}/${patchfile} ${patchfile}]"
373 echo "Signing ${patchfile} => ${patchfile}.asc"
374 rm -f "${patchfile}.asc"
375 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}.asc"
376 gpg
--default-key "${GPG_KEYID}" --detach-sign --armor ${patchfile} ||
{
379 test -f "${patchfile}.asc" ||
{
380 echo "Failed to create signature ${patchfile}.asc"
383 echo "Compressing ${patchfile} => ${patchfile}.gz"
384 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}.gz"
385 gzip -f -9 ${patchfile}
386 test -f "${patchfile}.gz" ||
{
387 echo "Failed to compress ${patchfile}.gz"
396 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
397 require_tagname
"${FUNCNAME}"
399 echo "extract ${tagname}.WHATSNEW.txt"
400 tar xf
${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt >${tagname}.WHATSNEW.txt
401 CLEANUP_FILES
="${CLEANUP_FILES} ${tagname}.WHATSNEW.txt"
408 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
409 require_tagname
"${FUNCNAME}"
411 local verify_out
="${TMPDIR}/verify-${oldtagname}.out"
413 echo "Verifying tagname: ${tagname}"
415 git tag
-v "${tagname}" >${verify_out} 2>&1 ||
{
416 echo "failed to verify tag[${tagname}]"
421 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
422 echo "tagname[${tagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
428 echo "Verifying ${tagname}.tar.gz and ${tagname}.tar.asc"
430 test -f "${tagname}.tar.gz" ||
{
431 echo "${tagname}.tar.gz does not exist"
435 test -f "${tagname}.tar.asc" ||
{
436 echo "${tagname}.tar.asc does not exist"
440 zcat
"${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} || {
441 echo "Failed to verify
${tagname}.
tar.asc
"
444 grep -q "${GPG_KEYID}" "${verify_out}" || {
445 echo "${tagname}.
tar.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
458 check_args "${FUNCNAME}" "$#" "0" || return 1
459 require_tagname "${FUNCNAME}"
461 load_samba_stable_versions
463 local verify_out="${TMPDIR}/verify-
${oldtagname}.out
"
465 echo "Verifying tagname
: ${tagname}"
467 git tag -v "${tagname}" >${verify_out} 2>&1 || {
468 echo "failed to verify tag
[${tagname}]"
473 grep -q "${GPG_KEYID}" "${verify_out}" || {
474 echo "tagname
[${tagname}] was not generated with GPG_KEYID
[${GPG_KEYID}]!"
480 echo "Verifying
${tagname}.
tar.gz and
${tagname}.
tar.asc
"
482 test -f "${tagname}.
tar.gz
" || {
483 echo "${tagname}.
tar.gz does not exist
"
487 test -f "${tagname}.
tar.asc
" || {
488 echo "${tagname}.
tar.asc does not exist
"
492 zcat "${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} ||
{
493 echo "Failed to verify ${tagname}.tar.asc"
496 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
497 echo "${tagname}.tar.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
503 test -n "${patchfile}" ||
{
504 ls -lart ${tagname}.
*
508 echo "Verifying ${patchfile}.gz and ${patchfile}.asc"
510 test -f "${patchfile}.gz" ||
{
511 echo "${patchfile}.gz does not exist"
515 test -f "${patchfile}.asc" ||
{
516 echo "${patchfile}.asc does not exist"
520 zcat
"${patchfile}.gz" | gpg --verify "${patchfile}.asc" - 2>${verify_out} || {
521 echo "Failed to verify
${patchfile}.asc
"
524 grep -q "${GPG_KEYID}" "${verify_out}" || {
525 echo "${patchfile}.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
531 ls -lart ${tagname}.* ${patchfile}.*
537 check_args "${FUNCNAME}" "$#" "0" || return 1
539 test -n "${check_fn}" || {
540 echo "check_fn variable empty
"
544 echo "Running
${check_fn}"
550 check_args "${FUNCNAME}" "$#" "0" || return 1
551 require_tagname "${FUNCNAME}"
553 echo "Push git tag
${tagname} to
'${repo_url}'"
554 git push "${repo_url}" "refs/tags/${tagname}:refs/tags/${tagname}" || {
563 check_args "${FUNCNAME}" "$#" "0" || return 1
564 require_tagname "${FUNCNAME}"
566 echo "Upload
${tagname}.
* to
'${upload_url}'"
567 rsync -Pav --delay-updates ${tagname}.* "${upload_url}/" || {
570 rsync ${upload_url}/${tagname}.*
575 upload_samba_stable()
577 check_args "${FUNCNAME}" "$#" "0" || return 1
578 require_tagname "${FUNCNAME}"
580 load_samba_stable_versions
582 local release_url="${upload_url}samba
/stable
/"
583 local patch_url="${upload_url}samba
/patches
/"
585 echo "Upload
${tagname}.
tar.
* to
'${release_url}'"
586 ls -lart ${tagname}.tar.*
587 rsync -Pav --delay-updates ${tagname}.tar.* "${release_url}/" || {
590 rsync ${release_url}/${tagname}.tar.*
592 test -n "${patchfile}" || {
596 echo "Upload
${patchfile}.
* to
'${patch_url}'"
597 ls -lart ${patchfile}.*
598 rsync -Pav --delay-updates ${patchfile}.* "${patch_url}/" || {
601 rsync ${patch_url}/${patchfile}.*
608 check_args "${FUNCNAME}" "$#" "0" || return 1
610 test -n "${upload_fn}" || {
611 echo "upload_fn variable empty
"
615 echo "Running
${upload_fn}"
619 announcement_samba_rc()
621 check_args "${FUNCNAME}" "$#" "0" || return 1
622 require_tagname "${FUNCNAME}"
624 test -f "${tagname}.WHATSNEW.txt
" || {
625 echo "${tagname}.WHATSNEW.txt does not exist
"
630 local version=$(echo "${tagname}" | sed -e 's!^samba-!!')
631 local href="#${version}"
632 local series
=$
(echo "${version}" | cut
-d '.' -f1-2)
633 local rc
=$
(echo "${version}" |
sed -e 's!.*rc\([0-9][0-9]*\)!\1!')
634 local rcname
="${rc}th"
653 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.to.txt"
655 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
656 } >announce.
${tagname}.to.txt
658 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.subject.txt"
660 echo "[Announce] Samba ${version} Available for Download"
661 } >announce.
${tagname}.subject.txt
663 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mail.txt"
665 cat ${tagname}.WHATSNEW.txt
667 echo "================"
668 echo "Download Details"
669 echo "================"
671 echo "The uncompressed tarballs and patch files have been signed"
672 echo "using GnuPG (ID ${GPG_KEYID}). The source code can be downloaded"
675 echo " ${download_url}"
677 echo "The release notes are available online at:"
679 echo " ${download_url}${tagname}.WHATSNEW.txt"
681 echo "Our Code, Our Bugs, Our Responsibility."
682 echo "(https://bugzilla.samba.org/)"
685 echo " The Samba Team"
686 } >announce.
${tagname}.
mail.txt
688 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
690 echo -n "-i announce.${tagname}.mail.txt "
691 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
692 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
693 } >announce.
${tagname}.mutt-arguments.txt
695 local headlinefile
="posted_news/@UTCTIME@.${version}.headline.html"
696 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.headline.html"
698 echo "<!-- BEGIN: ${headlinefile} -->"
699 echo "<li> @UTCDATE@ <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
700 echo "<!-- END: ${headlinefile} -->"
701 } >announce.
${tagname}.headline.html
703 local bodyfile
="posted_news/@UTCTIME@.${version}.body.html"
704 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.body.html"
706 echo "<!-- BEGIN: ${bodyfile} -->"
707 echo "<h5><a name=\"${version}\">@UTCDATE@</a></h5>"
708 echo "<p class="headline
">Samba ${version} Available for Download</p>"
710 echo "This is the ${rcname} release candidate of the upcoming Samba ${series} release series."
713 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
714 echo "The source code can be <a href=\"${download_url}${tagname}.tar.gz\">downloaded now</a>."
715 echo "See <a href=\"${download_url}${tagname}.WHATSNEW.txt\">the release notes for more info</a>."
717 echo "<!-- END: ${bodyfile} -->"
718 } >announce.
${tagname}.body.html
720 local webrepo
="${TMPDIR}/webrepo"
722 mkdir
"${webrepo}" ||
{
725 git
-C "${webrepo}" init ||
{
729 mkdir
-p "$(dirname ${webrepo}/${headlinefile})" ||
{
732 cp -a "announce.${tagname}.headline.html" "${webrepo}/${headlinefile}" ||
{
736 mkdir
-p "$(dirname ${webrepo}/${bodyfile})" ||
{
739 cp -a "announce.${tagname}.body.html" "${webrepo}/${bodyfile}" ||
{
743 git
-C "${webrepo}" add "${headlinefile}" "${bodyfile}" ||
{
746 git
-C "${webrepo}" commit --signoff --message "NEWS[${version}]: Samba ${version} Available for Download" ||
{
749 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.patch.txt"
750 git
-C "${webrepo}" format-patch
--stdout -1 HEAD
>announce.
${tagname}.
patch.txt ||
{
754 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.todo.txt"
756 ls -lart announce.
${tagname}.
*
759 echo "You need to do the following manual steps in order"
760 echo "to finish the announcement of ${tagname}!"
762 echo "Change to a samba-web checkout and run"
763 echo " ./announce_samba_release.sh ${version} $(pwd)/announce.${tagname}.patch.txt"
765 echo "Once the resulting commit is pushed a cron job will update "
766 echo "the content exported by the webserver every 5-10 mins."
767 echo "Check https://www.samba.org"
769 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
770 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
771 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
772 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
773 echo "In case your're using mutt, you can use the following shortcut:"
774 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
776 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
777 echo "See: announce.${tagname}.todo.txt"
779 } >announce.
${tagname}.todo.txt
781 ls -lart announce.
${tagname}.
*
785 announcement_samba_stable
()
787 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
788 require_tagname
"${FUNCNAME}"
790 load_samba_stable_versions
792 test -f "${tagname}.tar.gz" ||
{
793 echo "${tagname}.tar.gz does not exist"
797 local release_url
="${download_url}samba/stable/"
798 local patch_url
="${download_url}samba/patches/"
800 echo "extract WHATSNEW.txt"
801 tar xf
${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt >${TMPDIR}/WHATSNEW.txt
804 local oldversion
=$
(echo "${oldtagname}" |
sed -e 's!^samba-!!')
805 local version
=$
(echo "${tagname}" |
sed -e 's!^samba-!!')
806 local href
="#${version}"
807 local series
=$
(echo "${version}" | cut
-d '.' -f1-2)
808 local release
=$
(echo "${version}" | cut
-d '.' -f3)
809 local releasename
="latest"
819 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.to.txt"
821 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
822 } >announce.
${tagname}.to.txt
824 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.subject.txt"
826 echo "[Announce] Samba ${version} Available for Download"
827 } >announce.
${tagname}.subject.txt
829 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mail.txt"
831 local top
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^Release notes for older releases follow:' |
head -1 | cut
-d ':' -f1)
832 test -n "${top}" ||
{
833 top
=$
(cat ${TMPDIR}/WHATSNEW.txt |
wc -l)
835 local skip
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^[^ ]' |
head -1 | cut
-d ':' -f1)
836 local headlimit
=$
(expr ${top} - 1)
837 local taillimit
=$
(expr ${headlimit} - \
( ${skip} - 1 \
))
841 echo "Release Announcements"
842 echo "---------------------"
844 head -${headlimit} ${TMPDIR}/WHATSNEW.txt | tail -${taillimit}
846 echo "================"
847 echo "Download Details"
848 echo "================"
850 echo "The uncompressed tarballs and patch files have been signed"
851 echo "using GnuPG (ID ${GPG_KEYID}). The source code can be downloaded"
854 echo " ${release_url}"
856 echo "The release notes are available online at:"
858 echo " ${history_url}${tagname}.html"
860 echo "Our Code, Our Bugs, Our Responsibility."
861 echo "(https://bugzilla.samba.org/)"
864 echo " The Samba Team"
865 } >announce.
${tagname}.
mail.txt
867 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
869 echo -n "-i announce.${tagname}.mail.txt "
870 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
871 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
872 } >announce.
${tagname}.mutt-arguments.txt
874 local htmlfile
="history/${tagname}.html"
875 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.html"
877 local tmp
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^Reporting bugs & Development Discussion' |
head -1 | cut
-d ':' -f1)
878 local lines
=$
(expr ${tmp} - 2)
880 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
881 echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
882 echo '<html xmlns="http://www.w3.org/1999/xhtml">'
885 echo "<title>Samba ${version} - Release Notes</title>"
889 echo "<H2>Samba ${version} Available for Download</H2>"
892 echo "<a href=\"${release_url}${tagname}.tar.gz\">Samba ${version} (gzipped)</a><br>"
893 echo "<a href=\"${release_url}${tagname}.tar.asc\">Signature</a>"
896 test -n "${patchfile}" && {
898 echo "<a href=\"${patch_url}${patchfile}.gz\">Patch (gzipped) against Samba ${oldversion}</a><br>"
899 echo "<a href=\"${patch_url}${patchfile}.asc\">Signature</a>"
905 head -${lines} ${TMPDIR}/WHATSNEW.txt |
sed \
906 -e 's!&!\&!g' |
sed \
909 -e 's!ä!\ä!g' \
910 -e 's!Ä!\Ä!g' \
911 -e 's!ö!\ö!g' \
912 -e 's!Ö!\Ö!g' \
913 -e 's!ü!\ü!g' \
914 -e 's!Ãœ!\Ü!g' \
915 -e 's!ß!\ß!g' \
924 } >announce.
${tagname}.html
926 local headlinefile
="posted_news/@UTCTIME@.${version}.headline.html"
927 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.headline.html"
929 echo "<!-- BEGIN: ${headlinefile} -->"
930 echo "<li> @UTCDATE@ <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
931 echo "<!-- END: ${headlinefile} -->"
932 } >announce.
${tagname}.headline.html
934 local bodyfile
="posted_news/@UTCTIME@.${version}.body.html"
935 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.body.html"
937 echo "<!-- BEGIN: ${bodyfile} -->"
938 echo "<h5><a name=\"${version}\">@UTCDATE@</a></h5>"
939 echo "<p class="headline
">Samba ${version} Available for Download</p>"
941 echo "This is the ${releasename} stable release of the Samba ${series} release series."
944 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
945 echo "The source code can be <a href=\"${release_url}${tagname}.tar.gz\">downloaded now</a>."
946 test -n "${patchfile}" && {
947 echo "A <a href=\"${patch_url}${patchfile}.gz\">patch against Samba ${oldversion}</a> is also available."
949 echo "See <a href=\"${history_url}${tagname}.html\">the release notes for more info</a>."
951 echo "<!-- END: ${bodyfile} -->"
952 } >announce.
${tagname}.body.html
954 local webrepo
="${TMPDIR}/webrepo"
956 mkdir
"${webrepo}" ||
{
959 git
-C "${webrepo}" init ||
{
963 mkdir
-p "$(dirname ${webrepo}/${htmlfile})" ||
{
966 cp -a "announce.${tagname}.html" "${webrepo}/${htmlfile}" ||
{
970 mkdir
-p "$(dirname ${webrepo}/${headlinefile})" ||
{
973 cp -a "announce.${tagname}.headline.html" "${webrepo}/${headlinefile}" ||
{
977 mkdir
-p "$(dirname ${webrepo}/${bodyfile})" ||
{
980 cp -a "announce.${tagname}.body.html" "${webrepo}/${bodyfile}" ||
{
984 git
-C "${webrepo}" add "${htmlfile}" "${headlinefile}" "${bodyfile}" ||
{
987 git
-C "${webrepo}" commit --signoff --message "NEWS[${version}]: Samba ${version} Available for Download" ||
{
990 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.patch.txt"
991 git
-C "${webrepo}" format-patch
--stdout -1 HEAD
>announce.
${tagname}.
patch.txt ||
{
995 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.todo.txt"
997 ls -lart announce.
${tagname}.
*
1000 echo "You need to do the following manual steps in order"
1001 echo "to finish the announcement of ${tagname}!"
1003 echo "Change to a samba-web checkout and run"
1004 echo " ./announce_samba_release.sh ${version} $(pwd)/announce.${tagname}.patch.txt"
1006 echo "Once the resulting commit is pushed a cron job will update "
1007 echo "the content exported by the webserver every 5-10 mins."
1008 echo "Check https://www.samba.org"
1010 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
1011 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
1012 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
1013 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
1014 echo "In case your're using mutt, you can use the following shortcut:"
1015 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
1017 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
1018 echo "See: announce.${tagname}.todo.txt"
1020 } >announce.
${tagname}.todo.txt
1022 ls -lart announce.
${tagname}.
*
1026 announcement_release
()
1028 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
1030 test -n "${announcement_fn}" ||
{
1031 echo "announcement_fn variable empty"
1035 echo "Running ${announcement_fn}"
1041 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
1042 require_tagname
"${FUNCNAME}"
1044 test -f "announce.${tagname}.todo.txt" ||
{
1045 echo "announce.${tagname}.todo.txt does not exist"
1049 cat announce.
${tagname}.todo.txt
1053 case "${product}" in
1054 talloc | tdb | tevent | ldb
)
1055 test -z "${GPG_USER-}" && {
1056 GPG_USER
='Samba Library Distribution Key <samba-bugs@samba.org>'
1059 test -z "${GPG_KEYID-}" && {
1060 GPG_KEYID
='4793916113084025'
1063 productbase
="${product}"
1064 srcdir
="lib/${product}"
1065 repo_url
="${CONF_REPO_URL}"
1066 upload_url
="${CONF_UPLOAD_URL}/${product}/"
1067 download_url
="${CONF_DOWNLOAD_URL}/${product}/"
1069 check_fn
="check_nopatch"
1070 upload_fn
="upload_nopatch"
1071 fullcmds
="create check push upload"
1074 test -z "${GPG_USER-}" && {
1075 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1078 test -z "${GPG_KEYID-}" && {
1079 GPG_KEYID
='AA99442FB680B620'
1084 repo_url
="${CONF_REPO_URL}"
1085 upload_url
="${CONF_UPLOAD_URL}/samba/rc/"
1086 download_url
="${CONF_DOWNLOAD_URL}/samba/rc/"
1088 verify_fn
="verify_samba_rc"
1089 check_fn
="check_nopatch"
1090 upload_fn
="upload_nopatch"
1091 announcement_fn
="announcement_samba_rc"
1092 fullcmds
="verify create check whatsnew announcement push upload announce"
1095 test -z "${GPG_USER-}" && {
1096 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1099 test -z "${GPG_KEYID-}" && {
1100 GPG_KEYID
='AA99442FB680B620'
1105 repo_url
="${CONF_REPO_URL}"
1106 upload_url
="${CONF_UPLOAD_URL}/"
1107 download_url
="${CONF_DOWNLOAD_URL}/"
1108 history_url
="${CONF_HISTORY_URL}/samba/history/"
1110 verify_fn
="verify_samba_stable"
1111 check_fn
="check_samba_stable"
1112 upload_fn
="upload_samba_stable"
1113 announcement_fn
="announcement_samba_stable"
1114 fullcmds
="verify create patch check announcement push upload announce"
1116 TODO-samba-security
)
1117 test -z "${GPG_USER-}" && {
1118 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1121 test -z "${GPG_KEYID-}" && {
1122 GPG_KEYID
='AA99442FB680B620'
1127 repo_url
="${CONF_REPO_URL}"
1128 upload_url
="${CONF_UPLOAD_URL}/"
1129 download_url
="${CONF_DOWNLOAD_URL}/"
1130 history_url
="${CONF_HISTORY_URL}/samba/history/"
1132 verify_fn
="verify_samba_stable"
1133 check_fn
="check_samba_stable"
1134 upload_fn
="upload_samba_stable"
1135 announcement_fn
="announcement_samba_security"
1136 fullcmds
="verify create patch check announcement"
1141 echo "Unknown product ${product}"
1146 pushd ${srcdir} ||
{
1147 echo "srcdir[${srcdir}] does not exist"
1154 echo "ERROR: cleaning up"
1157 for t
in ${CLEANUP_TAGS}; do
1158 echo "Removing tag[${t}]"
1159 git tag
-v "${t}" && {
1160 git tag
-d "${t}" ||
{
1161 echo "failed to remove tag ${t}"
1166 for f
in ${CLEANUP_FILES}; do
1167 echo "Removing file[${f}]"
1170 echo "failed to remove ${f}"
1175 for d
in ${CLEANUP_DIRS}; do
1176 echo "Removing dir[${d}]"
1179 echo "failed to remove ${d}"
1188 trap trap_handler INT QUIT TERM EXIT
1190 cmd_allowed
"${globalcmd}" fullrelease
${fullcmds} ||
{
1192 echo "command[${globalcmd}] not supported for product[${product}]"
1196 case "${globalcmd}" in
1198 check_args
"${globalcmd}" "$#" "0" ||
exit 1
1202 check_args
"${globalcmd}" "$#" "0" ||
exit 1
1203 check_args
"create" "$#" "0" ||
exit 1
1206 cmd_allowed
"verify" ${fullcmds} && {
1207 cmds
="${cmds} verify"
1209 cmds
="${cmds} create"
1210 cmd_allowed
"whatsnew" ${fullcmds} && {
1211 cmds
="${cmds} whatsnew"
1213 cmd_allowed
"patch" ${fullcmds} && {
1214 cmds
="${cmds} patch"
1216 cmds
="${cmds} check"
1217 cmd_allowed
"announcement" ${fullcmds} && {
1218 cmds
="${cmds} announcement"
1223 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1229 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1232 cmd_allowed
"announce" ${fullcmds} && {
1237 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1239 cmds
="check announce"
1243 echo "Unknown command ${globalcmd}"
1249 CLEANUP_DIRS
="${CLEANUP_DIRS} ${TMPDIR}"
1254 for cmd
in ${cmds}; do
1255 echo "Starting subcommand[${cmd}]"
1257 echo "Failed subcommand[${cmd}]"
1260 echo "Finished subcommand[${cmd}]"
1263 test -d "${TMPDIR}" && {
1264 rm -rf "${TMPDIR}" ||
{
1265 echo "failed to remove ${TMPDIR}"
1269 test -n "${next_cmd}" && {
1270 echo "Continue with '$0 ${product} ${next_cmd} ${tagname}'."
1273 trap - INT QUIT TERM EXIT