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"
21 echo "Run this script from the top-level directory in the"
27 echo "Usage: release.sh <PRODUCT> <COMMAND>"
29 echo "PRODUCT: ldb, talloc, tevent, tdb, samba-rc, samba-stable"
30 echo "COMMAND: fullrelease, create, push, upload, announce"
40 test x"${got_args}" = x"${take_args}" || {
42 echo "cmd[${cmd}] takes ${take_args} instead of ${got_args}"
54 test "${got_args}" -ge "${min_args}" || {
56 echo "cmd[${cmd}] takes at least ${min_args} instead of ${got_args}"
63 min_args "$0" "$#" "2"
75 min_args "${FUNCNAME}" "$#" "1" || return 1
78 test -n "${tagname}" || {
79 echo "cmd[${cmd}] requires '\${tagname}' variable to be set"
83 local name=$(echo "${tagname}" | cut -d '-' -f1)
84 test x"${name}" = x"${productbase}" || {
85 echo "Invalid tagname[${tgzname}]"
93 min_args "${FUNCNAME}" "$#" "2" || return 1
97 echo "$@" | grep -q "\<${cmd}\>" || {
105 check_args "${FUNCNAME}" "$#" "0" || return 1
108 echo "VERSION doesn't exist"
112 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION || {
113 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
117 grep -q '^SAMBA_VERSION_RC_RELEASE=' VERSION || {
118 echo "SAMBA_VERSION_RC_RELEASE= missing"
122 grep -q '^SAMBA_VERSION_RC_RELEASE=$' VERSION && {
123 echo "SAMBA_VERSION_RC_RELEASE= missing the rc version"
130 verify_samba_stable() {
131 check_args "${FUNCNAME}" "$#" "0" || return 1
134 echo "VERSION doesn't exist"
138 grep -q 'SAMBA_VERSION_IS_GIT_SNAPSHOT=no' VERSION || {
139 echo "SAMBA_VERSION_IS_GIT_SNAPSHOT is not 'no'"
144 VARS="${VARS} SAMBA_VERSION_REVISION"
145 VARS="${VARS} SAMBA_VERSION_TP_RELEASE"
146 VARS="${VARS} SAMBA_VERSION_ALPHA_RELEASE"
147 VARS="${VARS} SAMBA_VERSION_BETA_RELEASE"
148 VARS="${VARS} SAMBA_VERSION_PRE_RELEASE"
149 VARS="${VARS} SAMBA_VERSION_RC_RELEASE"
150 VARS="${VARS} SAMBA_VERSION_RELEASE_NICKNAME"
151 VARS="${VARS} SAMBA_VERSION_VENDOR_SUFFIX"
152 VARS="${VARS} SAMBA_VERSION_VENDOR_PATCH"
153 for var in ${VARS}; do
154 grep -q "^${var}" VERSION && {
155 grep -q "^${var}=$" VERSION || {
156 echo "${var} found in stable version"
162 local SAMBA_VERSION_MAJOR=$(grep '^SAMBA_VERSION_MAJOR=' VERSION | cut -d '=' -f2 | xargs)
163 local SAMBA_VERSION_MINOR=$(grep '^SAMBA_VERSION_MINOR=' VERSION | cut -d '=' -f2 | xargs)
164 local SAMBA_VERSION_RELEASE=$(grep '^SAMBA_VERSION_RELEASE=' VERSION | cut -d '=' -f2 | xargs)
166 test ${SAMBA_VERSION_RELEASE} -gt 0 || {
170 local old_release=$(expr ${SAMBA_VERSION_RELEASE} - 1)
171 oldtagname="${productbase}-${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${old_release}"
173 local verify_out="${TMPDIR}/verify-${oldtagname}.out"
175 echo "Verifying oldtagname: ${oldtagname}"
177 git tag -v "${oldtagname}" >${verify_out} 2>&1 || {
178 echo "failed to verify old tag[${oldtagname}]"
182 grep -q "${GPG_KEYID}" "${verify_out}" || {
183 echo "oldtagname[${oldtagname}] was not generated with GPG_KEYID[${GPG_KEYID}]!"
189 echo "Verifying ${oldtagname}.tar.gz and ${oldtagname}.tar.asc"
191 test -f "${oldtagname}.tar.gz" || {
192 echo "${oldtagname}.tar.gz does not exist"
196 test -f "${oldtagname}.tar.asc" || {
197 echo "${oldtagname}.tar.asc does not exist"
201 zcat "${oldtagname}.tar.gz" | gpg --verify "${oldtagname}.tar.asc" - 2>${verify_out} || {
202 echo "Failed to verify ${oldtagname}.tar.asc"
206 grep -q "${GPG_KEYID}" "${verify_out}" || {
207 echo "${oldtagname}.tar.asc was not generated with GPG_KEYID[${GPG_KEYID}]!"
217 check_args "${FUNCNAME}" "$#" "0" || return 1
219 test -n "${verify_fn}" || {
220 echo "verify_fn variable empty"
224 echo "Running ${verify_fn}"
229 check_args "${FUNCNAME}" "$#" "0" || return 1
231 echo "Releasing product ${product}"
233 echo "Building release tarball"
234 local tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
235 test -f "${tgzname}" || {
236 echo "Failed to create tarball"
239 CLEANUP_FILES="${CLEANUP_FILES} ${tgzname}"
241 local name=$(echo "${tgzname}" | cut -d '-' -f1)
242 test x"${name}" = x"${productbase}" || {
243 echo "Invalid tgzname[${tgzname}]"
247 local tarname=$(basename ${tgzname} .gz)
248 echo "Tarball: ${tarname}"
249 gunzip -f ${tgzname} || {
250 echo "Failed to decompress tarball ${tarname}"
253 test -f "${tarname}" || {
254 echo "Failed to decompress tarball ${tarname}"
257 CLEANUP_FILES="${CLEANUP_FILES} ${tarname}"
260 tagname=$(basename ${tarname} .tar)
261 echo "Tagging as ${tagname}"
262 git tag -u ${GPG_KEYID} -s "${tagname}" -m "${productbase}: tag release ${tagname}" || {
265 CLEANUP_TAGS="${CLEANUP_TAGS} ${tagname}"
267 echo "Signing ${tarname} => ${tarname}.asc"
268 rm -f "${tarname}.asc"
269 gpg -u "${GPG_USER}" --detach-sign --armor ${tarname} || {
272 test -f "${tarname}.asc" || {
273 echo "Failed to create signature ${tarname}.asc"
276 CLEANUP_FILES="${CLEANUP_FILES} ${tarname}.asc"
277 echo "Compressing ${tarname} => ${tgzname}"
278 gzip -f -9 ${tarname}
279 test -f "${tgzname}" || {
280 echo "Failed to compress ${tgzname}"
288 check_args "${FUNCNAME}" "$#" "0" || return 1
289 require_tagname "${FUNCNAME}"
291 test -n "${oldtagname}" || {
295 local oldversion=$(echo "${oldtagname}" | sed -e "s!^${productbase}-!!")
296 local version=$(echo "${tagname}" | sed -e "s!^${productbase}-!!")
300 local patchfile="patch-${oldversion}-${version}.diffs"
301 echo "Generating ${patchfile}"
304 tar xfz "${oldpwd}/${oldtagname}.tar.gz"
305 tar xfz "${oldpwd}/${tagname}.tar.gz"
306 diff -Npur "${oldtagname}/" "${tagname}/" > "${patchfile}"
309 CLEANUP_FILES="${CLEANUP_FILES} ${patchfile}"
310 mv "${TMPDIR}/${patchfile}" "${patchfile}" || {
311 echo "failed cmd[mv ${TMPDIR}/${patchfile} ${patchfile}]"
315 echo "Signing ${patchfile} => ${patchfile}.asc"
316 rm -f "${patchfile}.asc"
317 CLEANUP_FILES="${CLEANUP_FILES} ${patchfile}.asc"
318 gpg -u "${GPG_USER}" --detach-sign --armor ${patchfile} || {
321 test -f "${patchfile}.asc" || {
322 echo "Failed to create signature ${patchfile}.asc"
325 echo "Compressing ${patchfile} => ${patchfile}.gz"
326 CLEANUP_FILES="${CLEANUP_FILES} ${patchfile}.gz"
327 gzip -f -9 ${patchfile}
328 test -f "${patchfile}.gz" || {
329 echo "Failed to compress ${patchfile}.gz"
337 check_args "${FUNCNAME}" "$#" "0" || return 1
338 require_tagname "${FUNCNAME}"
340 echo "extract ${tagname}.WHATSNEW.txt"
341 tar xf ${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt > ${tagname}.WHATSNEW.txt
342 CLEANUP_FILES="${CLEANUP_FILES} ${tagname}.WHATSNEW.txt"
348 check_args "${FUNCNAME}" "$#" "0" || return 1
349 require_tagname "${FUNCNAME}"
351 git tag -v "${tagname}" || {
352 echo "failed to verify tag[${tagname}]"
356 test -f "${tagname}.tar.gz" || {
357 echo "${tagname}.tar.gz does not exist"
361 test -f "${tagname}.tar.asc" || {
362 echo "${tagname}.tar.asc does not exist"
372 check_args "${FUNCNAME}" "$#" "0" || return 1
373 require_tagname "${FUNCNAME}"
375 git tag -v "${tagname}" || {
376 echo "failed to verify tag[${tagname}]"
380 test -f "${tagname}.tar.gz" || {
381 echo "${tagname}.tar.gz does not exist"
385 test -f "${tagname}.tar.asc" || {
386 echo "${tagname}.tar.asc does not exist"
392 test -n "${patchfile}" || {
396 test -f "${patchfile}.gz" || {
397 echo "${patchfile}.gz does not exist"
401 test -f "${patchfile}.asc" || {
402 echo "${patchfile}.asc does not exist"
410 check_args "${FUNCNAME}" "$#" "0" || return 1
412 test -n "${check_fn}" || {
413 echo "check_fn variable empty"
417 echo "Running ${check_fn}"
422 check_args "${FUNCNAME}" "$#" "0" || return 1
423 require_tagname "${FUNCNAME}"
425 echo "Push git tag ${tagname} to '${repo_url}'"
426 git push "${repo_url}" "refs/tags/${tagname}:refs/tags/${tagname}" || {
434 check_args "${FUNCNAME}" "$#" "0" || return 1
435 require_tagname "${FUNCNAME}"
437 echo "Upload ${tagname}.* to '${upload_url}'"
438 rsync -Pav ${tagname}.* "${upload_url}/" || {
441 rsync ${upload_url}/${tagname}.*
446 announce_samba_rc() {
447 check_args "${FUNCNAME}" "$#" "0" || return 1
448 require_tagname "${FUNCNAME}"
450 test -f "${tagname}.WHATSNEW.txt" || {
451 echo "${tagname}.WHATSNEW.txt does not exist"
456 local utcdate=$(date --utc +"%d %B %Y")
457 local utctime=$(date --utc +"%Y%m%d-%H%M%S")
458 local version=$(echo "${tagname}" | sed -e 's!^samba-!!')
459 local href="#${version}"
460 local series=$(echo "${version}" | cut -d '.' -f1-2)
461 local rc=$(echo "${version}" | sed -e 's!.*rc\([0-9][0-9]*\)!\1!')
462 local rcname="${rc}th"
482 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
483 } > announce.${tagname}.to.txt
484 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.to.txt"
487 echo "[Announce] Samba ${version} Available for Download"
488 } > announce.${tagname}.subject.txt
489 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.subject.txt"
492 cat ${tagname}.WHATSNEW.txt
494 echo "================"
495 echo "Download Details"
496 echo "================"
498 echo "The uncompressed tarballs and patch files have been signed"
499 echo "using GnuPG (ID 6568B7EA). The source code can be downloaded"
502 echo " ${download_url}"
504 echo "The release notes are available online at:"
506 echo " ${download_url}${tagname}.WHATSNEW.txt"
508 echo "Our Code, Our Bugs, Our Responsibility."
509 echo "(https://bugzilla.samba.org/)"
512 echo " The Samba Team"
513 } > announce.${tagname}.mail.txt
514 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mail.txt"
517 echo -n "-i announce.${tagname}.mail.txt "
518 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
519 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
520 } > announce.${tagname}.mutt-arguments.txt
521 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
523 local headlinefile="${utctime}.${version}.headline.html"
525 echo "<!-- BEGIN: posted_news/${headlinefile} -->"
526 echo "<li> ${utcdate} <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
527 echo "<!-- END: posted_news/${headlinefile} -->"
529 CLEANUP_FILES="${CLEANUP_FILES} ${headlinefile}"
531 local bodyfile="${utctime}.${version}.body.html"
533 echo "<!-- BEGIN: posted_news/${bodyfile} -->"
534 echo "<h5><a name=\"${version}\">${utcdate}</a></h5>"
535 echo "<p class="headline">Samba ${version} Available for Download</p>"
537 echo "This is the ${rcname} release candidate of the upcoming Samba ${series} release series."
540 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
541 echo "The source code can be <a href=\"${download_url}${tagname}.tar.gz\">downloaded now</a>."
542 echo "See <a href=\"${download_url}${tagname}.WHATSNEW.txt\">the release notes for more info</a>."
544 echo "<!-- END: posted_news/${bodyfile} -->"
547 CLEANUP_FILES="${CLEANUP_FILES} ${bodyfile}"
550 ls -lart announce.${tagname}.* ${headlinefile} ${bodyfile}
553 echo "You need to do the following manual steps in order"
554 echo "to finish the announcement of ${tagname}!"
556 echo "Copy the following files into the posted_news/"
557 echo "subdirectory of the samba-web.git repository and commit them:"
558 echo " ${headlinefile}"
561 echo " cp -a ${utctime}.${version}.*.html /path/to/samba-web/posted_news/"
562 echo " pushd /path/to/samba-web"
563 echo " git add posted_news/${utctime}.${version}.*.html"
564 echo " git commit --signoff --message \"NEWS[${version}]: Samba ${version} Available for Download\""
565 echo " git show -p --stat HEAD"
569 echo "Once the resulting commit is pushed a cron job will update "
570 echo "the content exported by the webserver every 5mins."
572 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
573 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
574 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
575 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
576 echo "In case your're using mutt, you can use the following shortcut:"
577 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
579 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
580 echo "See: announce.${tagname}.todo.txt"
582 } > announce.${tagname}.todo.txt
583 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.todo.txt"
585 cat announce.${tagname}.todo.txt
590 announce_samba_stable() {
591 check_args "${FUNCNAME}" "$#" "0" || return 1
592 require_tagname "${FUNCNAME}"
594 test -f "${tagname}.tar.gz" || {
595 echo "${tagname}.tar.gz does not exist"
599 echo "extract WHATSNEW.txt"
600 tar xf ${tagname}.tar.gz --to-stdout ${tagname}/WHATSNEW.txt > ${TMPDIR}/WHATSNEW.txt
602 # TODO: up to '^Release notes for older releases follow:'
603 cp -a ${TMPDIR}/WHATSNEW.txt ${TMPDIR}/WHATSNEW.top
606 local utcdate=$(date --utc +"%d %B %Y")
607 local utctime=$(date --utc +"%Y%m%d-%H%M%S")
608 local version=$(echo "${tagname}" | sed -e 's!^samba-!!')
609 local href="#${version}"
610 local series=$(echo "${version}" | cut -d '.' -f1-2)
611 local release=$(echo "${version}" | cut -d '.' -f3)
612 local releasename="latest"
623 echo "samba-announce@lists.samba.org, samba@lists.samba.org, samba-technical@lists.samba.org"
624 } > announce.${tagname}.to.txt
625 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.to.txt"
628 echo "[Announce] Samba ${version} Available for Download"
629 } > announce.${tagname}.subject.txt
630 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.subject.txt"
633 cat ${TMPDIR}/WHATSNEW.top
635 echo "================"
636 echo "Download Details"
637 echo "================"
639 echo "The uncompressed tarballs and patch files have been signed"
640 echo "using GnuPG (ID 6568B7EA). The source code can be downloaded"
643 echo " ${download_url}"
645 echo "The release notes are available online at:"
647 echo " ${history_url}${tagname}.html"
649 echo "Our Code, Our Bugs, Our Responsibility."
650 echo "(https://bugzilla.samba.org/)"
653 echo " The Samba Team"
654 } > announce.${tagname}.mail.txt
655 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mail.txt"
658 echo -n "-i announce.${tagname}.mail.txt "
659 echo -n "-s \"$(cat announce.${tagname}.subject.txt | xargs)\" "
660 echo -n "$(cat announce.${tagname}.to.txt | xargs)"
661 } > announce.${tagname}.mutt-arguments.txt
662 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.mutt-arguments.txt"
665 local tmp=$(cat ${TMPDIR}/WHATSNEW.top | grep -n '^Reporting bugs & Development Discussion' | head -1 | cut -d ':' -f1)
666 local lines=$(expr ${tmp} - 2)
668 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
669 echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
670 echo '<html xmlns="http://www.w3.org/1999/xhtml">'
673 echo "<title>Samba ${version} - Release Notes</title>"
677 echo "<H2>Samba ${version} Available for Download</H2>"
680 echo "<a href=\"${download_url}${tagname}.tar.gz\">Samba ${version} (gzipped)</a><br>"
681 echo "<a href=\"${download_url}${tagname}.tar.asc\">Signature</a>"
686 head -${lines} ${TMPDIR}/WHATSNEW.top | sed \
687 -e 's!&!\&!g' | sed \
690 -e 's!ä!\ä!g' \
691 -e 's!Ä!\Ä!g' \
692 -e 's!ö!\ö!g' \
693 -e 's!Ö!\Ö!g' \
694 -e 's!ü!\ü!g' \
695 -e 's!Ãœ!\Ü!g' \
696 -e 's!ß!\ß!g' \
705 } > announce.${tagname}.html
706 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.html"
708 local headlinefile="${utctime}.${version}.headline.html"
710 echo "<!-- BEGIN: posted_news/${headlinefile} -->"
711 echo "<li> ${utcdate} <a href=\"${href}\">Samba ${version} Available for Download</a></li>"
712 echo "<!-- END: posted_news/${headlinefile} -->"
714 CLEANUP_FILES="${CLEANUP_FILES} ${headlinefile}"
716 local bodyfile="${utctime}.${version}.body.html"
718 echo "<!-- BEGIN: posted_news/${bodyfile} -->"
719 echo "<h5><a name=\"${version}\">${utcdate}</a></h5>"
720 echo "<p class="headline">Samba ${version} Available for Download</p>"
722 echo "This is the ${releasename} stable release of the Samba ${series} release series."
725 echo "The uncompressed tarball has been signed using GnuPG (ID ${GPG_KEYID})."
726 echo "The source code can be <a href=\"${download_url}${tagname}.tar.gz\">downloaded now</a>."
727 #test -n "${patchfile}" && {
728 # echo "A <a href=\"...\"> patch against Samba ${oldversion}</a> is also available."
730 echo "See <a href=\"${history_url}${tagname}.html\">the release notes for more info</a>."
732 echo "<!-- END: posted_news/${bodyfile} -->"
735 CLEANUP_FILES="${CLEANUP_FILES} ${bodyfile}"
738 ls -lart announce.${tagname}.* ${headlinefile} ${bodyfile}
741 echo "You need to do the following manual steps in order"
742 echo "to finish the announcement of ${tagname}!"
744 echo "Copy the following files into the posted_news/"
745 echo "subdirectory of the samba-web.git repository and commit them:"
746 echo " ${headlinefile}"
749 echo " cp -a ${utctime}.${version}.*.html /path/to/samba-web/posted_news/"
750 echo " cp -a announce.${tagname}.html /path/to/samba-web/history/${tagname}.html"
751 echo " pushd /path/to/samba-web"
752 echo " git add posted_news/${utctime}.${version}.*.html"
753 echo " git add history/${tagname}.html"
754 echo " git commit --signoff --message \"NEWS[${version}]: Samba ${version} Available for Download\""
755 echo " git show -p --stat HEAD"
759 echo "Once the resulting commit is pushed a cron job will update "
760 echo "the content exported by the webserver every 5mins."
762 echo "If the web content is updated, you need to send the announce mail (gpg signed)."
763 echo "- announce.${tagname}.to.txt contains the mail's recipients for the To: header."
764 echo "- announce.${tagname}.subject.txt contains the mail's subject line."
765 echo "- announce.${tagname}.mail.txt contains the content of the mail body."
766 echo "In case your're using mutt, you can use the following shortcut:"
767 echo " eval mutt \$(cat announce.${tagname}.mutt-arguments.txt)"
769 echo "NOTICE: you're not done yet! Read the above instructions carefully!"
770 echo "See: announce.${tagname}.todo.txt"
772 } > announce.${tagname}.todo.txt
773 CLEANUP_FILES="${CLEANUP_FILES} announce.${tagname}.todo.txt"
775 cat announce.${tagname}.todo.txt
781 check_args "${FUNCNAME}" "$#" "0" || return 1
783 test -n "${announce_fn}" || {
784 echo "announce_fn variable empty"
788 echo "Running ${announce_fn}"
793 talloc | tdb | tevent | ldb)
794 test -z "${GPG_USER-}" && {
795 GPG_USER='Samba Library Distribution Key <samba-bugs@samba.org>'
798 test -z "${GPG_KEYID-}" && {
802 productbase="${product}"
803 srcdir="lib/${product}"
804 repo_url="${CONF_REPO_URL}"
805 upload_url="${CONF_UPLOAD_URL}/${product}/"
806 download_url="${CONF_DOWNLOAD_URL}/${product}/"
808 check_fn="check_nopatch"
809 fullcmds="create check push upload"
812 test -z "${GPG_USER-}" && {
813 GPG_USER='Samba Distribution Verification Key <samba-bugs@samba.org>'
816 test -z "${GPG_KEYID-}" && {
822 repo_url="${CONF_REPO_URL}"
823 upload_url="${CONF_UPLOAD_URL}/samba/rc/"
824 download_url="${CONF_DOWNLOAD_URL}/samba/rc/"
826 verify_fn="verify_samba_rc"
827 check_fn="check_nopatch"
828 announce_fn="announce_samba_rc"
829 fullcmds="verify create check whatsnew push upload announce"
832 test -z "${GPG_USER-}" && {
833 GPG_USER='Samba Distribution Verification Key <samba-bugs@samba.org>'
836 test -z "${GPG_KEYID-}" && {
842 repo_url="${CONF_REPO_URL}"
843 upload_url="${CONF_UPLOAD_URL}/samba/stable/"
844 download_url="${CONF_DOWNLOAD_URL}/samba/stable/"
845 history_url="${CONF_HISTORY_URL}/samba/history/"
847 verify_fn="verify_samba_stable"
848 check_fn="check_withpatch"
849 announce_fn="announce_samba_stable"
850 fullcmds="verify create patch check push upload announce"
853 test -z "${GPG_USER-}" && {
854 GPG_USER='Samba Distribution Verification Key <samba-bugs@samba.org>'
857 test -z "${GPG_KEYID-}" && {
863 repo_url="${CONF_REPO_URL}"
864 upload_url="${CONF_UPLOAD_URL}/samba/stable/"
865 download_url="${CONF_DOWNLOAD_URL}/samba/stable/"
867 verify_fn="verify_samba_stable"
868 check_fn="check_withpatch"
869 announce_fn="announce_samba_security"
870 fullcmds="verify create patch check"
875 echo "Unknown product ${product}"
880 echo "srcdir[${srcdir}] does not exist"
886 echo "ERROR: cleaning up"
889 for t in ${CLEANUP_TAGS}; do
890 echo "Removing tag[${t}]"
891 git tag -v "${t}" && {
892 git tag -d "${t}" || {
893 echo "failed to remove tag ${t}"
898 for f in ${CLEANUP_FILES}; do
899 echo "Removing file[${f}]"
902 echo "failed to remove ${f}"
907 for d in ${CLEANUP_DIRS}; do
908 echo "Removing dir[${d}]"
911 echo "failed to remove ${d}"
920 trap trap_handler INT QUIT TERM EXIT
922 cmd_allowed "${globalcmd}" fullrelease ${fullcmds} || {
924 echo "command[${globalcmd}] not supported for product[${product}]"
928 case "${globalcmd}" in
930 check_args "${globalcmd}" "$#" "0" || exit 1
934 check_args "${globalcmd}" "$#" "0" || exit 1
935 check_args "create" "$#" "0" || exit 1
938 cmd_allowed "verify" ${fullcmds} && {
939 cmds="${cmds} verify"
941 cmds="${cmds} create"
942 cmd_allowed "whatsnew" ${fullcmds} && {
943 cmds="${cmds} whatsnew"
945 cmd_allowed "patch" ${fullcmds} && {
952 check_args "${globalcmd}" "$#" "1" || exit 1
958 check_args "${globalcmd}" "$#" "1" || exit 1
961 cmd_allowed "symlinks" ${fullcmds} && {
962 cmds="${cmds} symlinks"
964 cmd_allowed "announce" ${fullcmds} && {
969 check_args "${globalcmd}" "$#" "1" || exit 1
971 cmds="check announce"
975 echo "Unknown command ${globalcmd}"
981 CLEANUP_DIRS="${CLEANUP_DIRS} ${TMPDIR}"
986 for cmd in ${cmds}; do
987 echo "Starting subcommand[${cmd}]"
989 echo "Failed subcommand[${cmd}]"
992 echo "Finished subcommand[${cmd}]"
995 test -d "${TMPDIR}" && {
996 rm -rf "${TMPDIR}" || {
997 echo "failed to remove ${TMPDIR}"
1001 test -n "${next_cmd}" && {
1002 echo "Continue with '$0 ${product} ${next_cmd} ${tagname}'."
1005 trap - INT QUIT TERM EXIT