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"
27 echo "Usage: script/release.sh <PRODUCT> <COMMAND>"
29 echo "PRODUCT: ldb, talloc, tevent, tdb, samba-rc, samba-stable"
30 echo "COMMAND: fullrelease, create, push, upload, announce"
35 test -x "script/release.sh" ||
{
37 echo "Run this script from the top-level directory in the"
38 echo "repository: as 'script/release.sh'"
47 test x
"${got_args}" = x
"${take_args}" ||
{
49 echo "cmd[${cmd}] takes ${take_args} instead of ${got_args}"
61 test "${got_args}" -ge "${min_args}" ||
{
63 echo "cmd[${cmd}] takes at least ${min_args} instead of ${got_args}"
70 min_args
"$0" "$#" "2"
82 min_args
"${FUNCNAME}" "$#" "1" ||
return 1
85 test -n "${tagname}" ||
{
86 echo "cmd[${cmd}] requires '\${tagname}' variable to be set"
90 local name
=$
(echo "${tagname}" | cut
-d '-' -f1)
91 test x
"${name}" = x
"${productbase}" ||
{
92 echo "Invalid tagname[${tgzname}]"
100 min_args
"${FUNCNAME}" "$#" "2" ||
return 1
104 echo "$@" |
grep -q "\<${cmd}\>" ||
{
112 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
115 echo "VERSION doesn't exist"
119 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION ||
{
120 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
124 grep -q '^SAMBA_VERSION_RC_RELEASE=' VERSION ||
{
125 echo "SAMBA_VERSION_RC_RELEASE= missing"
129 grep -q '^SAMBA_VERSION_RC_RELEASE=$' VERSION
&& {
130 echo "SAMBA_VERSION_RC_RELEASE= missing the rc version"
137 load_samba_stable_versions
() {
138 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
140 test -n "${version-}" && {
144 local SAMBA_VERSION_MAJOR
=$
(grep '^SAMBA_VERSION_MAJOR=' VERSION | cut
-d '=' -f2 |
xargs)
145 local SAMBA_VERSION_MINOR
=$
(grep '^SAMBA_VERSION_MINOR=' VERSION | cut
-d '=' -f2 |
xargs)
146 local SAMBA_VERSION_RELEASE
=$
(grep '^SAMBA_VERSION_RELEASE=' VERSION | cut
-d '=' -f2 |
xargs)
148 version
="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
149 tagname
="${productbase}-${version}"
151 test ${SAMBA_VERSION_RELEASE} -gt 0 ||
{
155 oldversion
="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.$(expr ${SAMBA_VERSION_RELEASE} - 1)"
156 oldtagname
="${productbase}-${oldversion}"
157 patchfile
="${productbase}-${oldversion}-${version}.diffs"
162 verify_samba_stable
() {
163 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
166 echo "VERSION doesn't exist"
170 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION ||
{
171 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
176 VARS
="${VARS} SAMBA_VERSION_REVISION"
177 VARS
="${VARS} SAMBA_VERSION_TP_RELEASE"
178 VARS
="${VARS} SAMBA_VERSION_ALPHA_RELEASE"
179 VARS
="${VARS} SAMBA_VERSION_BETA_RELEASE"
180 VARS
="${VARS} SAMBA_VERSION_PRE_RELEASE"
181 VARS
="${VARS} SAMBA_VERSION_RC_RELEASE"
182 VARS
="${VARS} SAMBA_VERSION_RELEASE_NICKNAME"
183 VARS
="${VARS} SAMBA_VERSION_VENDOR_SUFFIX"
184 VARS
="${VARS} SAMBA_VERSION_VENDOR_PATCH"
185 for var
in ${VARS}; do
186 grep -q "^${var}" VERSION
&& {
187 grep -q "^${var}=$" VERSION ||
{
188 echo "${var} found in stable version"
194 load_samba_stable_versions
196 test -n "${oldtagname}" ||
{
200 local verify_out
="${TMPDIR}/verify-${oldtagname}.out"
202 echo "Verifying oldtagname: ${oldtagname}"
204 git tag
-v "${oldtagname}" >${verify_out} 2>&1 ||
{
205 echo "failed to verify old tag[${oldtagname}]"
211 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
212 echo "oldtagname[${oldtagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
218 echo "Verifying ${oldtagname}.tar.gz and ${oldtagname}.tar.asc"
220 test -f "${oldtagname}.tar.gz" ||
{
221 echo "${oldtagname}.tar.gz does not exist"
225 test -f "${oldtagname}.tar.asc" ||
{
226 echo "${oldtagname}.tar.asc does not exist"
230 zcat
"${oldtagname}.tar.gz" | gpg --verify "${oldtagname}.tar.asc" - 2>${verify_out} || {
231 echo "Failed to verify
${oldtagname}.
tar.asc
"
235 grep -q "${GPG_KEYID}" "${verify_out}" || {
236 echo "${oldtagname}.
tar.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
246 check_args "${FUNCNAME}" "$#" "0" || return 1
248 test -n "${verify_fn}" || {
249 echo "verify_fn variable empty
"
253 echo "Running
${verify_fn}"
258 check_args "${FUNCNAME}" "$#" "0" || return 1
260 echo "Releasing product
${product}"
262 test -n "${tagname}" && {
263 git tag -l "${tagname}" | grep -q "${tagname}" && {
264 echo "tagname
[${tagname}] already exist
"
268 local _tgzname="${tagname}.
tar.gz
"
269 test -e "${_tgzname}" && {
270 echo "_tgzname
[${_tgzname}] already exist
"
275 echo "Building release tarball
"
276 local tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
277 test -f "${tgzname}" || {
278 echo "Failed to create tarball
"
281 CLEANUP_FILES="${CLEANUP_FILES} ${tgzname}"
283 local name=$(echo "${tgzname}" | cut -d '-' -f1)
284 test x"${name}" = x"${productbase}" || {
285 echo "Invalid tgzname
[${tgzname}]"
289 local _tagname=$(basename ${tgzname} .tar.gz)
290 test -n "${tagname}" && {
291 test x"${_tagname}" = x"${tagname}" || {
292 echo "Invalid tgzname
[${tgzname}]"
296 tagname="${_tagname}"
298 local tarname=$(basename ${tgzname} .gz)
299 echo "Tarball
: ${tarname}"
300 gunzip -f ${tgzname} || {
301 echo "Failed to decompress tarball
${tarname}"
304 test -f "${tarname}" || {
305 echo "Failed to decompress tarball
${tarname}"
308 CLEANUP_FILES="${CLEANUP_FILES} ${tarname}"
311 echo "Tagging as
${tagname}"
312 git tag -u ${GPG_KEYID} -s "${tagname}" -m "${productbase}: tag release ${tagname}" ||
{
315 CLEANUP_TAGS
="${CLEANUP_TAGS} ${tagname}"
317 echo "Signing ${tarname} => ${tarname}.asc"
318 rm -f "${tarname}.asc"
319 gpg
-u "${GPG_USER}" --detach-sign --armor ${tarname} ||
{
322 test -f "${tarname}.asc" ||
{
323 echo "Failed to create signature ${tarname}.asc"
326 CLEANUP_FILES
="${CLEANUP_FILES} ${tarname}.asc"
327 echo "Compressing ${tarname} => ${tgzname}"
328 gzip -f -9 ${tarname}
329 test -f "${tgzname}" ||
{
330 echo "Failed to compress ${tgzname}"
338 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
339 require_tagname
"${FUNCNAME}"
341 test -n "${patchfile}" ||
{
346 echo "Generating ${patchfile}"
351 tar xfz
"${oldpwd}/${oldtagname}.tar.gz"
352 tar xfz
"${oldpwd}/${tagname}.tar.gz"
353 diff -Npur "${oldtagname}/" "${tagname}/" > "${patchfile}"
356 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}"
357 mv "${TMPDIR}/${patchfile}" "${patchfile}" ||
{
358 echo "failed cmd[mv ${TMPDIR}/${patchfile} ${patchfile}]"
362 echo "Signing ${patchfile} => ${patchfile}.asc"
363 rm -f "${patchfile}.asc"
364 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}.asc"
365 gpg
-u "${GPG_USER}" --detach-sign --armor ${patchfile} ||
{
368 test -f "${patchfile}.asc" ||
{
369 echo "Failed to create signature ${patchfile}.asc"
372 echo "Compressing ${patchfile} => ${patchfile}.gz"
373 CLEANUP_FILES
="${CLEANUP_FILES} ${patchfile}.gz"
374 gzip -f -9 ${patchfile}
375 test -f "${patchfile}.gz" ||
{
376 echo "Failed to compress ${patchfile}.gz"
384 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
385 require_tagname
"${FUNCNAME}"
387 echo "extract ${tagname}.WHATSNEW.txt"
388 tar xf
${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt > ${tagname}.WHATSNEW.txt
389 CLEANUP_FILES
="${CLEANUP_FILES} ${tagname}.WHATSNEW.txt"
395 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
396 require_tagname
"${FUNCNAME}"
398 local verify_out
="${TMPDIR}/verify-${oldtagname}.out"
400 echo "Verifying tagname: ${tagname}"
402 git tag
-v "${tagname}" >${verify_out} 2>&1 ||
{
403 echo "failed to verify tag[${tagname}]"
408 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
409 echo "tagname[${tagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
415 echo "Verifying ${tagname}.tar.gz and ${tagname}.tar.asc"
417 test -f "${tagname}.tar.gz" ||
{
418 echo "${tagname}.tar.gz does not exist"
422 test -f "${tagname}.tar.asc" ||
{
423 echo "${tagname}.tar.asc does not exist"
427 zcat
"${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} || {
428 echo "Failed to verify
${tagname}.
tar.asc
"
431 grep -q "${GPG_KEYID}" "${verify_out}" || {
432 echo "${tagname}.
tar.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
443 check_samba_stable() {
444 check_args "${FUNCNAME}" "$#" "0" || return 1
445 require_tagname "${FUNCNAME}"
447 load_samba_stable_versions
449 local verify_out="${TMPDIR}/verify-
${oldtagname}.out
"
451 echo "Verifying tagname
: ${tagname}"
453 git tag -v "${tagname}" >${verify_out} 2>&1 || {
454 echo "failed to verify tag
[${tagname}]"
459 grep -q "${GPG_KEYID}" "${verify_out}" || {
460 echo "tagname
[${tagname}] was not generated with GPG_KEYID
[${GPG_KEYID}]!"
466 echo "Verifying
${tagname}.
tar.gz and
${tagname}.
tar.asc
"
468 test -f "${tagname}.
tar.gz
" || {
469 echo "${tagname}.
tar.gz does not exist
"
473 test -f "${tagname}.
tar.asc
" || {
474 echo "${tagname}.
tar.asc does not exist
"
478 zcat "${tagname}.tar.gz" | gpg --verify "${tagname}.tar.asc" - 2>${verify_out} ||
{
479 echo "Failed to verify ${tagname}.tar.asc"
482 grep -q "${GPG_KEYID}" "${verify_out}" ||
{
483 echo "${tagname}.tar.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
489 test -n "${patchfile}" ||
{
490 ls -lart ${tagname}.
*
494 echo "Verifying ${patchfile}.gz and ${patchfile}.asc"
496 test -f "${patchfile}.gz" ||
{
497 echo "${patchfile}.gz does not exist"
501 test -f "${patchfile}.asc" ||
{
502 echo "${patchfile}.asc does not exist"
506 zcat
"${patchfile}.gz" | gpg --verify "${patchfile}.asc" - 2>${verify_out} || {
507 echo "Failed to verify
${patchfile}.asc
"
510 grep -q "${GPG_KEYID}" "${verify_out}" || {
511 echo "${patchfile}.asc was not generated with GPG_KEYID
[${GPG_KEYID}]!"
517 ls -lart ${tagname}.* ${patchfile}.*
522 check_args "${FUNCNAME}" "$#" "0" || return 1
524 test -n "${check_fn}" || {
525 echo "check_fn variable empty
"
529 echo "Running
${check_fn}"
534 check_args "${FUNCNAME}" "$#" "0" || return 1
535 require_tagname "${FUNCNAME}"
537 echo "Push git tag
${tagname} to
'${repo_url}'"
538 git push "${repo_url}" "refs/tags/${tagname}:refs/tags/${tagname}" || {
546 check_args "${FUNCNAME}" "$#" "0" || return 1
547 require_tagname "${FUNCNAME}"
549 echo "Upload
${tagname}.
* to
'${upload_url}'"
550 rsync -Pav --delay-updates ${tagname}.* "${upload_url}/" || {
553 rsync ${upload_url}/${tagname}.*
558 upload_samba_stable() {
559 check_args "${FUNCNAME}" "$#" "0" || return 1
560 require_tagname "${FUNCNAME}"
562 load_samba_stable_versions
564 local release_url="${upload_url}samba
/stable
/"
565 local patch_url="${upload_url}samba
/patches
/"
567 echo "Upload
${tagname}.
tar.
* to
'${release_url}'"
568 ls -lart ${tagname}.tar.*
569 rsync -Pav --delay-updates ${tagname}.tar.* "${release_url}/" || {
572 rsync ${release_url}/${tagname}.tar.*
574 test -n "${patchfile}" || {
578 echo "Upload
${patchfile}.
* to
'${patch_url}'"
579 ls -lart ${patchfile}.*
580 rsync -Pav --delay-updates ${patchfile}.* "${patch_url}/" || {
583 rsync ${patch_url}/${patchfile}.*
589 check_args "${FUNCNAME}" "$#" "0" || return 1
591 test -n "${upload_fn}" || {
592 echo "upload_fn variable empty
"
596 echo "Running
${upload_fn}"
600 announcement_samba_rc() {
601 check_args "${FUNCNAME}" "$#" "0" || return 1
602 require_tagname "${FUNCNAME}"
604 test -f "${tagname}.WHATSNEW.txt
" || {
605 echo "${tagname}.WHATSNEW.txt does not exist
"
610 local version=$(echo "${tagname}" | sed -e 's!^samba-!!')
611 local href="#${version}"
612 local series
=$
(echo "${version}" | cut
-d '.' -f1-2)
613 local rc
=$
(echo "${version}" |
sed -e 's!.*rc\([0-9][0-9]*\)!\1!')
614 local rcname
="${rc}th"
633 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.to.txt"
635 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
636 } > announce.
${tagname}.to.txt
638 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.subject.txt"
640 echo "[Announce] Samba ${version} Available for Download"
641 } > announce.
${tagname}.subject.txt
643 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mail.txt"
645 cat ${tagname}.WHATSNEW.txt
647 echo "================"
648 echo "Download Details"
649 echo "================"
651 echo "The uncompressed tarballs and patch files have been signed"
652 echo "using GnuPG (ID ${GPG_KEYID}). The source code can be downloaded"
655 echo " ${download_url}"
657 echo "The release notes are available online at:"
659 echo " ${download_url}${tagname}.WHATSNEW.txt"
661 echo "Our Code, Our Bugs, Our Responsibility."
662 echo "(https://bugzilla.samba.org/)"
665 echo " The Samba Team"
666 } > announce.
${tagname}.
mail.txt
668 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
670 echo -n "-i announce.${tagname}.mail.txt "
671 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
672 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
673 } > announce.
${tagname}.mutt-arguments.txt
675 local headlinefile
="posted_news/@UTCTIME@.${version}.headline.html"
676 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.headline.html"
678 echo "<!-- BEGIN: ${headlinefile} -->"
679 echo "<li> @UTCDATE@ <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
680 echo "<!-- END: ${headlinefile} -->"
681 } > announce.
${tagname}.headline.html
683 local bodyfile
="posted_news/@UTCTIME@.${version}.body.html"
684 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.body.html"
686 echo "<!-- BEGIN: ${bodyfile} -->"
687 echo "<h5><a name=\"${version}\">@UTCDATE@</a></h5>"
688 echo "<p class="headline
">Samba ${version} Available for Download</p>"
690 echo "This is the ${rcname} release candidate of the upcoming Samba ${series} release series."
693 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
694 echo "The source code can be <a href=\"${download_url}${tagname}.tar.gz\">downloaded now</a>."
695 echo "See <a href=\"${download_url}${tagname}.WHATSNEW.txt\">the release notes for more info</a>."
697 echo "<!-- END: ${bodyfile} -->"
698 } > announce.
${tagname}.body.html
700 local webrepo
="${TMPDIR}/webrepo"
702 mkdir
"${webrepo}" ||
{
705 git
-C "${webrepo}" init ||
{
709 mkdir
-p "$(dirname ${webrepo}/${headlinefile})" ||
{
712 cp -a "announce.${tagname}.headline.html" "${webrepo}/${headlinefile}" ||
{
716 mkdir
-p "$(dirname ${webrepo}/${bodyfile})" ||
{
719 cp -a "announce.${tagname}.body.html" "${webrepo}/${bodyfile}" ||
{
723 git
-C "${webrepo}" add "${headlinefile}" "${bodyfile}" ||
{
726 git
-C "${webrepo}" commit --signoff --message "NEWS[${version}]: Samba ${version} Available for Download" ||
{
729 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.patch.txt"
730 git
-C "${webrepo}" format-patch
--stdout -1 HEAD
> announce.
${tagname}.
patch.txt ||
{
734 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.todo.txt"
736 ls -lart announce.
${tagname}.
*
739 echo "You need to do the following manual steps in order"
740 echo "to finish the announcement of ${tagname}!"
742 echo "Change to a samba-web checkout and run"
743 echo " ./announce_samba_release.sh ${version} $(pwd)/announce.${tagname}.patch.txt"
745 echo "Once the resulting commit is pushed a cron job will update "
746 echo "the content exported by the webserver every 5-10 mins."
747 echo "Check https://www.samba.org"
749 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
750 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
751 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
752 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
753 echo "In case your're using mutt, you can use the following shortcut:"
754 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
756 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
757 echo "See: announce.${tagname}.todo.txt"
759 } > announce.
${tagname}.todo.txt
761 ls -lart announce.
${tagname}.
*
765 announcement_samba_stable
() {
766 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
767 require_tagname
"${FUNCNAME}"
769 load_samba_stable_versions
771 test -f "${tagname}.tar.gz" ||
{
772 echo "${tagname}.tar.gz does not exist"
776 local release_url
="${download_url}samba/stable/"
777 local patch_url
="${download_url}samba/patches/"
779 echo "extract WHATSNEW.txt"
780 tar xf
${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt > ${TMPDIR}/WHATSNEW.txt
783 local oldversion
=$
(echo "${oldtagname}" |
sed -e 's!^samba-!!')
784 local version
=$
(echo "${tagname}" |
sed -e 's!^samba-!!')
785 local href
="#${version}"
786 local series
=$
(echo "${version}" | cut
-d '.' -f1-2)
787 local release
=$
(echo "${version}" | cut
-d '.' -f3)
788 local releasename
="latest"
798 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.to.txt"
800 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
801 } > announce.
${tagname}.to.txt
803 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.subject.txt"
805 echo "[Announce] Samba ${version} Available for Download"
806 } > announce.
${tagname}.subject.txt
808 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mail.txt"
810 local top
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^Release notes for older releases follow:' |
head -1 | cut
-d ':' -f1)
811 test -n "${top}" ||
{
812 top
=$
(cat ${TMPDIR}/WHATSNEW.txt |
wc -l)
814 local skip
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^[^ ]' |
head -1 | cut
-d ':' -f1)
815 local headlimit
=$
(expr ${top} - 1 )
816 local taillimit
=$
(expr ${headlimit} - \
( ${skip} - 1 \
))
820 echo "Release Announcements"
821 echo "---------------------"
823 head -${headlimit} ${TMPDIR}/WHATSNEW.txt | tail -${taillimit}
825 echo "================"
826 echo "Download Details"
827 echo "================"
829 echo "The uncompressed tarballs and patch files have been signed"
830 echo "using GnuPG (ID ${GPG_KEYID}). The source code can be downloaded"
833 echo " ${release_url}"
835 echo "The release notes are available online at:"
837 echo " ${history_url}${tagname}.html"
839 echo "Our Code, Our Bugs, Our Responsibility."
840 echo "(https://bugzilla.samba.org/)"
843 echo " The Samba Team"
844 } > announce.
${tagname}.
mail.txt
846 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
848 echo -n "-i announce.${tagname}.mail.txt "
849 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
850 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
851 } > announce.
${tagname}.mutt-arguments.txt
853 local htmlfile
="history/${tagname}.html"
854 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.html"
856 local tmp
=$
(cat ${TMPDIR}/WHATSNEW.txt |
grep -n '^Reporting bugs & Development Discussion' |
head -1 | cut
-d ':' -f1)
857 local lines
=$
(expr ${tmp} - 2)
859 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
860 echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
861 echo '<html xmlns="http://www.w3.org/1999/xhtml">'
864 echo "<title>Samba ${version} - Release Notes</title>"
868 echo "<H2>Samba ${version} Available for Download</H2>"
871 echo "<a href=\"${release_url}${tagname}.tar.gz\">Samba ${version} (gzipped)</a><br>"
872 echo "<a href=\"${release_url}${tagname}.tar.asc\">Signature</a>"
875 test -n "${patchfile}" && {
877 echo "<a href=\"${patch_url}${patchfile}.gz\">Patch (gzipped) against Samba ${oldversion}</a><br>"
878 echo "<a href=\"${patch_url}${patchfile}.asc\">Signature</a>"
884 head -${lines} ${TMPDIR}/WHATSNEW.txt |
sed \
885 -e 's!&!\&!g' |
sed \
888 -e 's!ä!\ä!g' \
889 -e 's!Ä!\Ä!g' \
890 -e 's!ö!\ö!g' \
891 -e 's!Ö!\Ö!g' \
892 -e 's!ü!\ü!g' \
893 -e 's!Ãœ!\Ü!g' \
894 -e 's!ß!\ß!g' \
903 } > announce.
${tagname}.html
905 local headlinefile
="posted_news/@UTCTIME@.${version}.headline.html"
906 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.headline.html"
908 echo "<!-- BEGIN: ${headlinefile} -->"
909 echo "<li> @UTCDATE@ <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
910 echo "<!-- END: ${headlinefile} -->"
911 } > announce.
${tagname}.headline.html
913 local bodyfile
="posted_news/@UTCTIME@.${version}.body.html"
914 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.body.html"
916 echo "<!-- BEGIN: ${bodyfile} -->"
917 echo "<h5><a name=\"${version}\">@UTCDATE@</a></h5>"
918 echo "<p class="headline
">Samba ${version} Available for Download</p>"
920 echo "This is the ${releasename} stable release of the Samba ${series} release series."
923 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
924 echo "The source code can be <a href=\"${release_url}${tagname}.tar.gz\">downloaded now</a>."
925 test -n "${patchfile}" && {
926 echo "A <a href=\"${patch_url}${patchfile}.gz\">patch against Samba ${oldversion}</a> is also available."
928 echo "See <a href=\"${history_url}${tagname}.html\">the release notes for more info</a>."
930 echo "<!-- END: ${bodyfile} -->"
931 } > announce.
${tagname}.body.html
933 local webrepo
="${TMPDIR}/webrepo"
935 mkdir
"${webrepo}" ||
{
938 git
-C "${webrepo}" init ||
{
942 mkdir
-p "$(dirname ${webrepo}/${htmlfile})" ||
{
945 cp -a "announce.${tagname}.html" "${webrepo}/${htmlfile}" ||
{
949 mkdir
-p "$(dirname ${webrepo}/${headlinefile})" ||
{
952 cp -a "announce.${tagname}.headline.html" "${webrepo}/${headlinefile}" ||
{
956 mkdir
-p "$(dirname ${webrepo}/${bodyfile})" ||
{
959 cp -a "announce.${tagname}.body.html" "${webrepo}/${bodyfile}" ||
{
963 git
-C "${webrepo}" add "${htmlfile}" "${headlinefile}" "${bodyfile}" ||
{
966 git
-C "${webrepo}" commit --signoff --message "NEWS[${version}]: Samba ${version} Available for Download" ||
{
969 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.patch.txt"
970 git
-C "${webrepo}" format-patch
--stdout -1 HEAD
> announce.
${tagname}.
patch.txt ||
{
974 CLEANUP_FILES
="${CLEANUP_FILES} announce.${tagname}.todo.txt"
976 ls -lart announce.
${tagname}.
*
979 echo "You need to do the following manual steps in order"
980 echo "to finish the announcement of ${tagname}!"
982 echo "Change to a samba-web checkout and run"
983 echo " ./announce_samba_release.sh ${version} $(pwd)/announce.${tagname}.patch.txt"
985 echo "Once the resulting commit is pushed a cron job will update "
986 echo "the content exported by the webserver every 5-10 mins."
987 echo "Check https://www.samba.org"
989 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
990 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
991 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
992 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
993 echo "In case your're using mutt, you can use the following shortcut:"
994 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
996 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
997 echo "See: announce.${tagname}.todo.txt"
999 } > announce.
${tagname}.todo.txt
1001 ls -lart announce.
${tagname}.
*
1005 announcement_release
() {
1006 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
1008 test -n "${announcement_fn}" ||
{
1009 echo "announcement_fn variable empty"
1013 echo "Running ${announcement_fn}"
1017 announce_release
() {
1018 check_args
"${FUNCNAME}" "$#" "0" ||
return 1
1019 require_tagname
"${FUNCNAME}"
1021 test -f "announce.${tagname}.todo.txt" ||
{
1022 echo "announce.${tagname}.todo.txt does not exist"
1026 cat announce.
${tagname}.todo.txt
1030 case "${product}" in
1031 talloc | tdb | tevent | ldb
)
1032 test -z "${GPG_USER-}" && {
1033 GPG_USER
='Samba Library Distribution Key <samba-bugs@samba.org>'
1036 test -z "${GPG_KEYID-}" && {
1037 GPG_KEYID
='4793916113084025'
1040 productbase
="${product}"
1041 srcdir
="lib/${product}"
1042 repo_url
="${CONF_REPO_URL}"
1043 upload_url
="${CONF_UPLOAD_URL}/${product}/"
1044 download_url
="${CONF_DOWNLOAD_URL}/${product}/"
1046 check_fn
="check_nopatch"
1047 upload_fn
="upload_nopatch"
1048 fullcmds
="create check push upload"
1051 test -z "${GPG_USER-}" && {
1052 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1055 test -z "${GPG_KEYID-}" && {
1056 GPG_KEYID
='6F33915B6568B7EA'
1061 repo_url
="${CONF_REPO_URL}"
1062 upload_url
="${CONF_UPLOAD_URL}/samba/rc/"
1063 download_url
="${CONF_DOWNLOAD_URL}/samba/rc/"
1065 verify_fn
="verify_samba_rc"
1066 check_fn
="check_nopatch"
1067 upload_fn
="upload_nopatch"
1068 announcement_fn
="announcement_samba_rc"
1069 fullcmds
="verify create check whatsnew announcement push upload announce"
1072 test -z "${GPG_USER-}" && {
1073 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1076 test -z "${GPG_KEYID-}" && {
1077 GPG_KEYID
='6F33915B6568B7EA'
1082 repo_url
="${CONF_REPO_URL}"
1083 upload_url
="${CONF_UPLOAD_URL}/"
1084 download_url
="${CONF_DOWNLOAD_URL}/"
1085 history_url
="${CONF_HISTORY_URL}/samba/history/"
1087 verify_fn
="verify_samba_stable"
1088 check_fn
="check_samba_stable"
1089 upload_fn
="upload_samba_stable"
1090 announcement_fn
="announcement_samba_stable"
1091 fullcmds
="verify create patch check announcement push upload announce"
1093 TODO-samba-security
)
1094 test -z "${GPG_USER-}" && {
1095 GPG_USER
='Samba Distribution Verification Key <samba-bugs@samba.org>'
1098 test -z "${GPG_KEYID-}" && {
1099 GPG_KEYID
='6F33915B6568B7EA'
1104 repo_url
="${CONF_REPO_URL}"
1105 upload_url
="${CONF_UPLOAD_URL}/"
1106 download_url
="${CONF_DOWNLOAD_URL}/"
1107 history_url
="${CONF_HISTORY_URL}/samba/history/"
1109 verify_fn
="verify_samba_stable"
1110 check_fn
="check_samba_stable"
1111 upload_fn
="upload_samba_stable"
1112 announcement_fn
="announcement_samba_security"
1113 fullcmds
="verify create patch check announcement"
1118 echo "Unknown product ${product}"
1122 pushd ${srcdir} ||
{
1123 echo "srcdir[${srcdir}] does not exist"
1129 echo "ERROR: cleaning up"
1132 for t
in ${CLEANUP_TAGS}; do
1133 echo "Removing tag[${t}]"
1134 git tag
-v "${t}" && {
1135 git tag
-d "${t}" ||
{
1136 echo "failed to remove tag ${t}"
1141 for f
in ${CLEANUP_FILES}; do
1142 echo "Removing file[${f}]"
1145 echo "failed to remove ${f}"
1150 for d
in ${CLEANUP_DIRS}; do
1151 echo "Removing dir[${d}]"
1154 echo "failed to remove ${d}"
1163 trap trap_handler INT QUIT TERM EXIT
1165 cmd_allowed
"${globalcmd}" fullrelease
${fullcmds} ||
{
1167 echo "command[${globalcmd}] not supported for product[${product}]"
1171 case "${globalcmd}" in
1173 check_args
"${globalcmd}" "$#" "0" ||
exit 1
1177 check_args
"${globalcmd}" "$#" "0" ||
exit 1
1178 check_args
"create" "$#" "0" ||
exit 1
1181 cmd_allowed
"verify" ${fullcmds} && {
1182 cmds
="${cmds} verify"
1184 cmds
="${cmds} create"
1185 cmd_allowed
"whatsnew" ${fullcmds} && {
1186 cmds
="${cmds} whatsnew"
1188 cmd_allowed
"patch" ${fullcmds} && {
1189 cmds
="${cmds} patch"
1191 cmds
="${cmds} check"
1192 cmd_allowed
"announcement" ${fullcmds} && {
1193 cmds
="${cmds} announcement"
1198 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1204 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1207 cmd_allowed
"announce" ${fullcmds} && {
1212 check_args
"${globalcmd}" "$#" "1" ||
exit 1
1214 cmds
="check announce"
1218 echo "Unknown command ${globalcmd}"
1224 CLEANUP_DIRS
="${CLEANUP_DIRS} ${TMPDIR}"
1229 for cmd
in ${cmds}; do
1230 echo "Starting subcommand[${cmd}]"
1232 echo "Failed subcommand[${cmd}]"
1235 echo "Finished subcommand[${cmd}]"
1238 test -d "${TMPDIR}" && {
1239 rm -rf "${TMPDIR}" ||
{
1240 echo "failed to remove ${TMPDIR}"
1244 test -n "${next_cmd}" && {
1245 echo "Continue with '$0 ${product} ${next_cmd} ${tagname}'."
1248 trap - INT QUIT TERM EXIT