| 
									
										
										
										
											2011-03-25 20:56:25 +01:00
										 |  |  | #!/bin/sh | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2013-04-09 15:12:11 +02:00
										 |  |  | # 2011-2013 Nico Schottelius (nico-cdist at schottelius.org) | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  | # 2016-2019 Darko Poljak (darko.poljak at gmail.com) | 
					
						
							| 
									
										
										
										
											2011-03-25 20:56:25 +01:00
										 |  |  | # | 
					
						
							|  |  |  | # This file is part of cdist. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # cdist is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  | # it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  | # the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  | # (at your option) any later version. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # cdist is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | # GNU General Public License for more details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  | # along with cdist. If not, see <http://www.gnu.org/licenses/>. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  | # This file contains the heavy lifting found usually in the Makefile. | 
					
						
							| 
									
										
										
										
											2011-03-25 20:56:25 +01:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2011-03-20 03:23:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | usage() { | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |     printf "usage: %s TARGET [TARGET-ARGS...] | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     Available targets: | 
					
						
							|  |  |  |         changelog-changes | 
					
						
							|  |  |  |         changelog-version | 
					
						
							|  |  |  |         check-date | 
					
						
							|  |  |  |         check-unittest | 
					
						
							|  |  |  |         ml-release | 
					
						
							|  |  |  |         archlinux-release | 
					
						
							|  |  |  |         pypi-release | 
					
						
							|  |  |  |         release-git-tag | 
					
						
							|  |  |  |         sign-git-release | 
					
						
							|  |  |  |         release | 
					
						
							|  |  |  |         test | 
					
						
							|  |  |  |         test-remote | 
					
						
							|  |  |  |         pycodestyle | 
					
						
							|  |  |  |         pep8 | 
					
						
							|  |  |  |         check-pycodestyle | 
					
						
							|  |  |  |         shellcheck-global-explorers | 
					
						
							|  |  |  |         shellcheck-type-explorers | 
					
						
							|  |  |  |         shellcheck-manifests | 
					
						
							|  |  |  |         shellcheck-local-gencodes | 
					
						
							|  |  |  |         shellcheck-remote-gencodes | 
					
						
							|  |  |  |         shellcheck-scripts | 
					
						
							|  |  |  |         shellcheck-gencodes | 
					
						
							|  |  |  |         shellcheck-types | 
					
						
							|  |  |  |         shellcheck | 
					
						
							|  |  |  |         shellcheck-type-files | 
					
						
							|  |  |  |         shellcheck-with-files | 
					
						
							|  |  |  |         shellcheck-build-helper | 
					
						
							|  |  |  |         check-shellcheck | 
					
						
							|  |  |  |         version-branch | 
					
						
							|  |  |  |         version | 
					
						
							|  |  |  |         target-version | 
					
						
							|  |  |  |         clean | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         distclean\n" "$1" | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | basename="${0##*/}" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  | if [ $# -lt 1 ] | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | then | 
					
						
							|  |  |  |     usage "${basename}" | 
					
						
							|  |  |  |     exit 1 | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | option=$1; shift | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | SHELLCHECKCMD="shellcheck -s sh -f gcc -x" | 
					
						
							|  |  |  | # Skip SC2154 for variables starting with __ since such variables are cdist | 
					
						
							|  |  |  | # environment variables. | 
					
						
							|  |  |  | SHELLCHECK_SKIP=': __.*is referenced but not assigned.*\[SC2154\]' | 
					
						
							| 
									
										
										
										
											2013-06-20 09:24:05 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | # Change to checkout directory | 
					
						
							|  |  |  | basedir="${0%/*}/../" | 
					
						
							|  |  |  | cd "$basedir" | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | case "$option" in | 
					
						
							| 
									
										
										
										
											2012-11-07 12:12:26 +01:00
										 |  |  |     changelog-changes) | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  |         if [ "$#" -eq 1 ]; then | 
					
						
							|  |  |  |             start=$1 | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |             start="[[:digit:]]" | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         end="[[:digit:]]" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         awk -F: "BEGIN { start=0 } | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 if(start == 0) { | 
					
						
							|  |  |  |                     if (\$0 ~ /^$start/) { | 
					
						
							|  |  |  |                         start = 1 | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     if (\$0 ~ /^$end/) { | 
					
						
							|  |  |  |                         exit | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         print \$0  | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             }" "$basedir/docs/changelog" | 
					
						
							| 
									
										
										
										
											2012-10-26 18:20:09 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-26 18:35:47 +02:00
										 |  |  |     changelog-version) | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  |         # get version from changelog | 
					
						
							| 
									
										
										
										
											2012-10-26 18:35:47 +02:00
										 |  |  |         grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/:.*//' | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-03 22:29:49 +02:00
										 |  |  |     check-date) | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  |         # verify date in changelog is today | 
					
						
							| 
									
										
										
										
											2012-10-26 18:35:47 +02:00
										 |  |  |         date_today="$(date +%Y-%m-%d)" | 
					
						
							|  |  |  |         date_changelog=$(grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/.*: //') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if [ "$date_today" != "$date_changelog" ]; then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Date in changelog is not today\n" | 
					
						
							|  |  |  |             printf "Changelog date: %s\n" "${date_changelog}" | 
					
						
							| 
									
										
										
										
											2012-10-26 18:35:47 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2012-10-25 18:28:19 +02:00
										 |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2011-03-25 22:10:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  |     check-unittest) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" test | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-09 17:22:56 +02:00
										 |  |  |     ml-release) | 
					
						
							| 
									
										
										
										
											2014-05-04 10:37:32 +02:00
										 |  |  |         if [ $# -ne 1 ]; then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "%s ml-release version\n" "$0" >&2 | 
					
						
							| 
									
										
										
										
											2014-05-04 10:37:32 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-09 17:22:56 +02:00
										 |  |  |         version=$1; shift | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-07 12:12:26 +01:00
										 |  |  |         (  | 
					
						
							|  |  |  |         cat << eof | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  | Subject: cdist $version has been released | 
					
						
							| 
									
										
										
										
											2012-11-07 12:12:26 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | Hello .*, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cdist $version has been released with the following changes: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | eof | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" changelog-changes "$version" | 
					
						
							| 
									
										
										
										
											2012-11-07 12:12:26 +01:00
										 |  |  |         cat << eof | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | eof | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  |         ) > mailinglist.tmp | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     archlinux-release) | 
					
						
							|  |  |  |         if [ $# -ne 1 ]; then | 
					
						
							|  |  |  |             printf "%s archlinux-release version\n" "$0" >&2 | 
					
						
							|  |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  |         version=$1; shift | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ARCHLINUXTAR="cdist-${version}-1.src.tar.gz" | 
					
						
							|  |  |  |         ./PKGBUILD.in "${version}" | 
					
						
							|  |  |  |         umask 022 | 
					
						
							|  |  |  |         mkaurball | 
					
						
							|  |  |  |         burp -c system "${ARCHLINUXTAR}" | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     pypi-release) | 
					
						
							|  |  |  |         # Ensure that pypi release has the right version | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" version | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         make docs-clean | 
					
						
							|  |  |  |         make docs | 
					
						
							|  |  |  |         python3 setup.py sdist upload | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2012-11-07 12:12:26 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |     release-git-tag) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         target_version=$($0 changelog-version) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         if git rev-parse --verify "refs/tags/${target_version}" 2>/dev/null; then | 
					
						
							|  |  |  |             printf "Tag for %s exists, aborting\n" "${target_version}" | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         printf "Enter tag description for %s: " "${target_version}" | 
					
						
							|  |  |  |         read -r tagmessage | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # setup for signed tags: | 
					
						
							|  |  |  |         # gpg --fulL-gen-key | 
					
						
							|  |  |  |         # gpg --list-secret-keys --keyid-format LONG | 
					
						
							|  |  |  |         # git config --local user.signingkey <id> | 
					
						
							|  |  |  |         # for exporting pub key: | 
					
						
							|  |  |  |         #     gpg --armor --export <id> > pubkey.asc | 
					
						
							|  |  |  |         #     gpg --output pubkey.gpg --export <id> | 
					
						
							|  |  |  |         # show tag with signature | 
					
						
							|  |  |  |         # git show <tag> | 
					
						
							|  |  |  |         # verify tag signature | 
					
						
							|  |  |  |         # git tag -v <tag> | 
					
						
							|  |  |  |         # | 
					
						
							|  |  |  |         # gpg verify signature | 
					
						
							|  |  |  |         # gpg --verify <asc-file> <file> | 
					
						
							|  |  |  |         # gpg --no-default-keyring --keyring <pubkey.gpg> --verify <asc-file> <file> | 
					
						
							| 
									
										
										
										
											2016-07-15 22:15:46 +02:00
										 |  |  |         # Ensure gpg-agent is running. | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         GPG_TTY=$(tty) | 
					
						
							|  |  |  |         export GPG_TTY | 
					
						
							| 
									
										
										
										
											2016-07-15 22:15:46 +02:00
										 |  |  |         gpg-agent | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         git tag -s "$target_version" -m "$tagmessage" | 
					
						
							|  |  |  |         git push --tags | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-11 12:28:22 +02:00
										 |  |  |     sign-git-release) | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         if [ $# -lt 2 ] | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |         then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "usage: %s sign-git-release TAG TOKEN [ARCHIVE]\n" "$0" | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |             printf "    if ARCHIVE is not specified then it is created\n" | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         tag="$1" | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |         if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1 | 
					
						
							| 
									
										
										
										
											2016-07-10 21:44:57 +02:00
										 |  |  |         then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Tag \"%s\" not found.\n" "${tag}" | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         token="$2" | 
					
						
							| 
									
										
										
										
											2016-07-15 22:33:33 +02:00
										 |  |  |         if [ $# -gt 2 ] | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         then | 
					
						
							|  |  |  |             archivename="$3" | 
					
						
							|  |  |  |         else | 
					
						
							| 
									
										
										
										
											2019-04-12 19:58:43 +02:00
										 |  |  |             archivename="cdist-${tag}.tar" | 
					
						
							| 
									
										
										
										
											2016-07-18 19:48:54 +02:00
										 |  |  |             git archive --prefix="cdist-${tag}/" -o "${archivename}" "${tag}" \ | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |                 || exit 1 | 
					
						
							| 
									
										
										
										
											2019-04-12 19:58:43 +02:00
										 |  |  |             # make sure target version is generated | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |             "$0" target-version | 
					
						
							| 
									
										
										
										
											2019-04-13 20:43:11 +02:00
										 |  |  |             tar -x -f "${archivename}" || exit 1 | 
					
						
							|  |  |  |             cp cdist/version.py "cdist-${tag}/cdist/version.py" || exit 1 | 
					
						
							|  |  |  |             tar -c -f "${archivename}" "cdist-${tag}/" || exit 1 | 
					
						
							|  |  |  |             rm -r -f "cdist-${tag}/" | 
					
						
							| 
									
										
										
										
											2019-04-12 19:58:43 +02:00
										 |  |  |             gzip "${archivename}" || exit 1 | 
					
						
							|  |  |  |             archivename="${archivename}.gz" | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         fi | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |         gpg --armor --detach-sign "${archivename}" || exit 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-30 11:59:34 +01:00
										 |  |  |         project="ungleich-public%2Fcdist" | 
					
						
							|  |  |  |         sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # upload archive | 
					
						
							|  |  |  |         response_archive=$(curl -f -X POST \ | 
					
						
							| 
									
										
										
										
											2019-05-03 22:16:51 +02:00
										 |  |  |              --http1.1 \ | 
					
						
							| 
									
										
										
										
											2018-12-30 11:59:34 +01:00
										 |  |  |              -H "PRIVATE-TOKEN: ${token}" \ | 
					
						
							|  |  |  |              -F "file=@${archivename}" \ | 
					
						
							|  |  |  |              "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ | 
					
						
							|  |  |  |              | sed "${sed_cmd}") || exit 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # upload archive signature | 
					
						
							|  |  |  |         response_archive_sig=$(curl -f -X POST \ | 
					
						
							| 
									
										
										
										
											2019-05-03 22:16:51 +02:00
										 |  |  |              --http1.1 \ | 
					
						
							| 
									
										
										
										
											2018-12-30 11:59:34 +01:00
										 |  |  |              -H "PRIVATE-TOKEN: ${token}" \ | 
					
						
							|  |  |  |              -F "file=@${archivename}.asc" \ | 
					
						
							|  |  |  |             "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ | 
					
						
							|  |  |  |              | sed "${sed_cmd}") || exit 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # make release | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') | 
					
						
							| 
									
										
										
										
											2019-05-03 21:39:25 +02:00
										 |  |  |         release_notes=$( | 
					
						
							| 
									
										
										
										
											2019-05-05 10:31:23 +02:00
										 |  |  |             printf "%s\n\n%s\n\n**Changelog**\n\n%s\n" \ | 
					
						
							|  |  |  |                 "${response_archive}" "${response_archive_sig}" "${changelog}" | 
					
						
							| 
									
										
										
										
											2019-05-03 21:39:25 +02:00
										 |  |  |         ) | 
					
						
							| 
									
										
										
										
											2018-12-30 11:59:34 +01:00
										 |  |  |         curl -f -X POST \ | 
					
						
							|  |  |  |              -H "PRIVATE-TOKEN: ${token}" \ | 
					
						
							| 
									
										
										
										
											2019-05-03 21:39:25 +02:00
										 |  |  |              -F "description=${release_notes}" \ | 
					
						
							| 
									
										
										
										
											2018-12-30 11:59:34 +01:00
										 |  |  |             "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ | 
					
						
							| 
									
										
										
										
											2016-07-10 21:17:42 +02:00
										 |  |  |             || exit 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # remove generated files (archive and asc) | 
					
						
							| 
									
										
										
										
											2019-04-12 19:58:43 +02:00
										 |  |  |         if [ $# -eq 2 ] | 
					
						
							| 
									
										
										
										
											2016-07-11 08:19:10 +02:00
										 |  |  |         then | 
					
						
							|  |  |  |             rm -f "${archivename}" | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  |         rm -f "${archivename}.asc" | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 21:20:05 +02:00
										 |  |  |     release) | 
					
						
							|  |  |  |         set -e | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         target_version=$($0 changelog-version) | 
					
						
							|  |  |  |         target_branch=$($0 version-branch) | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         printf "Beginning release process for %s\n" "${target_version}" | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 21:20:05 +02:00
										 |  |  |         # First check everything is sane | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" check-date | 
					
						
							|  |  |  |         "$0" check-unittest | 
					
						
							|  |  |  |         "$0" check-pycodestyle | 
					
						
							|  |  |  |         "$0" check-shellcheck | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # Generate version file to be included in packaging | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" target-version | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # Ensure the git status is clean, else abort | 
					
						
							| 
									
										
										
										
											2013-09-04 23:11:41 +02:00
										 |  |  |         if ! git diff-index --name-only --exit-code HEAD ; then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Unclean tree, see files above, aborting.\n" | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Ensure we are on the master branch | 
					
						
							| 
									
										
										
										
											2014-01-20 14:43:48 +01:00
										 |  |  |         masterbranch=yes | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |         if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Releases are happening from the master branch, aborting.\n" | 
					
						
							| 
									
										
										
										
											2014-01-20 14:40:54 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Enter the magic word to release anyway:" | 
					
						
							|  |  |  |             read -r magicword | 
					
						
							| 
									
										
										
										
											2014-01-20 14:40:54 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-20 14:43:48 +01:00
										 |  |  |             if [ "$magicword" = "iknowwhatido" ]; then | 
					
						
							|  |  |  |                 masterbranch=no | 
					
						
							|  |  |  |             else | 
					
						
							| 
									
										
										
										
											2014-01-20 14:40:54 +01:00
										 |  |  |                 exit 1 | 
					
						
							|  |  |  |             fi | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-20 14:43:48 +01:00
										 |  |  |         if [ "$masterbranch" = yes ]; then | 
					
						
							|  |  |  |             # Ensure version branch exists | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             if ! git rev-parse --verify "refs/heads/${target_branch}" 2>/dev/null; then | 
					
						
							| 
									
										
										
										
											2014-01-20 14:43:48 +01:00
										 |  |  |                 git branch "$target_branch" | 
					
						
							|  |  |  |             fi | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-20 14:43:48 +01:00
										 |  |  |             # Merge master branch into version branch | 
					
						
							|  |  |  |             git checkout "$target_branch" | 
					
						
							|  |  |  |             git merge master | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # Verify that after the merge everything works | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" check-date | 
					
						
							|  |  |  |         "$0" check-unittest | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-30 15:05:26 +02:00
										 |  |  |         # Generate documentation (man and html) | 
					
						
							| 
									
										
										
										
											2016-07-16 00:50:01 +02:00
										 |  |  |         # First, clean old generated docs | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         make docs-clean | 
					
						
							|  |  |  |         make docs | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         #############################################################  | 
					
						
							|  |  |  |         # Everything green, let's do the release | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Tag the current commit | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" release-git-tag | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         # Also merge back the version branch | 
					
						
							| 
									
										
										
										
											2014-01-20 14:48:05 +01:00
										 |  |  |         if [ "$masterbranch" = yes ]; then | 
					
						
							|  |  |  |             git checkout master | 
					
						
							|  |  |  |             git merge "$target_branch" | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 22:58:52 +02:00
										 |  |  |         # Publish git changes | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         # if you want to have mirror locally then uncomment this and comment below | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         #     git push --mirror | 
					
						
							| 
									
										
										
										
											2019-05-04 00:31:33 +02:00
										 |  |  |             git push | 
					
						
							|  |  |  |             # push also new branch and set up tracking | 
					
						
							|  |  |  |             git push -u origin "${target_branch}" | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         # fi | 
					
						
							| 
									
										
										
										
											2013-09-09 11:46:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 22:58:52 +02:00
										 |  |  |         # Create and publish package for pypi | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" pypi-release | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-03 21:46:17 +02:00
										 |  |  |         # sign git tag | 
					
						
							|  |  |  |         printf "Enter upstream repository authentication token: " | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         read -r token | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" sign-git-release "${target_version}" "${token}" | 
					
						
							| 
									
										
										
										
											2019-05-03 21:46:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 22:58:52 +02:00
										 |  |  |         # Announce change on ML | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" ml-release "${target_version}" | 
					
						
							| 
									
										
										
										
											2013-09-05 13:19:47 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         cat << eof | 
					
						
							|  |  |  | Manual steps post release: | 
					
						
							| 
									
										
										
										
											2019-04-23 22:39:41 +02:00
										 |  |  |     - cdist-web | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |     - send mail body generated in mailinglist.tmp and inform Dmitry for deb | 
					
						
							| 
									
										
										
										
											2013-09-05 13:19:47 +02:00
										 |  |  |     - twitter | 
					
						
							|  |  |  | eof | 
					
						
							| 
									
										
										
										
											2013-09-04 21:20:05 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-25 18:44:05 +02:00
										 |  |  |     test) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         if [ ! -f "cdist/version.py" ] | 
					
						
							|  |  |  |         then | 
					
						
							|  |  |  |             printf "cdist/version.py is missing, generate it first.\n" | 
					
						
							|  |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         PYTHONPATH="$(pwd -P)" | 
					
						
							|  |  |  |         export PYTHONPATH | 
					
						
							| 
									
										
										
										
											2012-10-25 18:44:05 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if [ $# -lt 1 ]; then | 
					
						
							|  |  |  |             python3 -m cdist.test | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |             python3 -m unittest "$@" | 
					
						
							|  |  |  |         fi | 
					
						
							| 
									
										
										
										
											2012-10-25 18:28:19 +02:00
										 |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2013-07-09 15:32:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-09 10:00:14 +01:00
										 |  |  |     test-remote) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         if [ ! -f "cdist/version.py" ] | 
					
						
							|  |  |  |         then | 
					
						
							|  |  |  |             printf "cdist/version.py is missing, generate it first.\n" | 
					
						
							|  |  |  |             exit 1 | 
					
						
							|  |  |  |         fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         PYTHONPATH="$(pwd -P)" | 
					
						
							|  |  |  |         export PYTHONPATH | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-09 10:00:14 +01:00
										 |  |  |         python3 -m cdist.test.exec.remote | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-15 21:05:26 +01:00
										 |  |  |     pycodestyle|pep8) | 
					
						
							|  |  |  |         pycodestyle "${basedir}" "${basedir}/scripts/cdist" | less | 
					
						
							| 
									
										
										
										
											2016-07-24 22:24:15 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-15 21:05:26 +01:00
										 |  |  |     check-pycodestyle) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" pycodestyle | 
					
						
							| 
									
										
										
										
											2019-02-15 21:05:26 +01:00
										 |  |  |         printf "\\nPlease review pycodestyle report.\\n" | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |         while true | 
					
						
							|  |  |  |         do | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Continue (yes/no)?\n" | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |             any= | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             read -r any | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |             case "$any" in | 
					
						
							|  |  |  |                 yes) | 
					
						
							|  |  |  |                     break | 
					
						
							|  |  |  |                 ;; | 
					
						
							|  |  |  |                 no) | 
					
						
							|  |  |  |                     exit 1 | 
					
						
							|  |  |  |                 ;; | 
					
						
							|  |  |  |                 *) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |                     printf "Please answer with 'yes' or 'no' explicitly.\n" | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |                 ;; | 
					
						
							|  |  |  |         esac | 
					
						
							|  |  |  |         done | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     shellcheck-global-explorers) | 
					
						
							|  |  |  |         find cdist/conf/explorer -type f -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-type-explorers) | 
					
						
							|  |  |  |         find cdist/conf/type -type f -path "*/explorer/*" -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-manifests) | 
					
						
							|  |  |  |         find cdist/conf/type -type f -name manifest -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-local-gencodes) | 
					
						
							|  |  |  |         find cdist/conf/type -type f -name gencode-local -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-remote-gencodes) | 
					
						
							|  |  |  |         find cdist/conf/type -type f -name gencode-remote -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-scripts) | 
					
						
							| 
									
										
										
										
											2019-05-19 13:40:24 +02:00
										 |  |  |         ${SHELLCHECKCMD} scripts/cdist-dump scripts/cdist-new-type || exit 0 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-gencodes) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" shellcheck-local-gencodes | 
					
						
							|  |  |  |         "$0" shellcheck-remote-gencodes | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-types) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" shellcheck-type-explorers | 
					
						
							|  |  |  |         "$0" shellcheck-manifests | 
					
						
							|  |  |  |         "$0" shellcheck-gencodes | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |     shellcheck) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" shellcheck-global-explorers | 
					
						
							|  |  |  |         "$0" shellcheck-types | 
					
						
							|  |  |  |         "$0" shellcheck-scripts | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-type-files) | 
					
						
							|  |  |  |         find cdist/conf/type -type f -path "*/files/*" -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-with-files) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" shellcheck | 
					
						
							|  |  |  |         "$0" shellcheck-type-files | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     shellcheck-build-helper) | 
					
						
							|  |  |  |         ${SHELLCHECKCMD} ./bin/build-helper | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     check-shellcheck) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" shellcheck | 
					
						
							| 
									
										
										
										
											2018-10-06 14:57:55 +02:00
										 |  |  |         printf "\\nPlease review shellcheck report.\\n" | 
					
						
							| 
									
										
										
										
											2016-07-10 11:21:52 +02:00
										 |  |  |         while true | 
					
						
							|  |  |  |         do | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             printf "Continue (yes/no)?\n" | 
					
						
							| 
									
										
										
										
											2016-07-10 11:21:52 +02:00
										 |  |  |             any= | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |             read -r any | 
					
						
							| 
									
										
										
										
											2016-07-10 11:21:52 +02:00
										 |  |  |             case "$any" in | 
					
						
							|  |  |  |                 yes) | 
					
						
							|  |  |  |                     break | 
					
						
							|  |  |  |                 ;; | 
					
						
							|  |  |  |                 no) | 
					
						
							|  |  |  |                     exit 1 | 
					
						
							|  |  |  |                 ;; | 
					
						
							|  |  |  |                 *) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |                     printf "Please answer with 'yes' or 'no' explicitly.\n" | 
					
						
							| 
									
										
										
										
											2016-07-10 11:21:52 +02:00
										 |  |  |                 ;; | 
					
						
							|  |  |  |         esac | 
					
						
							|  |  |  |         done | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |     version-branch) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" changelog-version | cut -d. -f '1,2' | 
					
						
							| 
									
										
										
										
											2013-09-04 22:33:26 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-07 21:14:51 +02:00
										 |  |  |     version) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         printf "VERSION = \"%s\"\n" "$(git describe)" > cdist/version.py | 
					
						
							| 
									
										
										
										
											2013-06-07 21:14:51 +02:00
										 |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2011-03-25 22:10:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-16 01:38:22 +02:00
										 |  |  |     target-version) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         target_version=$($0 changelog-version) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         printf "VERSION = \"%s\"\n" "${target_version}" > cdist/version.py | 
					
						
							|  |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     clean) | 
					
						
							|  |  |  |         make clean | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Archlinux | 
					
						
							|  |  |  |         rm -f cdist-*.pkg.tar.xz cdist-*.tar.gz | 
					
						
							|  |  |  |         rm -rf pkg/ src/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rm -f MANIFEST PKGBUILD | 
					
						
							|  |  |  |         rm -rf dist/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Signed release | 
					
						
							|  |  |  |         rm -f cdist-*.tar.gz | 
					
						
							|  |  |  |         rm -f cdist-*.tar.gz.asc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         # Temp files | 
					
						
							|  |  |  |         rm -f ./*.tmp | 
					
						
							| 
									
										
										
										
											2016-07-16 01:38:22 +02:00
										 |  |  |     ;; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |     distclean) | 
					
						
							| 
									
										
										
										
											2019-05-09 21:05:33 +02:00
										 |  |  |         "$0" clean | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         rm -f cdist/version.py | 
					
						
							|  |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2012-10-25 18:44:05 +02:00
										 |  |  |     *) | 
					
						
							| 
									
										
										
										
											2019-05-07 18:16:54 +02:00
										 |  |  |         printf "Unknown target: '%s'.\n" "${option}" >&2 | 
					
						
							|  |  |  |         usage "${basename}" | 
					
						
							| 
									
										
										
										
											2012-10-25 18:44:05 +02:00
										 |  |  |         exit 1 | 
					
						
							|  |  |  |     ;; | 
					
						
							| 
									
										
										
										
											2011-10-02 15:56:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-25 21:04:26 +01:00
										 |  |  | esac |