From a95d4ffefafaf3e7142bacbc33951ab9f2dc3d74 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 23 Apr 2019 12:36:24 +0000 Subject: [PATCH 001/383] Fix spelling error in manpage --- cdist/conf/type/__zypper_service/man.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__zypper_service/man.rst b/cdist/conf/type/__zypper_service/man.rst index ea48aebb..e082dc02 100644 --- a/cdist/conf/type/__zypper_service/man.rst +++ b/cdist/conf/type/__zypper_service/man.rst @@ -46,10 +46,10 @@ EXAMPLES # Ensure that internal SLES11 SP3 RIS is in installed and all other services and repos are discarded __zypper_service INTERNAL_SLES11_SP3 --service_desc "Internal SLES11 SP3 RIS" --uri "http://path/to/your/ris/dir" --remove-all-other-services --remove-all-repos - # Ensure that internal SLES11 SP3 RIS is in installed, no changes to ohter services or repos + # Ensure that internal SLES11 SP3 RIS is in installed, no changes to other services or repos __zypper_service INTERNAL_SLES11_SP3 --service_desc "Internal SLES11 SP3 RIS" --uri "http://path/to/your/ris/dir" - # Drop service by uri, no changes to ohter services or repos + # Drop service by uri, no changes to other services or repos __zypper_service INTERNAL_SLES11_SP3 --state absent --uri "http://path/to/your/ris/dir" From 31b9859e08d685032a4bc15eca0ed6f80cfb9fdd Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 23 Apr 2019 17:22:02 +0200 Subject: [PATCH 002/383] ++changelog --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index bf106861..c64ca60a 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) + 4.11.1: 2019-04-22 * Core: Improve explorer error reporting (Darko Poljak) * Type __directory: explorer stat: add support for Solaris (Ander Punnar) From 894311a57200c5bc2094890033d6df0867d52c43 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Wed, 24 Apr 2019 00:08:43 +0300 Subject: [PATCH 003/383] __acl: if users/groups check fail, log error and exit in explorer --- cdist/conf/type/__acl/explorer/missing_users_groups | 3 ++- cdist/conf/type/__acl/gencode-remote | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cdist/conf/type/__acl/explorer/missing_users_groups b/cdist/conf/type/__acl/explorer/missing_users_groups index b4af614c..2f3b9e6d 100755 --- a/cdist/conf/type/__acl/explorer/missing_users_groups +++ b/cdist/conf/type/__acl/explorer/missing_users_groups @@ -40,7 +40,8 @@ do if ! getent "$getent_db" "$check" > /dev/null then - echo "missing $parameter '$check'" + echo "missing $parameter '$check'" >&2 + exit 1 fi done \ < "$__object/parameter/$parameter" diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index a0f25a15..c0594497 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -22,14 +22,6 @@ file_is="$( cat "$__object/explorer/file_is" )" [ "$file_is" = 'missing' ] && exit 0 -missing_users_groups="$( cat "$__object/explorer/missing_users_groups" )" - -if [ -n "$missing_users_groups" ] -then - echo "$missing_users_groups" >&2 - exit 1 -fi - os="$( cat "$__global/explorer/os" )" acl_is="$( cat "$__object/explorer/acl_is" )" From d66b6969f31ea2c7690a0b85a41a76d07b7ac3e0 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Wed, 24 Apr 2019 00:09:49 +0300 Subject: [PATCH 004/383] __acl: rename missing_users_groups explorer to more generic name for future checks --- cdist/conf/type/__acl/explorer/{missing_users_groups => checks} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cdist/conf/type/__acl/explorer/{missing_users_groups => checks} (100%) diff --git a/cdist/conf/type/__acl/explorer/missing_users_groups b/cdist/conf/type/__acl/explorer/checks similarity index 100% rename from cdist/conf/type/__acl/explorer/missing_users_groups rename to cdist/conf/type/__acl/explorer/checks From f586937614383ebf67e2bcbf061c0ab7b7847620 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Wed, 24 Apr 2019 00:36:53 +0300 Subject: [PATCH 005/383] __acl: drop Solaris because POSIX-draft ACL specification is not supported --- cdist/conf/type/__acl/gencode-remote | 44 ++++++++++++---------------- cdist/conf/type/__acl/man.rst | 6 ++-- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index c0594497..61a83c8c 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -74,34 +74,26 @@ fi if [ -f "$__object/parameter/remove" ] then - if echo "$os" | grep -Fq 'solaris' - then - # Solaris setfacl behaves differently. - # We will not support Solaris for now, because no way to test it. - # But adding support should be easy (use -s instead of -m on modify). - echo "$os setfacl do not support -x flag for ACL remove" >&2 - else - echo "$acl_is" | while read -r acl - do - # Skip wanted ACL entries which already exist - # and skip mask and other entries, because we - # can't actually remove them, but only change. - if echo "$acl_should" | grep -Eq "^$acl" \ - || echo "$acl" | grep -Eq '^(default:)?(mask|other)' - then continue - fi + echo "$acl_is" | while read -r acl + do + # Skip wanted ACL entries which already exist + # and skip mask and other entries, because we + # can't actually remove them, but only change. + if echo "$acl_should" | grep -Eq "^$acl" \ + || echo "$acl" | grep -Eq '^(default:)?(mask|other)' + then continue + fi - if echo "$os" | grep -Eq 'macosx|freebsd' - then - remove="$acl" - else - remove="$( echo "$acl" | sed 's/:...$//' )" - fi + if echo "$os" | grep -Eq 'macosx|freebsd' + then + remove="$acl" + else + remove="$( echo "$acl" | sed 's/:...$//' )" + fi - echo "$setfacl_exec -x \"$remove\" \"$acl_path\"" - echo "removed '$remove'" >> "$__messages_out" - done - fi + echo "$setfacl_exec -x \"$remove\" \"$acl_path\"" + echo "removed '$remove'" >> "$__messages_out" + done fi for acl in $acl_should diff --git a/cdist/conf/type/__acl/man.rst b/cdist/conf/type/__acl/man.rst index 092eb555..e6784c87 100644 --- a/cdist/conf/type/__acl/man.rst +++ b/cdist/conf/type/__acl/man.rst @@ -10,11 +10,9 @@ DESCRIPTION ----------- ACL must be defined as 3-symbol combination, using ``r``, ``w``, ``x`` and ``-``. -Fully supported on Linux (tested on Debian and CentOS). +Fully supported and tested on Linux, partial support for FreeBSD. -Partial support for FreeBSD, OSX and Solaris. - -OpenBSD and NetBSD support is not possible. +OpenBSD, NetBSD and Solaris support is not possible. See ``setfacl`` and ``acl`` manpages for more details. From 4c21983698932e17ca9276873e32a908b4235bf7 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Wed, 24 Apr 2019 00:39:54 +0300 Subject: [PATCH 006/383] __acl: remove macosx because no way to properly test --- cdist/conf/type/__acl/gencode-remote | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index 61a83c8c..ef903816 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -64,7 +64,7 @@ setfacl_exec='setfacl' if [ -f "$__object/parameter/recursive" ] then - if echo "$os" | grep -Eq 'macosx|freebsd' + if echo "$os" | grep -Fq 'freebsd' then echo "$os setfacl do not support recursive operations" >&2 else @@ -84,7 +84,7 @@ then then continue fi - if echo "$os" | grep -Eq 'macosx|freebsd' + if echo "$os" | grep -Fq 'freebsd' then remove="$acl" else @@ -100,7 +100,7 @@ for acl in $acl_should do if ! echo "$acl_is" | grep -Eq "^$acl" then - if echo "$os" | grep -Eq 'macosx|freebsd' \ + if echo "$os" | grep -Fq 'freebsd' \ && echo "$acl" | grep -Eq '^default:' then echo "setting default ACL in $os is currently not supported. sorry :(" >&2 From 510ea220f275caf2667547c55b54f06b55965bf5 Mon Sep 17 00:00:00 2001 From: Takashi Yoshi Date: Wed, 24 Apr 2019 11:02:32 +0200 Subject: [PATCH 007/383] [type/__block] Quote prefix and suffix correctly Before prefix and suffix were not allowed to contain " (quotes). --- cdist/conf/type/__block/gencode-remote | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__block/gencode-remote b/cdist/conf/type/__block/gencode-remote index f269c785..1f5cc033 100755 --- a/cdist/conf/type/__block/gencode-remote +++ b/cdist/conf/type/__block/gencode-remote @@ -18,6 +18,11 @@ # along with cdist. If not, see . # +# quote function from http://www.etalabs.net/sh_tricks.html +quote() { + printf '%s\n' "$1" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/" +} + file="$(cat "$__object/parameter/file" 2>/dev/null || echo "/$__object_id")" state_should=$(cat "$__object/parameter/state") prefix=$(cat "$__object/parameter/prefix" 2>/dev/null || echo "#cdist:__block/$__object_id") @@ -46,7 +51,7 @@ tmpfile=\$(mktemp ${file}.cdist.XXXXXXXXXX) if [ -f "$file" ]; then cp -p "$file" "\$tmpfile" fi -awk -v prefix="^$prefix\$" -v suffix="^$suffix\$" ' +awk -v prefix=^$(quote "$prefix")\$ -v suffix=^$(quote "$suffix")\$ ' { if (match(\$0,prefix)) { triggered=1 From 6dd5278aded69d62db030a53cfefb4dac1b46023 Mon Sep 17 00:00:00 2001 From: Takashi Yoshi Date: Wed, 24 Apr 2019 11:15:44 +0200 Subject: [PATCH 008/383] [explorer/init] Add support for OpenBSD --- cdist/conf/explorer/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/explorer/init b/cdist/conf/explorer/init index 43a66a50..a8a7857e 100755 --- a/cdist/conf/explorer/init +++ b/cdist/conf/explorer/init @@ -29,7 +29,7 @@ case "$uname_s" in Linux) (pgrep -P0 -l | awk '/^1[ \t]/ {print $2;}') || true ;; - FreeBSD) + FreeBSD|OpenBSD) ps -o comm= -p 1 || true ;; *) From f7ace88ec25957a71bf621cfefdc2e91db7d7994 Mon Sep 17 00:00:00 2001 From: Takashi Yoshi Date: Wed, 24 Apr 2019 11:36:57 +0200 Subject: [PATCH 009/383] [__postgres_{database,role}] Run psql with --no-password (-w) cdist does not work with interactive processes, so it's better to fail when manual password input is required. --- cdist/conf/type/__postgres_database/explorer/state | 2 +- cdist/conf/type/__postgres_role/explorer/state | 2 +- cdist/conf/type/__postgres_role/gencode-remote | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__postgres_database/explorer/state b/cdist/conf/type/__postgres_database/explorer/state index 652d81e7..d68d4120 100755 --- a/cdist/conf/type/__postgres_database/explorer/state +++ b/cdist/conf/type/__postgres_database/explorer/state @@ -34,7 +34,7 @@ esac name="$__object_id" -if test -n "$(su - "$postgres_user" -c "psql postgres -tAc \"SELECT 1 FROM pg_database WHERE datname='$name'\"")" +if test -n "$(su - "$postgres_user" -c "psql postgres -twAc \"SELECT 1 FROM pg_database WHERE datname='$name'\"")" then echo 'present' else diff --git a/cdist/conf/type/__postgres_role/explorer/state b/cdist/conf/type/__postgres_role/explorer/state index 5cc71477..c8e1fa9d 100755 --- a/cdist/conf/type/__postgres_role/explorer/state +++ b/cdist/conf/type/__postgres_role/explorer/state @@ -34,7 +34,7 @@ esac name="$__object_id" -if test -n "$(su - "$postgres_user" -c "psql postgres -tAc \"SELECT 1 FROM pg_roles WHERE rolname='$name'\"")" +if test -n "$(su - "$postgres_user" -c "psql postgres -twAc \"SELECT 1 FROM pg_roles WHERE rolname='$name'\"")" then echo 'present' else diff --git a/cdist/conf/type/__postgres_role/gencode-remote b/cdist/conf/type/__postgres_role/gencode-remote index 30d0689c..fd56e85d 100755 --- a/cdist/conf/type/__postgres_role/gencode-remote +++ b/cdist/conf/type/__postgres_role/gencode-remote @@ -55,7 +55,7 @@ case "$state_should" in [ -n "$password" ] && password="PASSWORD '$password'" cmd="CREATE ROLE $name WITH $password $booleans" - echo "su - '$postgres_user' -c \"psql postgres -c \\\"$cmd\\\"\"" + echo "su - '$postgres_user' -c \"psql postgres -wc \\\"$cmd\\\"\"" ;; absent) echo "su - '$postgres_user' -c \"dropuser \\\"$name\\\"\"" From 3ca337dfe0878a71ca14e550111d31fffa14b461 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 24 Apr 2019 12:23:37 +0200 Subject: [PATCH 010/383] ++changelog --- docs/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog b/docs/changelog index c64ca60a..ca66a0f0 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,6 +3,10 @@ Changelog next: * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) + * Explorer init: Add support for OpenBSD (sideeffect42) + * Type __postgres_database: Run psql with -w (no-password) (sideeffect42) + * Type __postgres_role: Run psql with -w (no-password) (sideeffect42) + * Type __block: Quote prefix/suffix - fix when prefix/suffix contains quotes (sideeffect42) 4.11.1: 2019-04-22 * Core: Improve explorer error reporting (Darko Poljak) From 8b93bf0218cf2097976159dab332dcaaff3f5eb4 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 30 Dec 2018 11:59:34 +0100 Subject: [PATCH 011/383] Migrate from github to ungleich gitlab --- bin/build-helper | 49 ++++++++---------- bin/build-helper.freebsd | 48 ++++++++---------- cdist/conf/type/__cdist/man.rst | 4 +- .../type/__cdist/parameter/default/source | 2 +- cdist/conf/type/__git/man.rst | 2 +- docs/dev/github-gitlab-migration/release | 50 +++++++++++++++++++ docs/src/cdist-hacker.rst | 20 ++++---- docs/src/cdist-install.rst | 13 ++--- docs/src/cdist-quickstart.rst | 2 +- 9 files changed, 112 insertions(+), 78 deletions(-) create mode 100755 docs/dev/github-gitlab-migration/release diff --git a/bin/build-helper b/bin/build-helper index 963f02f9..72f683b9 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -209,35 +209,30 @@ eof fi gpg --armor --detach-sign "${archivename}" || exit 1 - # make github release - curl -H "Authorization: token ${token}" \ - --request POST \ - --data "{ \"tag_name\":\"${tag}\", \ - \"target_commitish\":\"master\", \ - \"name\": \"${tag}\", \ - \"body\":\"${tag}\", \ - \"draft\":false, \ - \"prerelease\": false}" \ - "https://api.github.com/repos/ungleich/cdist/releases" || exit 1 + project="ungleich-public%2Fcdist" + sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/' - # get release ID - repoid=$(curl "https://api.github.com/repos/ungleich/cdist/releases/tags/${tag}" \ - | python3 -c 'import json; import sys; print(json.loads(sys.stdin.read())["id"])') \ + # upload archive + response_archive=$(curl -f -X POST \ + -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 \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "file=@${archivename}.asc" \ + "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ + | sed "${sed_cmd}") || exit 1 + + # make release + curl -f -X POST \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "description=Release ${tag}
${response_archive}
${response_archive_sig}" \ + "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ || exit 1 - # upload archive and then signature - curl -H "Authorization: token ${token}" \ - -H "Accept: application/vnd.github.manifold-preview" \ - -H "Content-Type: application/x-gtar" \ - --data-binary @${archivename} \ - "https://uploads.github.com/repos/ungleich/cdist/releases/${repoid}/assets?name=${archivename}" \ - || exit 1 - curl -H "Authorization: token ${token}" \ - -H "Accept: application/vnd.github.manifold-preview" \ - -H "Content-Type: application/pgp-signature" \ - --data-binary @${archivename}.asc \ - "https://uploads.github.com/repos/ungleich/cdist/releases/${repoid}/assets?name=${archivename}.asc" \ - || exit 1 # remove generated files (archive and asc) if [ $# -eq 2 ] @@ -314,7 +309,7 @@ eof "$0" release-git-tag # sign git tag - printf "Enter github authentication token: " + printf "Enter upstream repository authentication token: " read token "$0" sign-git-release "${target_version}" "${token}" diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index ea16ef42..cb8e5397 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -244,34 +244,28 @@ eof fi gpg --armor --detach-sign "${archivename}" || exit 1 - # make github release - curl -H "Authorization: token ${token}" \ - --request POST \ - --data "{ \"tag_name\":\"${tag}\", \ - \"target_commitish\":\"master\", \ - \"name\": \"${tag}\", \ - \"body\":\"${tag}\", \ - \"draft\":false, \ - \"prerelease\": false}" \ - "https://api.github.com/repos/ungleich/cdist/releases" || exit 1 + project="ungleich-public%2Fcdist" + sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/' - # get release ID - repoid=$(curl "https://api.github.com/repos/ungleich/cdist/releases/tags/${tag}" \ - | python3 -c 'import json; import sys; print(json.loads(sys.stdin.read())["id"])') \ - || exit 1 + # upload archive + response_archive=$(curl -f -X POST \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "file=@${archivename}" \ + "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ + | sed "${sed_cmd}") || exit 1 - # upload archive and then signature - curl -H "Authorization: token ${token}" \ - -H "Accept: application/vnd.github.manifold-preview" \ - -H "Content-Type: application/x-gtar" \ - --data-binary @${archivename} \ - "https://uploads.github.com/repos/ungleich/cdist/releases/${repoid}/assets?name=${archivename}" \ - || exit 1 - curl -H "Authorization: token ${token}" \ - -H "Accept: application/vnd.github.manifold-preview" \ - -H "Content-Type: application/pgp-signature" \ - --data-binary @${archivename}.asc \ - "https://uploads.github.com/repos/ungleich/cdist/releases/${repoid}/assets?name=${archivename}.asc" \ + # upload archive signature + response_archive_sig=$(curl -f -X POST \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "file=@${archivename}.asc" \ + "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ + | sed "${sed_cmd}") || exit 1 + + # make release + curl -f -X POST \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "description=Release ${tag}
${response_archive}
${response_archive_sig}" \ + "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ || exit 1 # remove generated files (archive and asc) @@ -349,7 +343,7 @@ eof "$0" release-git-tag # sign git tag - printf "Enter github authentication token: " + printf "Enter upstream repository authentication token: " read token "$0" sign-git-release "${target_version}" "${token}" diff --git a/cdist/conf/type/__cdist/man.rst b/cdist/conf/type/__cdist/man.rst index 9e1c72cb..15c77d7f 100644 --- a/cdist/conf/type/__cdist/man.rst +++ b/cdist/conf/type/__cdist/man.rst @@ -30,7 +30,7 @@ username source Select the source from which to clone cdist from. - Defaults to "git://github.com/ungleich/cdist.git". + Defaults to "git://code.ungleich.ch/ungleich-public/cdist.git". branch @@ -47,7 +47,7 @@ EXAMPLES __cdist /home/cdist/cdist # Use alternative source - __cdist --source "git://github.com/ungleich/cdist" /home/cdist/cdist + __cdist --source "git://code.ungleich.ch/ungleich-public/cdist" /home/cdist/cdist AUTHORS diff --git a/cdist/conf/type/__cdist/parameter/default/source b/cdist/conf/type/__cdist/parameter/default/source index 3f8e31ad..5f44a285 100644 --- a/cdist/conf/type/__cdist/parameter/default/source +++ b/cdist/conf/type/__cdist/parameter/default/source @@ -1 +1 @@ -git://github.com/ungleich/cdist.git +git://code.ungleich.ch/ungleich-public/cdist.git diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index 17e9c623..aa704d2b 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -44,7 +44,7 @@ EXAMPLES __git /home/services/dokuwiki --source git://github.com/splitbrain/dokuwiki.git # Checkout cdist, stay on branch 2.1 - __git /home/nico/cdist --source git://github.com/ungleich/cdist.git --branch 2.1 + __git /home/nico/cdist --source git://code.ungleich.ch/ungleich-public/cdist.git --branch 2.1 AUTHORS diff --git a/docs/dev/github-gitlab-migration/release b/docs/dev/github-gitlab-migration/release new file mode 100755 index 00000000..c973f0f1 --- /dev/null +++ b/docs/dev/github-gitlab-migration/release @@ -0,0 +1,50 @@ +#!/bin/sh -e + +set -x + +printf "Enter tag name: " +read tag +printf "Enter repository authentication token: " +read token + +git tag -d "${tag}" || : + +git tag "${tag}" -m "Release ${tag}" +git push origin "${tag}" + +echo 'foo' > foo +echo 'foo signature' > foo.asc + +archivename="foo" + +project="poljakowski%2Fmy-cdist-testing" +sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/' + +# upload archive +response_archive=$(curl -f -X POST \ + -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 \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "file=@${archivename}.asc" \ + "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ + | sed "${sed_cmd}") || exit 1 + +# make release +curl -f -X POST \ + -H "PRIVATE-TOKEN: ${token}" \ + -F "description=Release ${tag}
${response_archive}
${response_archive_sig}" \ + "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ + || exit 1 + +# get tag +curl -f -X GET \ + -H "PRIVATE-TOKEN: ${token}" \ + "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}" \ + || exit 1 + +rm -f foo foo.asc diff --git a/docs/src/cdist-hacker.rst b/docs/src/cdist-hacker.rst index d65c41a6..e4252e19 100644 --- a/docs/src/cdist-hacker.rst +++ b/docs/src/cdist-hacker.rst @@ -16,7 +16,7 @@ Reporting bugs -------------- If you believe you've found a bug and verified that it is in the latest version, drop a mail to the cdist mailing list, -subject prefixed with "[BUG] " or create an issue on github. +subject prefixed with "[BUG] " or create an issue on code.ungleich.ch. Coding conventions (everywhere) @@ -51,7 +51,7 @@ work nor kill the authors brain: As soon as your work meets these requirements, write a mail for inclusion to the mailinglist **cdist-configuration-management at googlegroups.com** -or open a pull request at http://github.com/ungleich/cdist. +or open a merge request at https://code.ungleich.ch/ungleich-public/cdist. How to submit a new type @@ -76,7 +76,7 @@ The following workflow works fine for most developers .. code-block:: sh # get latest upstream master branch - git clone https://github.com/ungleich/cdist.git + git clone https://code.ungleich.ch/ungleich-public/cdist.git # update if already existing cd cdist; git fetch -v; git merge origin/master @@ -88,22 +88,22 @@ The following workflow works fine for most developers # *hack* *hack* - # clone the cdist repository on github if you haven't done so + # clone the cdist repository on code.ungleich.ch if you haven't done so # configure your repo to know about your clone (only once) - git remote add github git@github.com:YOURUSERNAME/cdist.git + git remote add ungleich git@code.ungleich.ch:YOURUSERNAME/cdist.git - # push the new branch to github - git push github documentation_cleanup + # push the new branch to ungleich gitlab + git push ungleich documentation_cleanup # (or everything) - git push --mirror github + git push --mirror ungleich - # create a pull request at github (use a browser) + # create a merge request at ungleich gitlab (use a browser) # *fixthingsbecausequalityassurancefoundissuesinourpatch* *hack* - # push code to github again + # push code to ungleich gitlab again git push ... # like above # add comment that everything should be green now (use a browser) diff --git a/docs/src/cdist-install.rst b/docs/src/cdist-install.rst index afc50016..c05036b0 100644 --- a/docs/src/cdist-install.rst +++ b/docs/src/cdist-install.rst @@ -36,10 +36,13 @@ To install cdist, execute the following commands: .. code-block:: sh - git clone https://github.com/ungleich/cdist.git + git clone https://code.ungleich.ch/ungleich-public/cdist.git cd cdist export PATH=$PATH:$(pwd -P)/bin +From version 4.2.0 cdist tags and releases are signed. +You can get GPG public key used for signing `here <_static/pgp-key-EFD2AE4EC36B6901.asc>`_. + To install cdist with distutils from cloned repository, first you have to create version.py: @@ -74,14 +77,6 @@ So for instance if you want to use and stay with version 4.1, you can use git checkout -b 4.1 origin/4.1 -Git mirrors -^^^^^^^^^^^ - -If the main site is down, you can acquire cdist from one of the following sites: - - * git://github.com/telmich/cdist.git `github `_ - * git://git.code.sf.net/p/cdist/code `sourceforge `_ - Building and using documentation (man and html) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/src/cdist-quickstart.rst b/docs/src/cdist-quickstart.rst index 0020568d..b9220b67 100644 --- a/docs/src/cdist-quickstart.rst +++ b/docs/src/cdist-quickstart.rst @@ -56,7 +56,7 @@ code into your shell to get started and configure localhost:: # Get cdist # Mirrors can be found on # http://www.nico.schottelius.org/software/cdist/install/#index2h4 - git clone git://github.com/ungleich/cdist + git clone git://code.ungleich.ch/ungleich-public/cdist # Create manifest (maps configuration to host(s) cd cdist From 6ad261fdf26466be47d9d49b54f17bc34d6392b7 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 25 Apr 2019 23:04:38 +0200 Subject: [PATCH 012/383] ++changelog --- docs/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog b/docs/changelog index ca66a0f0..9c87d3f7 100644 --- a/docs/changelog +++ b/docs/changelog @@ -7,6 +7,8 @@ next: * Type __postgres_database: Run psql with -w (no-password) (sideeffect42) * Type __postgres_role: Run psql with -w (no-password) (sideeffect42) * Type __block: Quote prefix/suffix - fix when prefix/suffix contains quotes (sideeffect42) + * Build: Update due to migration to code.ungleich.ch (Darko Poljak) + * Documentation: Update due to migration to code.ungleich.ch (Darko Poljak) 4.11.1: 2019-04-22 * Core: Improve explorer error reporting (Darko Poljak) From 2505023387ea670fa12af1e9c69c503ac5681136 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 1 May 2019 12:31:30 +0200 Subject: [PATCH 013/383] Append requirement only if already not present --- cdist/emulator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cdist/emulator.py b/cdist/emulator.py index 5103f1a4..3cf82f84 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -319,7 +319,9 @@ class Emulator(object): lastcreatedtype) else: if 'require' in self.env: - self.env['require'] += " " + lastcreatedtype + appendix = " " + lastcreatedtype + if appendix not in self.env['require']: + self.env['require'] += appendix else: self.env['require'] = lastcreatedtype self.log.debug(("Injecting require for " From edfaa65d2b37fcb4a7de2280b61dec30dd3a8c5d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 1 May 2019 14:18:39 +0200 Subject: [PATCH 014/383] Detect dependency cycle as soon as possible --- cdist/config.py | 59 ++++++++++++++++++++++++++++-- cdist/test/config/__init__.py | 68 +++++++++++++++++++++++++++++++++-- 2 files changed, 123 insertions(+), 4 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index fae2ff46..4e226b3a 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -43,6 +43,33 @@ from cdist import core, inventory from cdist.util.remoteutil import inspect_ssh_mux_opts +def graph_check_cycle(graph): + # Start from each node in the graph and check for cycle starting from it. + for node in graph: + # Cycle path. + path = [node] + has_cycle = _graph_dfs_cycle( graph, node, path) + if has_cycle: + return has_cycle, path + return False, None + + +def _graph_dfs_cycle(graph, node, path): + for neighbour in graph.get(node, ()): + # If node is already in path then this is cycle. + if neighbour in path: + path.append(neighbour) + return True + path.append(neighbour) + rv = _graph_dfs_cycle(graph, neighbour, path) + if rv: + return True + # Remove last item from list - neighbour whose DFS path we have have + # just checked. + del path[-1] + return False + + class Config(object): """Cdist main class to hold arbitrary data""" @@ -254,14 +281,14 @@ class Config(object): cls.onehost(host, host_tags, host_base_path, hostdir, args, parallel=False, configuration=configuration) - except cdist.Error as e: + except cdist.Error: failed_hosts.append(host) if args.parallel and len(process_args) == 1: log.debug("Only 1 host for parallel processing, doing it " "sequentially") try: cls.onehost(*process_args[0]) - except cdist.Error as e: + except cdist.Error: failed_hosts.append(host) elif args.parallel: log.trace("Multiprocessing start method is {}".format( @@ -653,6 +680,28 @@ class Config(object): self.__dict__.update(state) self._open_logger() + def _validate_dependencies(self): + ''' + Build dependency graph for unfinished objects and + check for cycles. + ''' + graph = {} + for cdist_object in self.object_list(): + obj_name = cdist_object.name + if obj_name not in graph: + graph[obj_name] = [] + if cdist_object.state == cdist_object.STATE_DONE: + continue + + for requirement in cdist_object.requirements_unfinished( + cdist_object.requirements): + graph[obj_name].append(requirement.name) + + for requirement in cdist_object.requirements_unfinished( + cdist_object.autorequire): + graph[obj_name].append(requirement.name) + return graph_check_cycle(graph) + def iterate_until_finished(self): """ Go through all objects and solve them @@ -662,6 +711,12 @@ class Config(object): objects_changed = True while objects_changed: + # Check for cycles as early as possible. + has_cycle, path = self._validate_dependencies() + if has_cycle: + raise cdist.UnresolvableRequirementsError( + "Cycle detected in object dependencies:\n{}!".format( + " -> ".join(path))) objects_changed = self.iterate_once() # Check whether all objects have been finished diff --git a/cdist/test/config/__init__.py b/cdist/test/config/__init__.py index 2b0d8b5f..499593e3 100644 --- a/cdist/test/config/__init__.py +++ b/cdist/test/config/__init__.py @@ -23,7 +23,6 @@ import os import shutil -import tempfile from cdist import test from cdist import core @@ -212,7 +211,7 @@ class ConfigRunTestCase(test.CdistTestCase): dryrun.run() # if we are here, dryrun works like expected - def test_desp_resolver(self): + def test_deps_resolver(self): """Test to show dependency resolver warning message.""" local = cdist.exec.local.Local( target_host=self.target_host, @@ -229,6 +228,71 @@ class ConfigRunTestCase(test.CdistTestCase): config = cdist.config.Config(local, self.remote, dry_run=True) config.run() + def test_graph_check_cycle_empty(self): + graph = {} + has_cycle, path = cdist.config.graph_check_cycle(graph) + self.assertFalse(has_cycle) + + def test_graph_check_cycle_1(self): + # + # a -> b -> c + # | + # +--> d -> e + graph = { + 'a': ['b', ], + 'b': ['c', 'd', ], + 'd': ['e', ], + } + has_cycle, path = cdist.config.graph_check_cycle(graph) + self.assertFalse(has_cycle) + + def test_graph_check_cycle_2(self): + # + # a -> b -> c + # /\ | + # \ | + # +-------+ + graph = { + 'a': ['b', ], + 'b': ['c', ], + 'c': ['a', ], + } + has_cycle, path = cdist.config.graph_check_cycle(graph) + self.assertTrue(has_cycle) + self.assertGreater(path.count(path[-1]), 1) + + def test_graph_check_cycle_3(self): + # + # a -> b -> c + # \ \ + # \ +--> g + # \ /\ + # \ /| + # +-> d -> e | + # \ | + # + --> f + # + # h -> i --> j + # | /\ | + # \/ | \/ + # n m <- k + graph = { + 'a': ['b', 'd', ], + 'b': ['c', ], + 'c': ['g', ], + 'd': ['e', 'f', ], + 'e': ['g', ], + 'f': ['g', ], + 'h': ['i', 'n', ], + 'i': ['j', ], + 'j': ['k', ], + 'k': ['m', ], + 'm': ['i', ], + } + has_cycle, path = cdist.config.graph_check_cycle(graph) + self.assertTrue(has_cycle) + self.assertGreater(path.count(path[-1]), 1) + # Currently the resolving code will simply detect that this object does # not exist. It should probably check if the type is a singleton as well From 2a0a24ecccaf555591a560af934843e57f3689a2 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 May 2019 14:38:48 +0200 Subject: [PATCH 015/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 9c87d3f7..d367ed47 100644 --- a/docs/changelog +++ b/docs/changelog @@ -9,6 +9,7 @@ next: * Type __block: Quote prefix/suffix - fix when prefix/suffix contains quotes (sideeffect42) * Build: Update due to migration to code.ungleich.ch (Darko Poljak) * Documentation: Update due to migration to code.ungleich.ch (Darko Poljak) + * Core: Detect and report dependency cycle as soon as possible (Darko Poljak) 4.11.1: 2019-04-22 * Core: Improve explorer error reporting (Darko Poljak) From 6258e397ed7ee64d394372dc2dd2953a236e04fe Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 May 2019 21:39:25 +0200 Subject: [PATCH 016/383] Include changelog in gitlab release --- bin/build-helper | 7 ++++++- bin/build-helper.freebsd | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index 72f683b9..d72c6cab 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -227,9 +227,14 @@ eof | sed "${sed_cmd}") || exit 1 # make release + changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') + release_notes=$( + printf "Release %s\n\n%s\n\n%s\n\n**Changelog**\n\n%s\n" \ + "${tag}" "${response_archive}" "${response_archive_sig}" "${changelog}" + ) curl -f -X POST \ -H "PRIVATE-TOKEN: ${token}" \ - -F "description=Release ${tag}
${response_archive}
${response_archive_sig}" \ + -F "description=${release_notes}" \ "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ || exit 1 diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index cb8e5397..4f393cb0 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -262,9 +262,14 @@ eof | sed "${sed_cmd}") || exit 1 # make release + changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') + release_notes=$( + printf "Release %s\n\n%s\n\n%s\n\n**Changelog**\n\n%s\n" \ + "${tag}" "${response_archive}" "${response_archive_sig}" "${changelog}" + ) curl -f -X POST \ -H "PRIVATE-TOKEN: ${token}" \ - -F "description=Release ${tag}
${response_archive}
${response_archive_sig}" \ + -F "description=${release_notes}" \ "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ || exit 1 From fe833fdfcb466ab460a76123b078a0e778cf924c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 May 2019 21:46:17 +0200 Subject: [PATCH 017/383] Sign git tag as one of the last steps If it fails then the whole release should not fail, signing git tag can be tried again. --- bin/build-helper | 10 +++++----- bin/build-helper.freebsd | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index d72c6cab..53dbf5da 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -313,11 +313,6 @@ eof # Tag the current commit "$0" release-git-tag - # sign git tag - printf "Enter upstream repository authentication token: " - read token - "$0" sign-git-release "${target_version}" "${token}" - # Also merge back the version branch if [ "$masterbranch" = yes ]; then git checkout master @@ -343,6 +338,11 @@ eof # Archlinux release is based on pypi make archlinux-release + # sign git tag + printf "Enter upstream repository authentication token: " + read token + "$0" sign-git-release "${target_version}" "${token}" + # Announce change on ML make ml-release diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index 4f393cb0..f3d1fca1 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -347,11 +347,6 @@ eof # Tag the current commit "$0" release-git-tag - # sign git tag - printf "Enter upstream repository authentication token: " - read token - "$0" sign-git-release "${target_version}" "${token}" - # Also merge back the version branch if [ "$masterbranch" = yes ]; then git checkout master @@ -393,6 +388,11 @@ eof ;; esac + # sign git tag + printf "Enter upstream repository authentication token: " + read token + "$0" sign-git-release "${target_version}" "${token}" + # Announce change on ML make helper=${helper} WEBDIR=${WEBDIR} ml-release ;; From 71945ef956a227d9abe33d0e415e2670fa6c0060 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 May 2019 21:55:27 +0200 Subject: [PATCH 018/383] Fix copy-paste thing --- bin/build-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-helper b/bin/build-helper index 53dbf5da..b5898ae3 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -400,7 +400,7 @@ eof ;; shellcheck) - make helper=${helper} WEBDIR=${WEBDIR} shellcheck + make shellcheck printf "\\nPlease review shellcheck report.\\n" while true do From bd9884fac4c46c29d4313cadd40020bf8cf542be Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 May 2019 22:16:51 +0200 Subject: [PATCH 019/383] Tell curl to use HTTP version 1.1 By default, was getting the following error: curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) --- bin/build-helper | 2 ++ bin/build-helper.freebsd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bin/build-helper b/bin/build-helper index b5898ae3..0fea5071 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -214,6 +214,7 @@ eof # upload archive response_archive=$(curl -f -X POST \ + --http1.1 \ -H "PRIVATE-TOKEN: ${token}" \ -F "file=@${archivename}" \ "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ @@ -221,6 +222,7 @@ eof # upload archive signature response_archive_sig=$(curl -f -X POST \ + --http1.1 \ -H "PRIVATE-TOKEN: ${token}" \ -F "file=@${archivename}.asc" \ "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index f3d1fca1..9823dab5 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -249,6 +249,7 @@ eof # upload archive response_archive=$(curl -f -X POST \ + --http1.1 \ -H "PRIVATE-TOKEN: ${token}" \ -F "file=@${archivename}" \ "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ @@ -256,6 +257,7 @@ eof # upload archive signature response_archive_sig=$(curl -f -X POST \ + --http1.1 \ -H "PRIVATE-TOKEN: ${token}" \ -F "file=@${archivename}.asc" \ "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ From 0ab43e24055e00324e18852356f8e2b85637df94 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 13 Apr 2019 21:18:27 +0200 Subject: [PATCH 020/383] Release -j/--jobs option, i.e. make it non-beta --- cdist/argparse.py | 5 ++--- docs/src/cdist-parallelization.rst | 7 +++---- docs/src/man1/cdist.rst | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cdist/argparse.py b/cdist/argparse.py index 72fc0d0f..3ebdc138 100644 --- a/cdist/argparse.py +++ b/cdist/argparse.py @@ -11,7 +11,7 @@ import cdist.configuration BETA_COMMANDS = set(('install', 'inventory', )) # set of beta arguments for sub-commands BETA_ARGS = { - 'config': set(('jobs', 'tag', 'all_tagged_hosts', 'use_archiving', )), + 'config': set(('tag', 'all_tagged_hosts', 'use_archiving', )), } EPILOG = "Get cdist at http://www.nico.schottelius.org/software/cdist/" # Parser others can reuse @@ -191,8 +191,7 @@ def get_parsers(): name="positive int"), help=('Operate in parallel in specified maximum number of jobs. ' 'Global explorers, object prepare and object run are ' - 'supported. Without argument CPU count is used by default. ' - 'Currently in beta.'), + 'supported. Without argument CPU count is used by default. '), action='store', dest='jobs', const=multiprocessing.cpu_count()) parser['config_main'].add_argument( diff --git a/docs/src/cdist-parallelization.rst b/docs/src/cdist-parallelization.rst index ed3afae9..d458a128 100644 --- a/docs/src/cdist-parallelization.rst +++ b/docs/src/cdist-parallelization.rst @@ -12,8 +12,7 @@ The other way is to operate in parallel within one host where you specify the number of jobs. This is enabled with :strong:`-j/--jobs` option where you can specify the number of parallel jobs. By default, :strong:`multiprocessing.cpu_count()` is used. For this mode global explorers, -object preparation and object run are supported and this option is still in -:strong:`beta`. +object preparation and object run are supported. You can, of course, use those two options together. This means that each host will be processed by its own process. Within each process cdist will operate @@ -32,11 +31,11 @@ Examples # Configure hosts read from file hosts.file sequentially but using default # number of parallel jobs - $ cdist config -b -j -f hosts.file + $ cdist config -j -f hosts.file # Configure hosts read from file hosts.file in parallel using 16 # parallel jobs - $ cdist config -b -j 16 -p -f hosts.file + $ cdist config -j 16 -p -f hosts.file Caveats diff --git a/docs/src/man1/cdist.rst b/docs/src/man1/cdist.rst index 2eb0ce00..30832f2f 100644 --- a/docs/src/man1/cdist.rst +++ b/docs/src/man1/cdist.rst @@ -165,7 +165,7 @@ Install command is currently in beta. Operate in parallel in specified maximum number of jobs. Global explorers, object prepare and object run are supported. Without argument CPU count is used by - default. Currently in beta. + default. **-n, --dry-run** Do not execute code. From 249ac917d3ed0620be768e27c4baa34e02e962a1 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 23 Apr 2019 22:39:41 +0200 Subject: [PATCH 021/383] Changes due to new website --- .gitignore | 1 + Makefile | 61 +------ README | 3 +- bin/build-helper | 35 +--- bin/build-helper.freebsd | 99 +++-------- docs/src/_static/cdist-logo.jpeg | Bin 0 -> 12560 bytes docs/src/{ => _static}/cdist-logo.png | Bin .../_static}/pgp-key-EFD2AE4EC36B6901.asc | 0 docs/src/cdist-intro.rst | 15 -- docs/src/cdist-os.rst | 23 +-- docs/src/cdist-support.rst | 10 +- .../{cdist-update.rst => cdist-upgrade.rst} | 4 +- docs/src/conf.py | 5 +- docs/src/index.rst | 17 +- docs/web/cdist.mdwn | 21 --- docs/web/cdist/cdist-logo.png | Bin 1542 -> 0 bytes docs/web/cdist/documentation.mdwn | 12 -- docs/web/cdist/features.mdwn | 26 --- docs/web/cdist/install.mdwn | 103 ------------ docs/web/cdist/os.mdwn | 18 -- docs/web/cdist/support.mdwn | 28 ---- docs/web/cdist/update.mdwn | 158 ------------------ docs/web/cdist/update/2.0-to-2.1.mdwn | 118 ------------- docs/web/cdist/why.mdwn | 69 -------- 24 files changed, 62 insertions(+), 764 deletions(-) create mode 100644 docs/src/_static/cdist-logo.jpeg rename docs/src/{ => _static}/cdist-logo.png (100%) rename docs/{web/cdist => src/_static}/pgp-key-EFD2AE4EC36B6901.asc (100%) delete mode 100644 docs/src/cdist-intro.rst rename docs/src/{cdist-update.rst => cdist-upgrade.rst} (99%) delete mode 100644 docs/web/cdist.mdwn delete mode 100644 docs/web/cdist/cdist-logo.png delete mode 100644 docs/web/cdist/documentation.mdwn delete mode 100644 docs/web/cdist/features.mdwn delete mode 100644 docs/web/cdist/install.mdwn delete mode 100644 docs/web/cdist/os.mdwn delete mode 100644 docs/web/cdist/support.mdwn delete mode 100644 docs/web/cdist/update.mdwn delete mode 100644 docs/web/cdist/update/2.0-to-2.1.mdwn delete mode 100644 docs/web/cdist/why.mdwn diff --git a/.gitignore b/.gitignore index 460bbf28..4b80b425 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ Session.vim # Temporary .netrwhist *~ +*.tmp # Auto-generated tag files tags # Persistent undo diff --git a/Makefile b/Makefile index 5f03997a..099812e2 100644 --- a/Makefile +++ b/Makefile @@ -24,13 +24,6 @@ DOCS_SRC_DIR=docs/src SPEECHDIR=docs/speeches TYPEDIR=cdist/conf/type -WEBSRCDIR=docs/web - -WEBDIR=$$HOME/vcs/www.nico.schottelius.org -WEBBLOG=$(WEBDIR)/blog -WEBBASE=$(WEBDIR)/software/cdist -WEBPAGE=$(WEBBASE).mdwn - CHANGELOG_VERSION=$(shell $(helper) changelog-version) CHANGELOG_FILE=docs/changelog @@ -47,7 +40,6 @@ SHELLCHECK_SKIP=grep -v ': __.*is referenced but not assigned.*\[SC2154\]' ################################################################################ # Manpages # -MAN1DSTDIR=$(DOCS_SRC_DIR)/man1 MAN7DSTDIR=$(DOCS_SRC_DIR)/man7 # Manpages #1: Types @@ -81,24 +73,6 @@ docs: man html docs-clean: $(SPHINXC) -# Manpages #5: release part -MANWEBDIR=$(WEBBASE)/man/$(CHANGELOG_VERSION) -HTMLBUILDDIR=docs/dist/html - -docs-dist: html - rm -rf "${MANWEBDIR}" - mkdir -p "${MANWEBDIR}" - # mkdir -p "${MANWEBDIR}/man1" "${MANWEBDIR}/man7" - # cp ${MAN1DSTDIR}/*.html ${MAN1DSTDIR}/*.css ${MANWEBDIR}/man1 - # cp ${MAN7DSTDIR}/*.html ${MAN7DSTDIR}/*.css ${MANWEBDIR}/man7 - cp -R ${HTMLBUILDDIR}/* ${MANWEBDIR} - cd ${MANWEBDIR} && git add . && git commit -m "cdist manpages update: $(CHANGELOG_VERSION)" || true - -man-latest-link: web-pub - # Fix ikiwiki, which does not like symlinks for pseudo security - ssh staticweb.ungleich.ch \ - "cd /home/services/www/nico/nico.schottelius.org/www/software/cdist/man/ && rm -f latest && ln -sf "$(CHANGELOG_VERSION)" latest" - # Manpages: .cdist Types DOT_CDIST_PATH=${HOME}/.cdist DOTMAN7DSTDIR=$(MAN7DSTDIR) @@ -111,7 +85,6 @@ DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX)) $(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst ln -sf "$^" $@ -# Manpages #3: generic part dotman: $(DOTMANTYPES) $(SPHINXM) @@ -120,7 +93,6 @@ dotman: $(DOTMANTYPES) # SPEECHESOURCES=$(SPEECHDIR)/*.tex SPEECHES=$(SPEECHESOURCES:.tex=.pdf) -SPEECHESWEBDIR=$(WEBBASE)/speeches # Create speeches and ensure Toc is up-to-date $(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex @@ -130,36 +102,6 @@ $(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex speeches: $(SPEECHES) -speeches-dist: speeches - rm -rf "${SPEECHESWEBDIR}" - mkdir -p "${SPEECHESWEBDIR}" - cp ${SPEECHES} "${SPEECHESWEBDIR}" - cd ${SPEECHESWEBDIR} && git add . && git commit -m "cdist speeches updated" || true - -################################################################################ -# Website -# - -BLOGFILE=$(WEBBLOG)/cdist-$(CHANGELOG_VERSION)-released.mdwn - -$(BLOGFILE): $(CHANGELOG_FILE) - $(helper) blog $(CHANGELOG_VERSION) $(BLOGFILE) - -web-blog: $(BLOGFILE) - -web-doc: - # Go to top level, because of cdist.mdwn - rsync -av "$(WEBSRCDIR)/" "${WEBBASE}/.." - cd "${WEBBASE}/.." && git add cdist* && git commit -m "cdist doc update" cdist* || true - -web-dist: web-blog web-doc - -web-pub: web-dist docs-dist speeches-dist - cd "${WEBDIR}" && make pub - -web-release-all: man-latest-link -web-release-all-no-latest: web-pub - ################################################################################ # Release: Mailinglist # @@ -239,6 +181,9 @@ clean: rm -f cdist-*.tar.gz rm -f cdist-*.tar.gz.asc + # Temp files + rm -f *.tmp + distclean: clean rm -f cdist/version.py diff --git a/README b/README index a67e25e3..caf2dac8 100644 --- a/README +++ b/README @@ -3,4 +3,5 @@ cdist cdist is a usable configuration management system. -For the web documentation have a look at docs/web/. +For the web documentation have a look at https://www.cdi.st/ +or at docs/src for reStructuredText manual. diff --git a/bin/build-helper b/bin/build-helper index 0fea5071..04b7621b 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -76,33 +76,6 @@ case "$option" in "$0" test ;; - blog) - version=$1; shift - blogfile=$1; shift - dir=${blogfile%/*} - file=${blogfile##*/} - - - cat << eof > "$blogfile" -[[!meta title="Cdist $version released"]] - -Here's a short overview about the changes found in version ${version}: - -eof - - $0 changelog-changes "$version" >> "$blogfile" - - cat << eof >> "$blogfile" -For more information visit the [[cdist homepage|software/cdist]]. - -[[!tag cdist config unix]] -eof - cd "$dir" - git add "$file" - # Allow git commit to fail if there are no changes - git commit -m "cdist blog update: $version" "$blogfile" || true - ;; - ml-release) if [ $# -ne 1 ]; then echo "$0 ml-release version" >&2 @@ -324,13 +297,6 @@ eof # Publish git changes make pub - # publish man, speeches, website - if [ "$masterbranch" = yes ]; then - make web-release-all - else - make web-release-all-no-latest - fi - # Ensure that pypi release has the right version "$0" version @@ -351,6 +317,7 @@ eof cat << eof Manual steps post release: + - cdist-web - linkedin - hackernews - reddit diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index 9823dab5..c292280c 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -31,30 +31,13 @@ basedir=${0%/*}/../ # .freebsd - run as freebsd basename=${0##*/} run_as=${basename#*.} -case "$run_as" in - freebsd) - to_a=cdist-configuration-management - to_d=googlegroups.com - from_a=darko.poljak - from_d=gmail.com - ml_name="Darko Poljak" - ml_sig_name="Darko" - # vars for make - WEBDIR=../vcs/www.nico.schottelius.org - ;; - *) - to_a=cdist - to_d=l.schottelius.org - from_a=nico-cdist - from_d=schottelius.org - ml_name="Nico -telmich- Schottelius" - ml_sig_name="Nico" - - # vars for make - WEBDIR=$$HOME/vcs/www.nico.schottelius.org - ;; -esac +to_a=cdist-configuration-management +to_d=googlegroups.com +from_a=darko.poljak +from_d=gmail.com +ml_name="Darko Poljak" +ml_sig_name="Darko" # Change to checkout directory cd "$basedir" @@ -66,7 +49,6 @@ option=$1; shift case "$option" in print-make-vars) printf "helper: ${helper}\n" - printf "WEBDIR: ${WEBDIR}\n" ;; print-runas) printf "run_as: $run_as\n" @@ -117,33 +99,6 @@ case "$option" in "$0" test ;; - blog) - version=$1; shift - blogfile=$1; shift - dir=${blogfile%/*} - file=${blogfile##*/} - - - cat << eof > "$blogfile" -[[!meta title="Cdist $version released"]] - -Here's a short overview about the changes found in version ${version}: - -eof - - $0 changelog-changes "$version" >> "$blogfile" - - cat << eof >> "$blogfile" -For more information visit the [[cdist homepage|software/cdist]]. - -[[!tag cdist config unix]] -eof - cd "$dir" - git add "$file" - # Allow git commit to fail if there are no changes - git commit -m "cdist blog update: $version" "$blogfile" || true - ;; - ml-release) if [ $# -ne 1 ]; then echo "$0 ml-release version" >&2 @@ -159,7 +114,7 @@ eof cat << eof From: ${ml_name} <$from> To: cdist mailing list <$to> -Subject: cdist $version released +Subject: cdist $version has been released Hello .*, @@ -177,7 +132,7 @@ ${ml_sig_name} -- Automatisation at its best level. With cdist. eof - ) | /usr/sbin/sendmail -f "$from" "$to" + ) > mailinglist.tmp ;; release-git-tag) @@ -337,11 +292,11 @@ eof # Generate documentation (man and html) # First, clean old generated docs - make helper=${helper} WEBDIR=${WEBDIR} docs-clean - make helper=${helper} WEBDIR=${WEBDIR} docs + make helper=${helper} docs-clean + make helper=${helper} docs # Generate speeches (indirect check if they build) - make helper=${helper} WEBDIR=${WEBDIR} speeches + make helper=${helper} speeches ############################################################# # Everything green, let's do the release @@ -364,7 +319,7 @@ eof git push -u origin "${target_branch}" ;; *) - make helper=${helper} WEBDIR=${WEBDIR} pub + make helper=${helper} pub ;; esac @@ -372,23 +327,7 @@ eof "$0" version # Create and publish package for pypi - make helper=${helper} WEBDIR=${WEBDIR} pypi-release - - # publish man, speeches, website - if [ "$masterbranch" = yes ]; then - make helper=${helper} WEBDIR=${WEBDIR} web-release-all - else - make helper=${helper} WEBDIR=${WEBDIR} web-release-all-no-latest - fi - - case "$run_as" in - freebsd) - ;; - *) - # Archlinux release is based on pypi - make archlinux-release - ;; - esac + make helper=${helper} pypi-release # sign git tag printf "Enter upstream repository authentication token: " @@ -396,7 +335,15 @@ eof "$0" sign-git-release "${target_version}" "${token}" # Announce change on ML - make helper=${helper} WEBDIR=${WEBDIR} ml-release + make helper=${helper} ml-release + + cat << eof +Manual steps post release: + + - cdist-web + - twitter + +eof ;; test) @@ -441,7 +388,7 @@ eof ;; shellcheck) - make helper=${helper} WEBDIR=${WEBDIR} shellcheck + make helper=${helper} shellcheck printf "\\nPlease review shellcheck report.\\n" while true do diff --git a/docs/src/_static/cdist-logo.jpeg b/docs/src/_static/cdist-logo.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..9bfa25298bb427d56cece5b630beb2447b618c31 GIT binary patch literal 12560 zcmeHtdpMNs-u7+R*bg$a!4!&;lugQRNC*j)6fy0QM^cFxbK4}Lc#uS8Y(hm%%BEB% z*`*z_SD2xVy&1+d%suzKmuIbKeQP~E>wVYyj_*B=?~gTy%Q%j?%zgc?-{w4j=XD9X z1)rb`kchDG!Vh?ff*&z)F)>k5F-Z(&k+`&^w6v6@l$4CDf}D)3ysVUzoRXaUVnrMd zCyiBJqNKP)K@q1YBm(A(ib;rxNhr!l$teEYFTqPlUR($gUMV7^4hhQ(iO35H>V)zj zNJvcRw-@x+myj@6-y)2-grt-lBrGH%A}lJhuv#!P0(=IE%8Mzi+-S9EvFjm>dXS=i zR7$S6#@5mr+^$xprorLU(GrqM%1f3mTeVtCd(B!yqfN$}x0qOOv$3_?Ztt*rkK11N zefvF*96fg2$Jg(~nX|#?LPF1n#axKJ7KhtgH@*4T*51+C)!oy}7##ZY_1pL1kx|z4411RIgF81b1d05`9Ps-u z2K}8q^1vQpQBe_5%z`~a!XaRY$cu`t+_*@=$`x}cXtBC}l(^#7l-$x92@Qi?Ox)qq zt&&QbhKyCL1(SZW=wCA^`v1zJzZvv5dj!3ZvO&UmvPL#hUqH-te>=xfp#< z!v$IxBa%#FQn{42;n>9Knv+H46^9RBnYNP34oXSMK0if#F9UC*F`Wg_oB=Tw&%qG+ zGQ%RnCddH)DNHZ4An-F$b8jy8RsT|EA3ye1`tzwX#f?FlkIe2qA9|Y(L2?_TBgWX# zG;x@IpE4b0u|fbnJWdfnc}kI{1KbF>!Fhf$A|rqzD=A329b!Qn(&9^?iv-Y1&t}wt z+MJ**GA}8BqG56ec?JJ|wZe)1)vQe^g(J(dDa97qyX_U$>1!t$%T(AN$9%7uOWxVR zo+XFDHHrf0OCO0SfQ}dlpbfmsZTAK3j;>fn(tj3k)Yh0A-`A1W*mwCZAoN;16%` zN7JNwJk`ub@>#5YQvvC2T05iZC1+8jMR#6a#nYteUY$z^?4|E$+Nmzx{+f{P_|KR2 z-!1#U`3(QA=#POgMYaGD62y%XK!?T#_-eB?E<(gsJ!G)}LU(jA?D$b#0?0ZHJy$#r z%!!7<oM=pT zzA}lJ2cPkmDdR-H_u0|#%)GdKvM*I0z7@PT2BC#W`c)gN%EzrV*Dh+vE|sF#f)+R6kAgMDOs)wzGIPV z{+W3x^6;f7H>=Iiiplekyq~QAFL46-tG!v zTnZ#io*M1C1Eigo0HL=@D+Q2xcDw-c-T)7m-w%7uj6)K_wD_SlU|whW@V|}$Dc9An z9mZKUY0`y==ExC#wS_oIF3aEPOvAOx-V!^R!eM&<&Z5@nqk4#V0yM9bfHbf`6&S0n zxS~mx=LX&x-KV*(_rBU?PladfXT)r`iH)b`Wk*F-#X_5d!$dQBqZE78jOB!gz&x>$P z1(4Vb@W4EQF$1f>!&v$hqTDQi8iz$V9}|$Baj29j>&5CTw_D9rH4jA{<%tfRYSyrT z@gDq4=DFwnYnay(OP;IufogK{o#mI6XJsz`Xz&#|oS>Z}obZmN6<+>HCQv%x zBS8WvhY&+!5(xqbpM(A6pu^JpX`50OHj}85xkN^*W_0@sV-5)cfkMr}rv8*qdy_BC z@&<6+m|dOaOGPW^ue{3$ku5GWOsc;gX>!^bcgs@jr+PXz*GnDFK!J}0&}x5XKKgPD z6!aHR1jYt8cb69myk$?;B)}3p1Swy*KJ; z<#5e}dmUM)jXkF7xwC`fthK{#dx4e8X`O)Mhq28u%_lo%S3!!dJFHDwu%eupN4V!aQHw4C^%X3#-j<=s`wia)Yf_42!|KEqC=XMw&b;+%l^UU{@7<#?{HPyN#-o^lMb(wD~msFUf8CgD;C znERWPG+Ftfo3YO0a|?kCk$YN+@i23amPBAMPto7G8l zJo>aOYyT#@m6rQ2>R1PwY^xePX{`+Q({rII>;&Q9PFswEBy4DVan_f22J$nqSp3d zP$?N!qjl>#!>Na%yOfk=SWS$ks_OVBAXgFL*Z^yf1V{4F#VPQV!9C2&~^c| zcy>UN`_{gNe({r&apw<{J^EYUycsRnXYk~pb@&n0G4`^5T4n!MfoBN47)~71XS{>H z25}oQ-{$EVeWd(xqD)ZudVP&}Q_AiZS$kY3i19`bLam;dzxP^}*vB5$Y98X>iOWJo&iVtz#;=&vhBxj+S5gW7Oof1j4o2{t#;N-OKSo}excC+K6K{8 zxpo3bv$$q}gDDe0tvbYat6*nX9B_&BP*e0Jhcds)SLFT!=fR?StSqvWDO);(#Szz2 z@@7wyv=CgHGb}<13gr01*i`HLlb6A>B1knC9lZ{a=2i-rE z{Rx5jH_8d|0)e@=dCnX!2X`Ad1N)?i&pNo)pz8l3fYMr77=DbQ0OHG)39;@2Vu625 zW7-hrjETwusQaA&ns*W-$98=$LgbxMr>=UCxdsF@&5D?N7P=5Cnijc5vum&jQB32^ zcUtI%Ho9>G=@Gj;u|gwfjLN^(=U)x*IJP_#Xmk2g7X{Glm>!yx8flS9{iZkMgIpu10838)08?MUJJXSR1lXP0 zI7H#e0>U=@BS&`q-#q}^qQ_OALT<*z6UK>Y;D79hWgXnd0!S2OZQ8FaEq>xOJUl$c z$@(ADfM7tQml0KbT9D-oV(ffy&6U}^vPE~-s_l?h*%sGb?TPkueX)rE2q?ClRhMnR ze{6P0;&h8|il?8;%u5Nmb09swgw5%L2T>o;=r@U_gXDG?cbvwOmhBg2GVEtpNVtZq zX-eqE+t%nNGnUXF=Ey2@g83IMbkR2LjB4c;n~b<00RiFeX9E4YZpDe+)@W56s@55A zmVs-q4?KE2>+p($j?osrWqsP|#DHck!mrd0RjuuhTF$=pGIlDvSnFJV>T|DhPQ6KombrVDAaWBT683>H*Nm5?bKlJEH{dx?};ANNwxY7MYPkRbb$* zR@ZizxgRfpl67Ykb_mq(A3M%$58 zk!Ad~%*i;+MG~QKM5$yV;81{SiPOrrI2%a`izm2z8z^XC3A)mgq{Vd`Y+llbn=bR( z6yCBt-y~O?mKcD)0vo8U>L}3QJ3$v`+<$Ppk}2ERI*wK6Lrmt!~C1 z*)OSLkSB90&WNb&zp2VLzR2rDZ$aB7`r}8j1=noN)AuO&PY`2a=638AvdQDj}YrT#?!C%h5KsfvY!|~t-A3Gm$OzeA|(@wDrw+>ZnGqH>0 z_wuNscN{+SOZLkMXG?r~l^r6-Qd)(!b4!}_f_(BPL`JH1d(fCed<>e9l)u2HK!Q~9 z&GRA&8)%Hic`P5N3Vb96=nU&@7x)}Md~CT-y{@H&?8mcDUSlfAVSECZoT0az>rE8p zzV%|V+wQ-sa$|Qo=}WJ>XuRf$Y)?bbzVv=10_4pQO9ZX$qRpF+Mdt|9@`zk5Kq)h+ zuabEpRP^F3GU3j41j(|%YSN6ju7Gd{14_~#X%Rzxh3D${Alb>62;)nOK<33#`$iGK zwWBNGreSUjT9XB%mpmYD=K{j@3~<#c$PH?u02)6I^H)dHwvNrTq2k~lSC0(}Al_2I zaO`uaEg&8NY)60eZ$8A^%=Ot}yVeLRZ+iecxQ~%uI`=Cqi5#GI6S=x|I|ne;YMU{K z#~#JZZkkB`;?Dv-1Do3OiH^S{fc%IFS;VO4248K?hg9vKT5s^xUYhV(ift*?fWp;lQ@nVA*N|ioYjj*8l|~ z%kD#jxHgPtA-}G+(Q{R1i&lo57Jh!a^!Q_0o<|_)#*?<@je^$u#d|ADs6Ch@MMu>7&@P)1v z>obLSlB}00_tsfhZf*!aPSafg*Jl7+^BX7}u@|5gU;(%SN@)X;i@8Kp{8qte_41F@ zz-le8#`9Qe^&<%B;3aPYhn13Rb4cAjU&2q2sL{wQrLz5ifw5>R*@a*-KmR|gcOrAu{IbAhJWe^6 zrg1Z!Wt*!^PkV%I^>5JWf`7rznM_?Ka*R*V=G|7E$3Zwg2=W>OROu6G1OM0O%XY1D zoRZV<&qxiZHQhnp!PnT=#iV|prxiN)boS|zg%FbjBgsStPY#;kUC6<1%lpR#iOk?p zsR-(I(qd+^Pn>5Q3K!3+wMz0jvFF&EYnO!N2%Oemfvn>Hbs2vl)inK5K9de{V@YqM zuk~tf%w-R3ZboA)@ekR+B@1p@7_dGC4}W=rSON`Tb_z`nqZhy6@&wST#z71}jtaBG zyTtyjj^=-jf(S8bh?3T;UH$`)NFF7w878Zr`kz@TGMOKD0rUnRb;%;fAtYYq7AmeMLML}d-4Ggr*giYv!TgvRV@HS+X%+|K63l|PNPx|p=> za0zx$Tg0S_cyT};v1X<<%sVHNbnjSXJQz76asPpwNX%v2!O&wXezl@U+nm|sf*B6Z zK$IR2KHrqGsyT+VCdlLtR=?mC#^M>NHsJ<}KfhhG=v!CjZ}^Sb`tkIX=<{=EeASF)bAIY%rn z&G2}nQo@ebEXZSx!OsF3{(aFzlmOE5VkM#t6Yc`Y;WkyB`U}6}>|H~+_xs@N^LuWT zy2?rjKlye|y7QO8=Q|@M(JX>b1D2`5VC??&tdyD^|C9rIY;1l7$QUxox{{mDQzx0w zE*>)Ec!Z6F9GHIWNzsj(kKN5aWQpJAYNH7K-4L470dV{B;h{llY}fN~f1TH`+%SBf ze6VX=4^irR6#z5S7y{^0ioRi=x4*rLY_x9_zQl+-3(9aBTq7TtpE%fD7jAn{^M*}S zd)Nep!k46N@*kscS5fOt;frv2b6jrqb*m$T+N)Y`U1w}dg<5?^hl>S}a1OSA{_j*U zLZ)*vZTbLt1>7C>8~r`y_Wv!2>&(QUl6HVOj8tI49e%2p7tA-tVrNFPZSubm#h& z6!q@63WoIcFV?J(b65FRy&4d!{WN+!P06Rag>;@dIC*&Fkfz7`gpD8C(|(-MR*gJ% znSY?`%linRiHb(C6tj#cV*Cz2*lX@-^P)T``~1BDHDLKl<<$LZasnvDc^lBYmJrw;oiBdF2HZ4^ zC?1{+C&YTIg`fXgd8P#NSSqPtmT4M8+~?jzWbVSwX`-qCIbH&^*LS~l9j4KdWwNQGcWI)-m;ZhD-K9vvIotZMm0AxkvzGRg-Z*BwJq2jgid$YnXK|xPP8rnL z>YsVh-2B8d@!@CJz4zCK!alFlI*P)dowHTuaPES>#dHdhOhf#q2;9{jv+t)akWQXF zdHku)otKL5HMZcNPNWej9X|$;#nvd;vxT110n16(+sK3&Q(rE|CT^ zcj0>qiMSJKXSQpWJ^uOb*#WhtKb&33)9uJ{r9C%_+Bw;)YQA zj}S!R6X)F{uEWenAskSxgS1(74kBU$2a-ZqqS->@0$@=6E*EaZ>YOcYU7k>iBt+4J)tm~fDUIM2r;ApwqRIED zUo*CK1?x$VR`h14z-J0iZ2F)XJ^68O!oKdaYu{Kcs(!}>a3^+}JH$jkO6i^q&}rNh z1m(^qp3cyOyL{h#;XOPuWr=^`j3l@YQ{N_Y$+EWqhCdh+K#SfApoS5^RAYk|e>khq5jg8rsl0JI^B%n^`KrZ(9G`(7XNATA5bcYw{n*B_ z2O`LKH%31F2|F z|MDl|9=hvaaX8jVl&2d(U97(C0r9_pW=16S=T;BssLJq{tD$Y^%Szh(%CWf%e=cCZ zAxeY&{N+BID(iR7ohJ45+GKC<=3}WcE~3ZXp!7v%kwG_?0eJm6I+Fm#>T$ITGkFKN zWA4l{GPa7@_ccBFQ-0=T=h+nN*khYrtmdLr!@Ih#LVp5Ko#oT+h++(CPl$uZHxSr6 z(!U=kOqQEtE9sOu?T7Fnf9bUH_#DrClvuXDw8U@zT&aJ4MP{JNK$AY9+^HLR80yM?yPA-W&Gk^nWQ)5B$%L&z~@83uvcK&kK z*Qc~{dp0Nd()L$&n$p=pjo*nuo}?gd`1vz3&(#cDzGeID8@i%5v~GMSBx088U-$CR zhIC)sV6tx59Hk^ELxH74%<6n~P;Y!!a<_A6;q2ql0WaD9YGoD;S=?Bct;3>TGI~Nf zRPd?(F7bV6ig`)wuck-WteD09a0)V}EjJS??05DH8PZkg9mQ;XD_z-ItRZ{P%1quH zT^lPovX*Z)PByNcYY4cy=dM{H^3mR*^;=t!-H{msPAvb%tX|JxgsiTeM|me)zO6u} zOc$T=cFr)gn#*t-Y@rOb+$~brzebdp7kw=J}R5Ka>?2^p(~Qa4TTV@EAcL| zA`Vg5J8B9i(u>S4R6De32617EQS0$C`0%kVvX|L8KZD>1M%?zkDYRJ#`$n`s0 zWcD~O$wQBG8fkbhQ0vN0hLs8y}pk)_}v)FYn2UaJMSVHqOE3j4|U-$sW*p z#pQO8oTxYBji9*qN_=0-;k| zfzqklh+GSdqi~=!(CICsZT|Uo614;7s)y9f(VbOEPR}pgHdyN$7XE1Hl&Iqt%#+ub zBCMz%2+>3_#EHclv`C{jOYS%CFNj!yUETKe(>83gVI0@hP7@VL)tT4hE@p<I!Z&N=_qKwwm2tlETc)89la!F>f045^mz`5UO0G9 z#wJ$Zr?;Z_)Yk0DzdLNTM4fhv_{olQ901R8{FSPP*fahsm=oh4y?rx2!6D|wo3_TZ zo%Zp^9t@MWRFnE^jAMqC5%~~wr*$2Lqt^s(`s7o4Payljo-L62*P&@>{TzXPHkjvR zDMm^MzyW&LRA zAQeBM^<|!_9l7a#x78A#DS#H5zxZs$_HS9RD4>?RT7D?(ZF4X8eA3mefAyE}n_WpK zh|F!Y1XqVwwT)!Cr^$~G+_+zJS6v zfYL-yz%SWxNt2Zk)u~^5M)y5qMaYVX>qmJ3J5dn=_kJ{R~yr~u2{#w0yGd~xmUxUTT#-qv}A2MVbBN6LUj!kFs?(wtT zw|u1&*4uAcbuNu~6l_Nlxl4yr)u?E+|WYrd~g%vlWHq_o_+9IrQR3(>{hQ?t)D=rFv7BK`oop?_GJq~ZRMHREO_3kJ5dzP2CF?nP-kh!oaM+(1PP-+ zY3>d8w%`b7mkx@H-tEj~OWGTkiS?-$FP=V% z{L!00C;3M|c1_4A3UL8r{mGk!Od=w`ydh-SWxINsyrGU1^zyagzSU3D<4#E@F2Q{M zK0>6Pb-^ToyN!=BA_>PRQq^hnKEuRkztT>2Oo^vXGLvo$h)50J6Ha#Eto`d@@)PV8 zSok@PXT@C~C>=Uvo4B{_=2Sd7-udx}@b=p(`Qb?~WNku#()4AZj>=WHxMyTvz{J#< zDz|liGbPGCu<>1Zn0rC%{txnZl_iP`gBcrxnMOnLwT{<H-FV_Rao^IzkPBOTA;l)ivqrY68*(Wq`Uz%b z5g5HFK$6^|Isx>911kIFuC6_<{9B;fQ+x?sWFWHTJSF45kP?AwyO?;sjD?l}qE!qa z$6wr_YmLw5k(;xQQ;+10h9wm!6__|{oX}ma|L8%B@?pItv+u(Sa0O;+YL}mmyn07( r46+T%YzaN!z4C)>*UmoGuAQJ}yZcSo{9dvD^ZtL>@E`U9Bk1`r-RKs7 literal 0 HcmV?d00001 diff --git a/docs/src/cdist-logo.png b/docs/src/_static/cdist-logo.png similarity index 100% rename from docs/src/cdist-logo.png rename to docs/src/_static/cdist-logo.png diff --git a/docs/web/cdist/pgp-key-EFD2AE4EC36B6901.asc b/docs/src/_static/pgp-key-EFD2AE4EC36B6901.asc similarity index 100% rename from docs/web/cdist/pgp-key-EFD2AE4EC36B6901.asc rename to docs/src/_static/pgp-key-EFD2AE4EC36B6901.asc diff --git a/docs/src/cdist-intro.rst b/docs/src/cdist-intro.rst deleted file mode 100644 index fad40fe5..00000000 --- a/docs/src/cdist-intro.rst +++ /dev/null @@ -1,15 +0,0 @@ -cdist - usable configuration management -======================================= - -.. image:: cdist-logo.png - :alt: cdist-logo - -cdist is a usable configuration management system. -It adheres to the KISS principle and -is being used in small up to enterprise grade environments. -cdist is an alternative to other configuration management systems like - -* `bcfg2 `_ -* `chef `_ -* `cfengine `_ -* `puppet `_. diff --git a/docs/src/cdist-os.rst b/docs/src/cdist-os.rst index 4f6b4820..a8e31226 100644 --- a/docs/src/cdist-os.rst +++ b/docs/src/cdist-os.rst @@ -1,16 +1,19 @@ -Supported Operating Systems +Supported operating systems =========================== cdist was tested or is know to run on at least -* `Archlinux `_ -* `Debian `_ -* `CentOS `_ -* `Fedora `_ +* `Alpine Linux `_ +* `Archlinux `_ +* `CentOS `_ +* `Debian `_ +* `Devuan `_ +* `Fedora `_ * `FreeBSD `_ -* `Gentoo `_ -* `Mac OS X `_ +* `Gentoo `_ +* `Mac OS X `_ +* `NetBSD `_ * `OpenBSD `_ -* `Redhat `_ -* `Ubuntu `_ -* `XenServer `_ +* `Redhat `_ +* `Ubuntu `_ +* `XenServer `_ diff --git a/docs/src/cdist-support.rst b/docs/src/cdist-support.rst index 2343500e..19afde2f 100644 --- a/docs/src/cdist-support.rst +++ b/docs/src/cdist-support.rst @@ -1,11 +1,9 @@ Support ------- -IRC -~~~ - -You can join the development ***IRC channel*** -`#cstar on irc.freenode.net `_. +Chat +~~~~ +Chat with us: `ungleich chat `_. Mailing list ~~~~~~~~~~~~ @@ -25,4 +23,4 @@ Commercial support ~~~~~~~~~~~~~~~~~~ You can request commercial support for cdist from -`my company `_. +`ungleich `_. diff --git a/docs/src/cdist-update.rst b/docs/src/cdist-upgrade.rst similarity index 99% rename from docs/src/cdist-update.rst rename to docs/src/cdist-upgrade.rst index e810d6e9..e57ed63c 100644 --- a/docs/src/cdist-update.rst +++ b/docs/src/cdist-upgrade.rst @@ -1,5 +1,5 @@ -How to update cdist -=================== +How to upgrade cdist +==================== Update the git installation --------------------------- diff --git a/docs/src/conf.py b/docs/src/conf.py index 8ed48324..78f9842c 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -56,7 +56,7 @@ master_doc = 'index' # General information about the project. project = 'cdist' -# copyright = '2016, Darko Poljak' +copyright = 'ungleich GmbH 2019' # author = 'Darko Poljak' # The version info for the project you're documenting, acts as replacement for @@ -138,7 +138,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name of an image file (relative to this directory) to place at the top # of the sidebar. -# html_logo = None +html_logo = '_static/cdist-logo.jpeg' # The name of an image file (relative to this directory) to use as a favicon of # the docs. This file should be a Windows icon file (.ico) @@ -150,6 +150,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] +html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/docs/src/index.rst b/docs/src/index.rst index af303f5b..95e44d52 100644 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -1,20 +1,23 @@ -Welcome to cdist documentation -============================== +cdist - usable configuration management +======================================= + +cdist is a usable configuration management system. +It adheres to the KISS principle and +is being used in small up to enterprise grade environments. -Contents: .. toctree:: - :maxdepth: 2 + :maxdepth: 3 :glob: :numbered: + :hidden: - cdist-intro cdist-why + cdist-features cdist-os cdist-install - cdist-update + cdist-upgrade cdist-support - cdist-features cdist-quickstart cdist-real-world man1/cdist diff --git a/docs/web/cdist.mdwn b/docs/web/cdist.mdwn deleted file mode 100644 index 90af20cb..00000000 --- a/docs/web/cdist.mdwn +++ /dev/null @@ -1,21 +0,0 @@ -[[!meta title="cdist - usable configuration management"]] - -![cdist-logo](cdist-logo.png "cdist logo") - -cdist is a usable configuration management system. -It adheres to the KISS principle and -is being used in small up to enterprise grade environments. -cdist is an alternative to other configuration management systems like -[bcfg2](http://bcfg2.org/), -[chef](https://www.chef.sh/), -[cfengine](https://cfengine.com/) -and [puppet](https://puppet.com/). - - * [[Why should I use cdist?|why]] - * [[Documentation|documentation]] - * [[Supported Operating Systems|os]] - * [[Installation|install]] - * [[Update|update]] - * [[Support|support]] - -[[!tag cdist unix]] diff --git a/docs/web/cdist/cdist-logo.png b/docs/web/cdist/cdist-logo.png deleted file mode 100644 index 13c2792728d20511f18ae60df8524d68b8a35cbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1542 zcmV+h2Ko7kP)Px#22e~?MF0Q*|NsA`*`M72000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipS@ z0U8oZ%R(#w00o9gL_t(o!|j;OOC(1Wz^mIa(<@6fGKU5*AnRX5Vhb0Zp zl-0j^^}hPms}|z_>pi<{At%Dr`U@U4gF4RoGSKpzdV%|9@IftRZLXV9@rE>N@N!C~ zGe!OUp&qdMyVA_e*UFQ*nQ6FwG6UDY#;;ZQdr1m53*5jARMf$*1#sLK#5utjPU&db zU785>|Q;`jcYt&fW8y13Dv?GjzEFS5zgd^L_8Dcpp*UC7%Q|3g| zeW!0Xc2ln5Rr4S=Vw`9rom{QR%eaLoD99VfwGKs%e!wYXuc>Ro!YNg8JEj$j^K%vMI*!X+fZJ61zup&| z_&2@o@#j2c4Ow58Hv--l{9E;X!t)PThohc&SqQ&#?tli zeQ~q`w_7_Q4-|PvJ%@O73;v3uexPskGwxuUxYYml(wYAUI%ek9r9qEY?};s1j`9Ns zws+2%V_kFL`}_%&3B=6YnssgO7v^UEE^rn<`DuRG-WhWykyiNA+NRs7e#(n=#)dSo zC4b`2WX@hcQKUGP1Q;~i_~10#_Lg>}wnLWcfIX@<+++6!>FOsE(lNYg;o!>kuYLrZ zgn0Pmn(d&{8hK&l4S+j!SA~?-kZ(d{hS{KtRyo7mHqy$s_JuIA?hdVknB7 zLmcRLeo>TXD!t|!#KppS^(U1G?uTqIrW6TN&L%q)1U|fh!8$5_6|fyo5;wJD>?Nn8 z7@(SuyO_)`(2ft;4l8l7-_6;9W~(mlmj~#Vqtq{l($Q`rzu?yO%mX=fdC=B&2+U{e4Ydo2tmeVMoEvfXx48|#$#HqW zTvw#rm^=`@-JY`kV#Va)&A7P1?!T;r((*!4!$HtGcXKPzc`S^6g>{Se%ENDB0rpaV z5LWU)8vnI-KXJt}pCil*k@~kQ_nrqXYSH9EMl)|%efJ-1(-zZu5F_WnM!-h{74^xT z;0|clXTjlN%3T{{fFAO-|Ift!@>@-G2m|qxhyoK=0!BZA|iCn43h9NNJLMXkOv16dzyd&)Y5*|k+R=&8w!jnSNv6LK39 saY9X~U}r+kn~+= 3.2 - * SSH client - * Asciidoc and xsltproc (for building the manpages) - -### Target Hosts - - * /bin/sh: A posix like shell (for instance bash, dash, zsh) - * SSH server - -## Install cdist - -You can install cdist either from git or as a python package. - -### From git - -Cloning cdist from git gives you the advantage of having -a version control in place for development of your own stuff -immediately. - -To install cdist, execute the following commands: - - git clone https://github.com/ungleich/cdist.git - cd cdist - export PATH=$PATH:$(pwd -P)/bin - -From version 4.2.0 cdist tags and github releases are signed. -You can get GPG public key used for signing [here](/software/cdist/pgp-key-EFD2AE4EC36B6901.asc). - -#### Available versions in git - - * The active development takes place in the **master** branch - * The current stable version can be found in the **2.0** branch - * The upcoming stable version can be found in the **2.1** branch - -Other branches may be available for features or bugfixes, but they -may vanish at any point. To select a specific branch use - - # Generic code - git checkout -b origin/ - -So for instance if you want to use and stay with version 2.0, you can use - - git checkout -b 2.0 origin/2.0 - -#### Git Mirrors - -If the main site is down, you can acquire cdist from one of the following sites: - - * git://github.com/telmich/cdist.git ([github](https://github.com/telmich/cdist)) - * git://git.code.sf.net/p/cdist/code ([sourceforge](https://sourceforge.net/p/cdist/code)) - -#### Building and using documentation (man and html) - -If you want to build and use the documentation, run: - - make docs - -Documentation comes in two formats, man pages and full HTML -documentation. Documentation is built into distribution's -docs/dist directory. man pages are in docs/dist/man and -HTML documentation in docs/dist/html. - -If you want to use man pages, run: - - export MANPATH=$MANPATH:$(pwd -P)/docs/dist/man - -Or you can move manpages from docs/dist/man directory to some -other directory and add it to MANPATH. - -Full HTML documentation can be accessed at docs/dist/html/index.html. - -You can also build manpages for types in your ~/.cdist directory: - - make dotman - -Built manpages are now in docs/dist/man directory. If you have -some other custom .cdist directory, e.g. /opt/cdist then use: - - DOT_CDIST_PATH=/opt/cdist make dotman - - -### Python Package - -Cdist is available as a python package at -[PyPi](http://pypi.python.org/pypi/cdist/). You can install it using - - pip install cdist - -## Use cdist - -[[Dig into the documentation|documentation]] to get started with cdist! - -[[!tag cdist unix]] diff --git a/docs/web/cdist/os.mdwn b/docs/web/cdist/os.mdwn deleted file mode 100644 index 3677f52c..00000000 --- a/docs/web/cdist/os.mdwn +++ /dev/null @@ -1,18 +0,0 @@ -[[!meta title="Supported Operating Systems"]] - -cdist was tested or is know to run on at least - - * [Archlinux](http://www.archlinux.org/) - * [Debian](http://www.debian.org/) - * [CentOS](http://www.centos.org/) - * [Scientific](https://www.scientificlinux.org/) - * [Fedora](http://fedoraproject.org/) - * [FreeBSD](http://www.freebsd.org) - * [Gentoo](http://www.gentoo.org/) - * [Mac OS X](http://www.apple.com/macosx/) - * [OpenBSD](http://www.openbsd.org) - * [Redhat](http://www.redhat.com/) - * [Ubuntu](http://www.ubuntu.com/) - * [XenServer](http://www.citrix.com/xenserver/) - -[[!tag cdist unix]] diff --git a/docs/web/cdist/support.mdwn b/docs/web/cdist/support.mdwn deleted file mode 100644 index 4f92853b..00000000 --- a/docs/web/cdist/support.mdwn +++ /dev/null @@ -1,28 +0,0 @@ -## Support - -### IRC - -You can join the development ***IRC channel*** -[#cstar on irc.freenode.net](irc://irc.freenode.org/#cstar). - -### Mailing list - -Bug reports, questions, patches, etc. should be send to the -[cdist mailing list](https://groups.google.com/forum/#!forum/cdist-configuration-management). - -### Linkedin - -If you have an account -at [Linked in](http://www.linkedin.com/), -you can join the -[cdist group](http://www.linkedin.com/groups/cdist-configuration-management-3952797). - -### Chat -Chat with us: [ungleich chat](https://chat.ungleich.ch/channel/cdist). - -### Commercial support - -You can request commercial support for cdist from -[my company](http://www.ungleich.ch/english/). - -[[!tag cdist unix]] diff --git a/docs/web/cdist/update.mdwn b/docs/web/cdist/update.mdwn deleted file mode 100644 index df4617bb..00000000 --- a/docs/web/cdist/update.mdwn +++ /dev/null @@ -1,158 +0,0 @@ -[[!meta title="How to update cdist"]] - -## Update The Git Installation - -To upgrade cdist in the current branch use - - git pull - - # Also update the manpages - ./build man - export MANPATH=$MANPATH:$(pwd -P)/doc/man - -If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break. -The master branch on the other hand is the development branch and may not be -working, break your setup or eat the tree in your garden. - -### Safely upgrading to new versions - -To upgrade to **any** further cdist version, you can take the -following procedure to do a safe upgrade: - - # Create new branch to try out the update - git checkout -b upgrade_cdist - - # Get latest cdist version in git database - git fetch -v - - # see what will happen on merge - replace - # master with the branch you plan to merge - git diff upgrade_cdist..origin/master - - # Merge the new version - git merge origin/master - -Now you can ensure all custom types work with the new version. -Assume that you need to go back to an older version during -the migration/update, you can do so as follows: - - # commit changes - git commit -m ... - - # go back to original branch - git checkout master - -After that, you can go back and continue the upgrade: - - # git checkout upgrade_cdist - - -## Update The Python Package - -To upgrade to the lastet version do - - pip install --upgrade cdist - -## General Update Instructions - -### Updating from 3.0 to 3.1 - -The type **\_\_ssh_authorized_keys** now also manages existing keys, -not only the ones added by cdist. - -### Updating from 2.3 to 3.0 - -The **changed** attribute of objects has been removed. -Use [messaging](/software/cdist/man/3.0.0/man7/cdist-messaging.html) instead. - -### Updating from 2.2 to 2.3 - -No incompatibilities. - -### Updating from 2.1 to 2.2 - -Starting with 2.2, the syntax for requiring a singleton type changed: -Old format: - - require="__singleton_type/singleton" ... - -New format: - - require="__singleton_type" ... - -Internally the "singleton" object id was dropped to make life more easy. -You can probably fix your configuration by running the following code -snippet (currently untested, please report back if it works for you): - - find ~/.cdist/* -type f -exec sed -i 's,/singleton,,' {} \; - -### Updating from 2.0 to 2.1 - -Have a look at the update guide for [[2.0 to 2.1|2.0-to-2.1]]. - - * Type **\_\_package* and \_\_process** use --state **present** or **absent**. - The states **removed/installed** and **stopped/running** have been removed. - Support for the new states is already present in 2.0. - * Type **\_\_directory**: Parameter --parents and --recursive are now boolean - The old "yes/no" values need to be removed. - * Type **\_\_rvm_ruby**: Parameter --default is now boolean - The old "yes/no" values need to be removed. - * Type **\_\_rvm_gemset**: Parameter --default is now boolean - The old "yes/no" values need to be removed. - * Type **\_\_addifnosuchline** and **\_\_removeline** have been replaced by **\_\_line** - * The **conf** directory is now located at **cdist/conf**. - You need to migrate your types, explorers and manifests - manually to the new location. - * Replace the variable **\_\_self** by **\_\_object_name** - Support for the variable **\_\_object_name** is already present in 2.0. - * The types **\_\_autofs**, **\_\_autofs_map** and **\_\_autofs_reload** have been removed - (no maintainer, no users) - * Type **\_\_user**: Parameter --groups removed (use the new \_\_user_groups type) - * Type **\_\_ssh_authorized_key** has been replaced by more flexible type - **\_\_ssh_authorized_keys** - -### Updating from 1.7 to 2.0 - -* Ensure python (>= 3.2) is installed on the source host -* Use "cdist config host" instead of "cdist-deploy-to host" -* Use "cdist config -p host1 host2" instead of "cdist-mass-deploy" -* Use "cdist banner" for fun -* Use **\_\_object_name** instead of **\_\_self** in manifests - -### Updating from 1.6 to 1.7 - -* If you used the global explorer **hardware_type**, you need to change - your code to use **machine** instead. - -### Updating from 1.5 to 1.6 - -* If you used **\_\_package_apt --preseed**, you need to use the new - type **\_\_debconf_set_selections** instead. -* The **\_\_package** types accepted either --state deinstalled or - --state uninstaaled. Starting with 1.6, it was made consistently - to --state removed. - -### Updating from 1.3 to 1.5 - -No incompatibilities. - -### Updating from 1.2 to 1.3 - -Rename **gencode** of every type to **gencode-remote**. - -### Updating from 1.1 to 1.2 - -No incompatibilities. - -### Updating from 1.0 to 1.1 - -In 1.1 the type **\_\_file** was split into **\_\_directory**, **\_\_file** and -**\_\_link**. The parameter **--type** was removed from **\_\_file**. Thus you -need to replace **\_\_file** calls in your manifests: - - * Remove --type from all \_\_file calls - * If type was symlink, use \_\_link and --type symbolic - * If type was directory, use \_\_directory - - -[[!tag cdist unix]] diff --git a/docs/web/cdist/update/2.0-to-2.1.mdwn b/docs/web/cdist/update/2.0-to-2.1.mdwn deleted file mode 100644 index 3b5f5dc4..00000000 --- a/docs/web/cdist/update/2.0-to-2.1.mdwn +++ /dev/null @@ -1,118 +0,0 @@ -[[!meta title="Update Guide for 2.0 to 2.1"]] - -## Introduction - -When changing your installation from 2.0 to 2.1, there are -a lot of changes coming up. 2.1 is mainly a cleanup release, -which removes long time deprecated behaviour, but also makes -a lot of things more consistent and allows you to split off your types, -explorers and manifest to custom directories. - -This document will guide you to a successful update. - -## Preparation - -As for every software and system you use in production, you should first of -all make a backup of your data. To prevent any breakage, it is -recommended to create a new git branch to do the update on: - - % git checkout -b update_to_2.1 - -This also ensure that whenever you need to do a change in your -2.0 based tree, you can simply go back to that branch, apply the change -and configure your systems - independently of your update progress! - -Next fetch the latest upstream changes, I assume that -origin refers to one of the upstream mirrors (change origin if you use -another remote name for upstream cdist): - - % git fetch -v origin - -## Merge the changes - -Now try to merge upstream into the new branch. - - % git merge origin/2.1 - -Fix any conflicts that may have been occurred due to local changes -and then **git add** and *git commit** those changes. This should seldom -occur and if, it's mostly for people hacking on the cdist core. - -## Move "conf" directory - -One of the biggest changes in cdist 2.1 is that you can have multiple -**conf** directories: Indeed, the new default behaviour of cdist is to -search for conf directories - - * below the python module (cdist/conf in the source tree or in the installed location) - * at ~/.cdist/ (on conf suffix there) - -So you can now choose, where to store your types. - -### Integrate your conf/ back into the tree - -If you choose to store your types together with the upstream types, -you can just move all your stuff below **cdist/conf**: - - % git mv conf/type/* cdist/conf/type - % git mv conf/manifest/* cdist/conf/manifest - % git mv conf/explorer/* cdist/conf/explorer - % git commit -m "Re-Integrate my conf directory into cdist 2.1 tree" - -### Move your conf/ directory to ~/.cdist - -If you want to store your site specific -configuration outside of the cdist tree, you -can move your conf/ directory to your homedirectory ($HOME) under ~/.cdist: - - % mv conf ~/.cdist - % git rm -r conf - % git commit -m "Move my conf directory to ~/.cdist" - -It it still recommended to use a version control system like git in it: - - % cd ~/.cdist - % git init - % git add . - % git commit -m "Create new git repository containing my cdist configuration" - -## Test the migration - -Some of the types shipped with upstream were changed, so you may want to test -the result by running cdist on one of your staging target hosts: - - % ./bin/cdist config -v staging-host - -All incompatibilities are listed on the [[cdist update page|software/cdist/update]], -so you can browse through the list and update your configuration. - -## Final Cleanups - -When everything is tested, there are some cleanups to be done to finalise the update. - -### When continuing to keep conf/ in the tree - -You can then merge back your changes into the master tree and continue to work -as normal. - -### When using ~/.cdist - -If you decided to move your site specific code to ~/.cdist, you can now switch your -**master** branch or version branch to upstream directly. Assumnig you are in the -cdist directory, having your previous branch checked out, you can create a clean -state using the following commands: - - % upstream_branch=2.1 - % current_branch=$(git rev-parse --abbrev-ref HEAD) - % git checkout -b archive_my_own_tree - % git branch -D "$current_branch" - % git checkout -b "$current_branch" "origin/$upstream_branch" - -Afther these commands, your previous main branch is accessible at -**archive_my_own_tree** and your branch is now tracking upstream. - -## Questions? Critics? Hints? - -If you think this manual helped or misses some information, do not -hesitate to contact us on any of the usual ways (irc, mailinglist, -github issue tracker, ...). diff --git a/docs/web/cdist/why.mdwn b/docs/web/cdist/why.mdwn deleted file mode 100644 index f571555c..00000000 --- a/docs/web/cdist/why.mdwn +++ /dev/null @@ -1,69 +0,0 @@ -[[!meta title="Why should I use cdist?"]] - -[[!toc]] - -There are several motivations to use cdist, these -are probably the most popular ones. - -## Known language - -Cdist is being configured in -[shell script](https://en.wikipedia.org/wiki/Shell_script). -Shell script is used by UNIX system engineers for decades. -So when cdist is introduced, your staff does not need to learn a new -[DSL](https://en.wikipedia.org/wiki/Domain-specific_language) -or programming language. - -## Powerful language - -Not only is shell scripting widely known by system engineers, -but it is also a very powerful language. Here are some features -which make daily work easy: - - * Configuration can react dynamicly on explored values - * High level string manipulation (using sed, awk, grep) - * Conditional support (**if, case**) - * Loop support (**for, while**) - * Support for dependencies between cdist types - -## More than shell scripting - -If you compare regular shell scripting with cdist, there is one major -difference: When using cdist types, -the results are -[idempotent](https://en.wikipedia.org/wiki/Idempotence). -In practise that means it does not matter in which order you -call cdist types, the result is always the same. - -## Zero dependency configuration management - -Cdist requires very litte on a target system. Even better, -in almost all cases all dependencies are usually fulfilled. -Cdist does not require an agent or a high level programming -languages on the target host: it will run on any host that -has a **ssh server running** and a posix compatible shell -(**/bin/sh**). Compared to other configuration management systems, -it does not require to open up an additional port. - -## Push based distribution - -Cdist uses the push based model for configuration. In this -scenario, one (or more) computers connect the target hosts -and apply the configuration. That way the source host has -very little requirements: Cdist can even run on a sysadmin -notebook that is loosely connected to the network and has -limited amount of resources. - -Furthermore, from a security point of view, only one machine -needs access to the target hosts. No target hosts will ever -need to connect back to the source host, which contains the -full configuration. - -## Highly scalable - -If at some point you manage more hosts than can be handled from -a single source host, you can simply add more resources: Either -add more cores to one host or add hosts. -Cdist will utilise the given resources in parallel. - -[[!tag cdist unix]] From 2f93320627a996756a0375b2e9178f360ccea73c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 2 May 2019 19:37:01 +0200 Subject: [PATCH 022/383] Generating speeches is not part of cdist release Speeches should be generated on demand when needed and the cdist website should be updated. --- bin/build-helper | 3 --- bin/build-helper.freebsd | 3 --- 2 files changed, 6 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index 04b7621b..bb5956b8 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -279,9 +279,6 @@ eof make docs-clean make docs - # Generate speeches (indirect check if they build) - make speeches - ############################################################# # Everything green, let's do the release diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index c292280c..2a71a899 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -295,9 +295,6 @@ eof make helper=${helper} docs-clean make helper=${helper} docs - # Generate speeches (indirect check if they build) - make helper=${helper} speeches - ############################################################# # Everything green, let's do the release From d242f1e7588912364c5c5dd6d1595202d24bc42f Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 4 May 2019 00:31:33 +0200 Subject: [PATCH 023/383] Unify build-helper scripts --- bin/build-helper | 89 +++++--- bin/build-helper.darko | 1 + bin/build-helper.freebsd | 427 --------------------------------------- 3 files changed, 63 insertions(+), 454 deletions(-) create mode 120000 bin/build-helper.darko delete mode 100755 bin/build-helper.freebsd diff --git a/bin/build-helper b/bin/build-helper index bb5956b8..0b2d5282 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -1,6 +1,7 @@ #!/bin/sh # # 2011-2013 Nico Schottelius (nico-cdist at schottelius.org) +# 2016-2019 Darko Poljak (darko.poljak at gmail.com) # # This file is part of cdist. # @@ -18,10 +19,36 @@ # along with cdist. If not, see . # # -# This file contains the heavy lifting found usually in the Makefile +# This file contains the heavy lifting found usually in the Makefile. # +# vars for make +helper=$0 + basedir=${0%/*}/../ +# run_as is used to check how the script is called (by $0 value) +# currently supported sufixes for $0 are: +# .darko - run as darko +basename=${0##*/} +run_as=${basename#*.} + +to_a=cdist-configuration-management +to_d=googlegroups.com +case "$run_as" in + darko) + from_a=darko.poljak + from_d=gmail.com + ml_name="Darko Poljak" + ml_sig_name="Darko" + ;; + *) + from_a=nico.schottelius + from_d=ungleich.ch + ml_name="Nico Schottelius" + ml_sig_name="Nico" + ;; +esac + # Change to checkout directory cd "$basedir" @@ -30,6 +57,12 @@ version=$(git describe) option=$1; shift case "$option" in + print-make-vars) + printf "helper: ${helper}\n" + ;; + print-runas) + printf "run_as: $run_as\n" + ;; changelog-changes) if [ "$#" -eq 1 ]; then start=$1 @@ -84,19 +117,14 @@ case "$option" in version=$1; shift - to_a=cdist - to_d=l.schottelius.org to=${to_a}@${to_d} - - from_a=nico-cdist - from_d=schottelius.org from=${from_a}@${from_d} ( cat << eof -From: Nico -telmich- Schottelius <$from> +From: ${ml_name} <$from> To: cdist mailing list <$to> -Subject: cdist $version released +Subject: cdist $version has been released Hello .*, @@ -108,15 +136,18 @@ eof cat << eof Cheers, - -Nico +${ml_sig_name} -- Automatisation at its best level. With cdist. eof - ) | /usr/sbin/sendmail -f "$from" "$to" - ;; + ) > mailinglist.tmp + if [ "$run_as" = "build-helper" ] + then + /usr/sbin/sendmail -f "$from" "$to" < mailinglist.tmp && rm -f mailinglist.tmp + fi + ;; release-git-tag) target_version=$($0 changelog-version) @@ -213,7 +244,6 @@ eof "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ || exit 1 - # remove generated files (archive and asc) if [ $# -eq 2 ] then @@ -276,8 +306,8 @@ eof # Generate documentation (man and html) # First, clean old generated docs - make docs-clean - make docs + make helper=${helper} docs-clean + make helper=${helper} docs ############################################################# # Everything green, let's do the release @@ -292,16 +322,27 @@ eof fi # Publish git changes - make pub + if [ "$run_as" = "build-helper" ] + then + make helper=${helper} pub + else + # if we are not Nico :) then just push, no mirror + git push + # push also new branch and set up tracking + git push -u origin "${target_branch}" + fi # Ensure that pypi release has the right version "$0" version # Create and publish package for pypi - make pypi-release + make helper=${helper} pypi-release - # Archlinux release is based on pypi - make archlinux-release + if [ "$run_as" = "build-helper" ] + then + # Archlinux release is based on pypi + make helper=${helper} archlinux-release + fi # sign git tag printf "Enter upstream repository authentication token: " @@ -309,19 +350,13 @@ eof "$0" sign-git-release "${target_version}" "${token}" # Announce change on ML - make ml-release + make helper=${helper} ml-release cat << eof Manual steps post release: - - cdist-web - - linkedin - - hackernews - - reddit - twitter - eof - ;; test) @@ -366,7 +401,7 @@ eof ;; shellcheck) - make shellcheck + make helper=${helper} shellcheck printf "\\nPlease review shellcheck report.\\n" while true do diff --git a/bin/build-helper.darko b/bin/build-helper.darko new file mode 120000 index 00000000..1f3e3384 --- /dev/null +++ b/bin/build-helper.darko @@ -0,0 +1 @@ +build-helper \ No newline at end of file diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd deleted file mode 100755 index 2a71a899..00000000 --- a/bin/build-helper.freebsd +++ /dev/null @@ -1,427 +0,0 @@ -#!/bin/sh -# -# 2011-2013 Nico Schottelius (nico-cdist at schottelius.org) -# 2016 Darko Poljak (darko.poljak at gmail.com) -# -# 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 . -# -# -# This file contains the heavy lifting found usually in the Makefile -# - -# vars for make -helper=$0 - -basedir=${0%/*}/../ -# run_as is used to check how the script is called (by $0 value) -# currently supported sufixes for $0 are: -# .freebsd - run as freebsd -basename=${0##*/} -run_as=${basename#*.} - -to_a=cdist-configuration-management -to_d=googlegroups.com -from_a=darko.poljak -from_d=gmail.com -ml_name="Darko Poljak" -ml_sig_name="Darko" - -# Change to checkout directory -cd "$basedir" - -version=$(git describe) - -option=$1; shift - -case "$option" in - print-make-vars) - printf "helper: ${helper}\n" - ;; - print-runas) - printf "run_as: $run_as\n" - ;; - changelog-changes) - 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" - ;; - - changelog-version) - # get version from changelog - grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/:.*//' - ;; - - check-date) - # verify date in changelog is today - date_today="$(date +%Y-%m-%d)" - date_changelog=$(grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/.*: //') - - if [ "$date_today" != "$date_changelog" ]; then - echo "Date in changelog is not today" - echo "Changelog: $date_changelog" - exit 1 - fi - ;; - - check-unittest) - "$0" test - ;; - - ml-release) - if [ $# -ne 1 ]; then - echo "$0 ml-release version" >&2 - exit 1 - fi - - version=$1; shift - - to=${to_a}@${to_d} - from=${from_a}@${from_d} - - ( - cat << eof -From: ${ml_name} <$from> -To: cdist mailing list <$to> -Subject: cdist $version has been released - -Hello .*, - -cdist $version has been released with the following changes: - -eof - - "$0" changelog-changes "$version" - cat << eof - -Cheers, - -${ml_sig_name} - --- -Automatisation at its best level. With cdist. -eof - ) > mailinglist.tmp - ;; - - release-git-tag) - target_version=$($0 changelog-version) - if git rev-parse --verify refs/tags/$target_version 2>/dev/null; then - echo "Tag for $target_version exists, aborting" - exit 1 - fi - printf "Enter tag description for ${target_version}: " - read tagmessage - - # setup for signed tags: - # gpg --fulL-gen-key - # gpg --list-secret-keys --keyid-format LONG - # git config --local user.signingkey - # for exporting pub key: - # gpg --armor --export > pubkey.asc - # gpg --output pubkey.gpg --export - # show tag with signature - # git show - # verify tag signature - # git tag -v - # - # gpg verify signature - # gpg --verify - # gpg --no-default-keyring --keyring --verify - # Ensure gpg-agent is running. - export GPG_TTY=$(tty) - gpg-agent - - git tag -s "$target_version" -m "$tagmessage" - git push --tags - ;; - - sign-git-release) - if [ $# -lt 2 ] - then - printf "usage: $0 sign-git-release TAG TOKEN [ARCHIVE]\n" - printf " if ARCHIVE is not specified then it is created\n" - exit 1 - fi - tag="$1" - if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1 - then - printf "Tag \"${tag}\" not found.\n" - exit 1 - fi - token="$2" - if [ $# -gt 2 ] - then - archivename="$3" - else - archivename="cdist-${tag}.tar" - git archive --prefix="cdist-${tag}/" -o "${archivename}" "${tag}" \ - || exit 1 - # make sure target version is generated - "$0" target-version - 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}/" - gzip "${archivename}" || exit 1 - archivename="${archivename}.gz" - fi - gpg --armor --detach-sign "${archivename}" || exit 1 - - project="ungleich-public%2Fcdist" - sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/' - - # upload archive - response_archive=$(curl -f -X POST \ - --http1.1 \ - -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 \ - --http1.1 \ - -H "PRIVATE-TOKEN: ${token}" \ - -F "file=@${archivename}.asc" \ - "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \ - | sed "${sed_cmd}") || exit 1 - - # make release - changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') - release_notes=$( - printf "Release %s\n\n%s\n\n%s\n\n**Changelog**\n\n%s\n" \ - "${tag}" "${response_archive}" "${response_archive_sig}" "${changelog}" - ) - curl -f -X POST \ - -H "PRIVATE-TOKEN: ${token}" \ - -F "description=${release_notes}" \ - "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \ - || exit 1 - - # remove generated files (archive and asc) - if [ $# -eq 2 ] - then - rm -f "${archivename}" - fi - rm -f "${archivename}.asc" - ;; - - release) - set -e - target_version=$($0 changelog-version) - target_branch=$($0 version-branch) - - echo "Beginning release process for $target_version" - - # First check everything is sane - "$0" check-date - "$0" check-unittest - "$0" check-pycodestyle - "$0" shellcheck - - # Generate version file to be included in packaging - "$0" target-version - - # Ensure the git status is clean, else abort - if ! git diff-index --name-only --exit-code HEAD ; then - echo "Unclean tree, see files above, aborting" - exit 1 - fi - - # Ensure we are on the master branch - masterbranch=yes - if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then - echo "Releases are happening from the master branch, aborting" - - echo "Enter the magic word to release anyway" - read magicword - - if [ "$magicword" = "iknowwhatido" ]; then - masterbranch=no - else - exit 1 - fi - fi - - if [ "$masterbranch" = yes ]; then - # Ensure version branch exists - if ! git rev-parse --verify refs/heads/$target_branch 2>/dev/null; then - git branch "$target_branch" - fi - - # Merge master branch into version branch - git checkout "$target_branch" - git merge master - fi - - # Verify that after the merge everything works - "$0" check-date - "$0" check-unittest - - # Generate documentation (man and html) - # First, clean old generated docs - make helper=${helper} docs-clean - make helper=${helper} docs - - ############################################################# - # Everything green, let's do the release - - # Tag the current commit - "$0" release-git-tag - - # Also merge back the version branch - if [ "$masterbranch" = yes ]; then - git checkout master - git merge "$target_branch" - fi - - # Publish git changes - case "$run_as" in - freebsd) - # if we are not Nico :) then just push, no mirror - git push - # push also new branch and set up tracking - git push -u origin "${target_branch}" - ;; - *) - make helper=${helper} pub - ;; - esac - - # Ensure that pypi release has the right version - "$0" version - - # Create and publish package for pypi - make helper=${helper} pypi-release - - # sign git tag - printf "Enter upstream repository authentication token: " - read token - "$0" sign-git-release "${target_version}" "${token}" - - # Announce change on ML - make helper=${helper} ml-release - - cat << eof -Manual steps post release: - - - cdist-web - - twitter - -eof - ;; - - test) - export PYTHONPATH="$(pwd -P)" - - if [ $# -lt 1 ]; then - python3 -m cdist.test - else - python3 -m unittest "$@" - fi - ;; - - test-remote) - export PYTHONPATH="$(pwd -P)" - python3 -m cdist.test.exec.remote - ;; - - pycodestyle|pep8) - pycodestyle "${basedir}" "${basedir}/scripts/cdist" | less - ;; - - check-pycodestyle) - "$0" pycodestyle - printf "\\nPlease review pycodestyle report.\\n" - while true - do - echo "Continue (yes/no)?" - any= - read any - case "$any" in - yes) - break - ;; - no) - exit 1 - ;; - *) - echo "Please answer with 'yes' or 'no' explicitly." - ;; - esac - done - ;; - - shellcheck) - make helper=${helper} shellcheck - printf "\\nPlease review shellcheck report.\\n" - while true - do - echo "Continue (yes/no)?" - any= - read any - case "$any" in - yes) - break - ;; - no) - exit 1 - ;; - *) - echo "Please answer with 'yes' or 'no' explicitly." - ;; - esac - done - ;; - - version-branch) - "$0" changelog-version | cut -d. -f '1,2' - ;; - - version) - echo "VERSION = \"$(git describe)\"" > cdist/version.py - ;; - - target-version) - target_version=$($0 changelog-version) - echo "VERSION = \"${target_version}\"" > cdist/version.py - ;; - - *) - echo "Unknown helper target $@ - aborting" - exit 1 - ;; - -esac From 513fde1cc1fcc612514cefaf18fd0822095c92e9 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 4 May 2019 10:51:10 +0200 Subject: [PATCH 024/383] ++changelog --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index d367ed47..2e1df3d5 100644 --- a/docs/changelog +++ b/docs/changelog @@ -10,6 +10,9 @@ next: * Build: Update due to migration to code.ungleich.ch (Darko Poljak) * Documentation: Update due to migration to code.ungleich.ch (Darko Poljak) * Core: Detect and report dependency cycle as soon as possible (Darko Poljak) + * Core, documentation: Release -j/--jobs option, i.e. make it non-beta (Darko Poljak) + * Documentation: Update due to new cdist website (Darko Poljak) + * Build: Update due to new cdist website (Darko Poljak) 4.11.1: 2019-04-22 * Core: Improve explorer error reporting (Darko Poljak) From 10a29ca9e6173b5843aab6b45143b4f7c343d401 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 5 May 2019 00:02:51 +0200 Subject: [PATCH 025/383] Fix pycodestyle issue --- cdist/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/config.py b/cdist/config.py index 4e226b3a..bc05a28c 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -48,7 +48,7 @@ def graph_check_cycle(graph): for node in graph: # Cycle path. path = [node] - has_cycle = _graph_dfs_cycle( graph, node, path) + has_cycle = _graph_dfs_cycle(graph, node, path) if has_cycle: return has_cycle, path return False, None From aad6c341780669c0c6ce26aae99259669f9f839b Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 4 May 2019 23:30:50 +0200 Subject: [PATCH 026/383] Release 5.0.0 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 2e1df3d5..d6251523 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.0.0: 2019-05-05 * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) * Explorer init: Add support for OpenBSD (sideeffect42) * Type __postgres_database: Run psql with -w (no-password) (sideeffect42) From 4d75a05e3595e2bcfa96c461d8025cc92babf7f3 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 5 May 2019 10:31:23 +0200 Subject: [PATCH 027/383] Rm redundant tag description from rel notes --- bin/build-helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index 0b2d5282..009e96ff 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -235,8 +235,8 @@ eof # make release changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') release_notes=$( - printf "Release %s\n\n%s\n\n%s\n\n**Changelog**\n\n%s\n" \ - "${tag}" "${response_archive}" "${response_archive_sig}" "${changelog}" + printf "%s\n\n%s\n\n**Changelog**\n\n%s\n" \ + "${response_archive}" "${response_archive_sig}" "${changelog}" ) curl -f -X POST \ -H "PRIVATE-TOKEN: ${token}" \ From 735f57b3a032fad842c9d4306080b5d7a4c53a38 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 5 May 2019 17:55:02 +0200 Subject: [PATCH 028/383] Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section --- docs/src/cdist-best-practice.rst | 92 ++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/docs/src/cdist-best-practice.rst b/docs/src/cdist-best-practice.rst index a99ba88e..7a1255d6 100644 --- a/docs/src/cdist-best-practice.rst +++ b/docs/src/cdist-best-practice.rst @@ -224,3 +224,95 @@ in the repository for such content: It allows you to easily distinguish what is used by cdist and what is not and also to store all important files in one repository. + + +Perils of CDIST_ORDER_DEPENDENCY +-------------------------------- +With CDIST_ORDER_DEPENDENCY all types are executed in the order in which they +are created in the manifest. The current created object automatically depends +on the previously created object. + +It essentially helps you to build up blocks of code that build upon each other +(like first creating the directory xyz than the file below the directory). + +This can be helpful, but it can also be the source of *evil*. + +Let's see an example. Suppose you have special init manifest where among other +things you are assuring that remote host has packages `sudo` and `curl` +installed. + +**init1** + +.. code-block:: sh + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + + for p in sudo curl + do + __package "${p}" + done + +Then you have some other special init manifest where among other things you are +assuring `sudo` package is installed. + +**init2** + +.. code-block:: sh + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + + __package sudo + +Then you have third init manifest where you combine those two init manifests, +by including them: + +**init** + +.. code-block:: sh + + sh -e "$__manifest/init1" + sh -e "$__manifest/init2" + +The resulting init manifest is then equal to: + +.. code-block:: sh + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + + for p in sudo curl + do + __package "${p}" + done + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + + __package sudo + +In the end you get the following dependencies: + +* `__package/curl` depends on `__package/sudo` +* `__package/sudo` depends on `__package/curl` + +And here you have a circular dependency! + +In the real world manifest can be quite complex, dependencies can become +complicated and circual dependencies are not so obvious. Resolving it can +become cumbersome. + +**Practical solution?** + +Instead of managing complex init manifests you can write custom types. +Each custom type can do one thing, it has well defined dependencies that will +not leak into init manifest. In custom type you can also add special explorers +and gencode. + +Then, in init manifest you combine your complex types. It is: + +* cleaner +* easier to follow +* easier to maintain +* easier to debug. From 28082c710aa02a1861a4396513469ecfa7ef2d4f Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 6 May 2019 11:11:10 +0200 Subject: [PATCH 029/383] Add refs to perils of CDIST_ORDER_DEPENDENCY --- docs/src/cdist-manifest.rst | 2 ++ docs/src/cdist-reference.rst.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/src/cdist-manifest.rst b/docs/src/cdist-manifest.rst index 0e266943..4dd3e74b 100644 --- a/docs/src/cdist-manifest.rst +++ b/docs/src/cdist-manifest.rst @@ -163,6 +163,8 @@ automatically depends on the previously created object. It essentially helps you to build up blocks of code that build upon each other (like first creating the directory xyz than the file below the directory). +Read also about `perils of CDIST_ORDER_DEPENDENCY `_. + Overrides --------- diff --git a/docs/src/cdist-reference.rst.sh b/docs/src/cdist-reference.rst.sh index 59ce018b..2c9c7b40 100755 --- a/docs/src/cdist-reference.rst.sh +++ b/docs/src/cdist-reference.rst.sh @@ -323,6 +323,7 @@ CDIST_OVERRIDE CDIST_ORDER_DEPENDENCY Create dependencies based on the execution order (see \`cdist manifest \`_). + Read also about \`perils of CDIST_ORDER_DEPENDENCY \`_. CDIST_REMOTE_EXEC Use this command for remote execution (should behave like ssh). From 02eb6c75a7979eb2fa1ec2b4921ab9fafe582edd Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 6 May 2019 17:11:23 +0200 Subject: [PATCH 030/383] Add 'CDIST_ORDER_DEPENDENCY kills parallelization' --- docs/src/cdist-best-practice.rst | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/src/cdist-best-practice.rst b/docs/src/cdist-best-practice.rst index 7a1255d6..a91f2cc0 100644 --- a/docs/src/cdist-best-practice.rst +++ b/docs/src/cdist-best-practice.rst @@ -237,6 +237,10 @@ It essentially helps you to build up blocks of code that build upon each other This can be helpful, but it can also be the source of *evil*. + +CDIST_ORDER_DEPENDENCY easily causes unobvious dependency cycles +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Let's see an example. Suppose you have special init manifest where among other things you are assuring that remote host has packages `sudo` and `curl` installed. @@ -316,3 +320,44 @@ Then, in init manifest you combine your complex types. It is: * easier to follow * easier to maintain * easier to debug. + + +CDIST_ORDER_DEPENDENCY kills parallelization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Suppose you have defined CDIST_ORDER_DEPENDENCY and then, among other things, +you specify creation of three, by nature independent, files. + +**init** + +.. code-block:: sh + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + + ... + __file /tmp/file1 + __file /tmp/file2 + __file /tmp/file3 + ... + +Due to defined CDIST_ORDER_DEPENDENCY cdist will execute them in specified order. +It is better to use CDIST_ORDER_DEPENDENCY in well defined blocks: + +**init** + +.. code-block:: sh + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + ... + unset CDIST_ORDER_DEPENDENCY + + __file /tmp/file1 + __file /tmp/file2 + __file /tmp/file3 + + CDIST_ORDER_DEPENDENCY=1 + export CDIST_ORDER_DEPENDENCY + ... + unset CDIST_ORDER_DEPENDENCY From d696a55879b74eac091e338c95dbe5b144c8054c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 6 May 2019 17:13:36 +0200 Subject: [PATCH 031/383] ++changelog --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index d6251523..40cb1f83 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) + 5.0.0: 2019-05-05 * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) * Explorer init: Add support for OpenBSD (sideeffect42) From 4f40c6ac656413cb6664809c299e1021430d13d0 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 7 May 2019 18:16:54 +0200 Subject: [PATCH 032/383] Re-arrange Makefile and build-helper script Maintainers should use build-helper script. End users should use Makefile, which contains targets that can be run on pure source (without git repository). --- .gitattributes | 2 + Makefile | 158 ++++--------------- README-maintainers | 4 + bin/build-helper | 311 +++++++++++++++++++++++++++++-------- bin/build-helper.darko | 1 - docs/changelog | 1 + docs/src/cdist-install.rst | 19 ++- 7 files changed, 296 insertions(+), 200 deletions(-) create mode 100644 README-maintainers delete mode 120000 bin/build-helper.darko diff --git a/.gitattributes b/.gitattributes index aeaab8b9..45c10d7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,5 @@ docs/speeches export-ignore docs/video export-ignore docs/src/man7 export-ignore +bin/build-helper export-ignore +README-maintainers export-ignore diff --git a/Makefile b/Makefile index 099812e2..b739ab1f 100644 --- a/Makefile +++ b/Makefile @@ -18,25 +18,27 @@ # # -helper=./bin/build-helper +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo "man build only man user documentation" + @echo "html build only html user documentation" + @echo "docs build both man and html user documentation" + @echo "dotman build man pages for types in your ~/.cdist directory" + @echo "speeches build speeches pdf files" + @echo "install install in the system site-packages directory" + @echo "install-user install in the user site-packages directory" + @echo "docs-clean clean documentation" + @echo "clean clean" DOCS_SRC_DIR=docs/src SPEECHDIR=docs/speeches TYPEDIR=cdist/conf/type -CHANGELOG_VERSION=$(shell $(helper) changelog-version) -CHANGELOG_FILE=docs/changelog - -PYTHON_VERSION=cdist/version.py - SPHINXM=make -C $(DOCS_SRC_DIR) man SPHINXH=make -C $(DOCS_SRC_DIR) html SPHINXC=make -C $(DOCS_SRC_DIR) clean -SHELLCHECKCMD=shellcheck -s sh -f gcc -x -# Skip SC2154 for variables starting with __ since such variables are cdist -# environment variables. -SHELLCHECK_SKIP=grep -v ': __.*is referenced but not assigned.*\[SC2154\]' ################################################################################ # Manpages # @@ -61,11 +63,16 @@ DOCSREFSH=$(DOCS_SRC_DIR)/cdist-reference.rst.sh $(DOCSREF): $(DOCSREFSH) $(DOCSREFSH) +version: + @[ -f "cdist/version.py" ] || { \ + printf "Missing 'cdist/version.py', please generate it first.\n" && exit 1; \ + } + # Manpages #3: generic part -man: $(MANTYPES) $(DOCSREF) $(PYTHON_VERSION) +man: version $(MANTYPES) $(DOCSREF) $(SPHINXM) -html: $(MANTYPES) $(DOCSREF) $(PYTHON_VERSION) +html: version $(MANTYPES) $(DOCSREF) $(SPHINXH) docs: man html @@ -85,7 +92,7 @@ DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX)) $(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst ln -sf "$^" $@ -dotman: $(DOTMANTYPES) +dotman: version $(DOTMANTYPES) $(SPHINXM) ################################################################################ @@ -103,132 +110,25 @@ $(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex speeches: $(SPEECHES) ################################################################################ -# Release: Mailinglist +# Misc # -ML_FILE=.lock-ml - -# Only send mail once - lock until new changelog things happened -$(ML_FILE): $(CHANGELOG_FILE) - $(helper) ml-release $(CHANGELOG_VERSION) - touch $@ - -ml-release: $(ML_FILE) - - -################################################################################ -# pypi -# -PYPI_FILE=.pypi-release -$(PYPI_FILE): man $(PYTHON_VERSION) - python3 setup.py sdist upload - touch $@ - -pypi-release: $(PYPI_FILE) -################################################################################ -# archlinux -# -ARCHLINUX_FILE=.lock-archlinux -ARCHLINUXTAR=cdist-$(CHANGELOG_VERSION)-1.src.tar.gz - -$(ARCHLINUXTAR): PKGBUILD - umask 022; mkaurball - -PKGBUILD: PKGBUILD.in $(PYTHON_VERSION) - ./PKGBUILD.in $(CHANGELOG_VERSION) - -$(ARCHLINUX_FILE): $(ARCHLINUXTAR) $(PYTHON_VERSION) - burp -c system $(ARCHLINUXTAR) - touch $@ - -archlinux-release: $(ARCHLINUX_FILE) - -################################################################################ -# Release -# - -$(PYTHON_VERSION) version: .git/refs/heads/master - $(helper) version - -# Code that is better handled in a shell script -check-%: - $(helper) $@ - -release: - $(helper) $@ - -################################################################################ -# Cleanup -# - -clean: +clean: docs-clean rm -f $(DOCS_SRC_DIR)/cdist-reference.rst find "$(DOCS_SRC_DIR)" -mindepth 2 -type l \ | xargs rm -f - make -C $(DOCS_SRC_DIR) clean - find * -name __pycache__ | xargs rm -rf - # 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 - -distclean: clean - rm -f cdist/version.py + # distutils + rm -rf ./build ################################################################################ -# Misc +# install # -# The pub is Nico's "push to all git remotes" way ("make pub") -pub: - git push --mirror +install: + python3 setup.py install -test: - $(helper) $@ - -test-remote: - $(helper) $@ - -pycodestyle pep8: - $(helper) $@ - -shellcheck-global-explorers: - @find cdist/conf/explorer -type f -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-type-explorers: - @find cdist/conf/type -type f -path "*/explorer/*" -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-manifests: - @find cdist/conf/type -type f -name manifest -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-local-gencodes: - @find cdist/conf/type -type f -name gencode-local -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-remote-gencodes: - @find cdist/conf/type -type f -name gencode-remote -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-scripts: - @$(SHELLCHECKCMD) scripts/cdist-dump || exit 0 - -shellcheck-gencodes: shellcheck-local-gencodes shellcheck-remote-gencodes - -shellcheck-types: shellcheck-type-explorers shellcheck-manifests shellcheck-gencodes - -shellcheck: shellcheck-global-explorers shellcheck-types shellcheck-scripts - -shellcheck-type-files: - @find cdist/conf/type -type f -path "*/files/*" -exec $(SHELLCHECKCMD) {} + | $(SHELLCHECK_SKIP) || exit 0 - -shellcheck-with-files: shellcheck shellcheck-type-files +install-user: + python3 setup.py install --user diff --git a/README-maintainers b/README-maintainers new file mode 100644 index 00000000..af57f475 --- /dev/null +++ b/README-maintainers @@ -0,0 +1,4 @@ +Maintainers should use ./bin/build-helper script. + +Makefile is intended for end users. It can be used for non-maintaining +targets that can be run from pure source (without git repository). diff --git a/bin/build-helper b/bin/build-helper index 009e96ff..bba44ded 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -22,47 +22,101 @@ # This file contains the heavy lifting found usually in the Makefile. # -# vars for make -helper=$0 +usage() { + printf "usage: %s TARGET [RUN-AS] + Available targets: + print-runas + 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 + distclean + Run as: + nico + darko - default, if not specified\n" "$1" +} -basedir=${0%/*}/../ -# run_as is used to check how the script is called (by $0 value) -# currently supported sufixes for $0 are: -# .darko - run as darko -basename=${0##*/} -run_as=${basename#*.} +basename="${0##*/}" + +if [ $# -lt 1 ] +then + usage "${basename}" + exit 1 +fi + +option=$1; shift +if [ $# -ge 1 ] +then + run_as="$1" +else + run_as="darko" +fi -to_a=cdist-configuration-management -to_d=googlegroups.com case "$run_as" in - darko) + nico) + from_a=nico.schottelius + from_d=ungleich.ch + ml_name="Nico Schottelius" + ml_sig_name="Nico" + ;; + darko|'') from_a=darko.poljak from_d=gmail.com ml_name="Darko Poljak" ml_sig_name="Darko" ;; *) - from_a=nico.schottelius - from_d=ungleich.ch - ml_name="Nico Schottelius" - ml_sig_name="Nico" + printf "Unsupported RUN-AS value: '%s'.\n" "${run_as}" >&2 + usage "${basename}" + exit 1 ;; esac +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\]' + +to_a="cdist-configuration-management" +to_d="googlegroups.com" + # Change to checkout directory +basedir="${0%/*}/../" cd "$basedir" -version=$(git describe) - -option=$1; shift - case "$option" in - print-make-vars) - printf "helper: ${helper}\n" - ;; print-runas) - printf "run_as: $run_as\n" + printf "run_as: '%s'\n" "$run_as" ;; + changelog-changes) if [ "$#" -eq 1 ]; then start=$1 @@ -99,8 +153,8 @@ case "$option" in date_changelog=$(grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/.*: //') if [ "$date_today" != "$date_changelog" ]; then - echo "Date in changelog is not today" - echo "Changelog: $date_changelog" + printf "Date in changelog is not today\n" + printf "Changelog date: %s\n" "${date_changelog}" exit 1 fi ;; @@ -111,10 +165,15 @@ case "$option" in ml-release) if [ $# -ne 1 ]; then - echo "$0 ml-release version" >&2 + printf "%s ml-release version\n" "$0" >&2 exit 1 fi + # Send mail only once - lock until new changelog things happened. + [ ! -f .lock-ml ] && touch .lock-ml + x=$(find 'docs' -name changelog -type f -newer .lock-ml) + [ -z "${x}" ] && exit 0 + version=$1; shift to=${to_a}@${to_d} @@ -143,20 +202,45 @@ Automatisation at its best level. With cdist. eof ) > mailinglist.tmp - if [ "$run_as" = "build-helper" ] + if [ "$run_as" = "nico" ] then /usr/sbin/sendmail -f "$from" "$to" < mailinglist.tmp && rm -f mailinglist.tmp fi + + touch .lock-ml + ;; + + 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 + "$0" version + + make docs-clean + make docs + python3 setup.py sdist upload ;; release-git-tag) target_version=$($0 changelog-version) - if git rev-parse --verify refs/tags/$target_version 2>/dev/null; then - echo "Tag for $target_version exists, aborting" + if git rev-parse --verify "refs/tags/${target_version}" 2>/dev/null; then + printf "Tag for %s exists, aborting\n" "${target_version}" exit 1 fi - printf "Enter tag description for ${target_version}: " - read tagmessage + printf "Enter tag description for %s: " "${target_version}" + read -r tagmessage # setup for signed tags: # gpg --fulL-gen-key @@ -174,7 +258,8 @@ eof # gpg --verify # gpg --no-default-keyring --keyring --verify # Ensure gpg-agent is running. - export GPG_TTY=$(tty) + GPG_TTY=$(tty) + export GPG_TTY gpg-agent git tag -s "$target_version" -m "$tagmessage" @@ -184,14 +269,14 @@ eof sign-git-release) if [ $# -lt 2 ] then - printf "usage: $0 sign-git-release TAG TOKEN [ARCHIVE]\n" + printf "usage: %s sign-git-release TAG TOKEN [ARCHIVE]\n" "$0" printf " if ARCHIVE is not specified then it is created\n" exit 1 fi tag="$1" if ! git rev-parse -q --verify "${tag}" >/dev/null 2>&1 then - printf "Tag \"${tag}\" not found.\n" + printf "Tag \"%s\" not found.\n" "${tag}" exit 1 fi token="$2" @@ -257,30 +342,30 @@ eof target_version=$($0 changelog-version) target_branch=$($0 version-branch) - echo "Beginning release process for $target_version" + printf "Beginning release process for %s\n" "${target_version}" # First check everything is sane "$0" check-date "$0" check-unittest "$0" check-pycodestyle - "$0" shellcheck + "$0" check-shellcheck # Generate version file to be included in packaging "$0" target-version # Ensure the git status is clean, else abort if ! git diff-index --name-only --exit-code HEAD ; then - echo "Unclean tree, see files above, aborting" + printf "Unclean tree, see files above, aborting.\n" exit 1 fi # Ensure we are on the master branch masterbranch=yes if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then - echo "Releases are happening from the master branch, aborting" + printf "Releases are happening from the master branch, aborting.\n" - echo "Enter the magic word to release anyway" - read magicword + printf "Enter the magic word to release anyway:" + read -r magicword if [ "$magicword" = "iknowwhatido" ]; then masterbranch=no @@ -291,7 +376,7 @@ eof if [ "$masterbranch" = yes ]; then # Ensure version branch exists - if ! git rev-parse --verify refs/heads/$target_branch 2>/dev/null; then + if ! git rev-parse --verify "refs/heads/${target_branch}" 2>/dev/null; then git branch "$target_branch" fi @@ -306,8 +391,8 @@ eof # Generate documentation (man and html) # First, clean old generated docs - make helper=${helper} docs-clean - make helper=${helper} docs + make docs-clean + make docs ############################################################# # Everything green, let's do the release @@ -322,35 +407,33 @@ eof fi # Publish git changes - if [ "$run_as" = "build-helper" ] - then - make helper=${helper} pub - else + # if you want to have mirror locally then uncomment this support + # if [ "$run_as" = "nico" ] + # then + # git push --mirror + # else # if we are not Nico :) then just push, no mirror git push # push also new branch and set up tracking git push -u origin "${target_branch}" - fi - - # Ensure that pypi release has the right version - "$0" version + # fi # Create and publish package for pypi - make helper=${helper} pypi-release + "$0" pypi-release - if [ "$run_as" = "build-helper" ] + if [ "$run_as" = "nico" ] then # Archlinux release is based on pypi - make helper=${helper} archlinux-release + "$0" archlinux-release fi # sign git tag printf "Enter upstream repository authentication token: " - read token + read -r token "$0" sign-git-release "${target_version}" "${token}" # Announce change on ML - make helper=${helper} ml-release + "$0" ml-release "${target_version}" cat << eof Manual steps post release: @@ -360,7 +443,14 @@ eof ;; test) - export PYTHONPATH="$(pwd -P)" + if [ ! -f "cdist/version.py" ] + then + printf "cdist/version.py is missing, generate it first.\n" + exit 1 + fi + + PYTHONPATH="$(pwd -P)" + export PYTHONPATH if [ $# -lt 1 ]; then python3 -m cdist.test @@ -370,7 +460,15 @@ eof ;; test-remote) - export PYTHONPATH="$(pwd -P)" + if [ ! -f "cdist/version.py" ] + then + printf "cdist/version.py is missing, generate it first.\n" + exit 1 + fi + + PYTHONPATH="$(pwd -P)" + export PYTHONPATH + python3 -m cdist.test.exec.remote ;; @@ -383,9 +481,9 @@ eof printf "\\nPlease review pycodestyle report.\\n" while true do - echo "Continue (yes/no)?" + printf "Continue (yes/no)?\n" any= - read any + read -r any case "$any" in yes) break @@ -394,20 +492,74 @@ eof exit 1 ;; *) - echo "Please answer with 'yes' or 'no' explicitly." + printf "Please answer with 'yes' or 'no' explicitly.\n" ;; esac done ;; + 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) + ${SHELLCHECKCMD} scripts/cdist-dump || exit 0 + ;; + + shellcheck-gencodes) + "$0" shellcheck-local-gencodes + "$0" shellcheck-remote-gencodes + ;; + + shellcheck-types) + "$0" shellcheck-type-explorers + "$0" shellcheck-manifests + "$0" shellcheck-gencodes + ;; + shellcheck) - make helper=${helper} shellcheck + "$0" shellcheck-global-explorers + "$0" shellcheck-types + "$0" shellcheck-scripts + ;; + + shellcheck-type-files) + find cdist/conf/type -type f -path "*/files/*" -exec ${SHELLCHECKCMD} {} + | grep -v "${SHELLCHECK_SKIP}" || exit 0 + ;; + + shellcheck-with-files) + "$0" shellcheck + "$0" shellcheck-type-files + ;; + + shellcheck-build-helper) + ${SHELLCHECKCMD} ./bin/build-helper + ;; + + check-shellcheck) + "$0" shellcheck printf "\\nPlease review shellcheck report.\\n" while true do - echo "Continue (yes/no)?" + printf "Continue (yes/no)?\n" any= - read any + read -r any case "$any" in yes) break @@ -416,7 +568,7 @@ eof exit 1 ;; *) - echo "Please answer with 'yes' or 'no' explicitly." + printf "Please answer with 'yes' or 'no' explicitly.\n" ;; esac done @@ -427,16 +579,39 @@ eof ;; version) - echo "VERSION = \"$(git describe)\"" > cdist/version.py + printf "VERSION = \"%s\"\n" "$(git describe)" > cdist/version.py ;; target-version) target_version=$($0 changelog-version) - echo "VERSION = \"${target_version}\"" > cdist/version.py + 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 + ;; + + distclean) + "$0" clean + rm -f cdist/version.py + ;; *) - echo "Unknown helper target $@ - aborting" + printf "Unknown target: '%s'.\n" "${option}" >&2 + usage "${basename}" exit 1 ;; diff --git a/bin/build-helper.darko b/bin/build-helper.darko deleted file mode 120000 index 1f3e3384..00000000 --- a/bin/build-helper.darko +++ /dev/null @@ -1 +0,0 @@ -build-helper \ No newline at end of file diff --git a/docs/changelog b/docs/changelog index 40cb1f83..38c59047 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,6 +3,7 @@ Changelog next: * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) + * Build: Clean and separate end user targets into Makefile and maintainer targets into build-helper (Darko Poljak) 5.0.0: 2019-05-05 * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) diff --git a/docs/src/cdist-install.rst b/docs/src/cdist-install.rst index c05036b0..4d3df8f8 100644 --- a/docs/src/cdist-install.rst +++ b/docs/src/cdist-install.rst @@ -48,14 +48,29 @@ create version.py: .. code-block:: sh - make version + ./bin/build-helper version -Then, as usual, you execute the following command: +Then you install it with: + +.. code-block:: sh + + make install + +or with: + +.. code-block:: sh + + make install-user + +to install it into user *site-packages* directory. +Or directly with distutils: .. code-block:: sh python setup.py install +Note that `bin/build-helper` script is intended for cdist maintainers. + Available versions in git ^^^^^^^^^^^^^^^^^^^^^^^^^ From 73fd1ffbc142c57d652750aac143fe07a2e58135 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 8 May 2019 23:38:43 +0200 Subject: [PATCH 033/383] Update homepage --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d76bbd4b..5f14a2f4 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( description="A Usable Configuration Management System", author="Nico Schottelius", author_email="nico-cdist-pypi@schottelius.org", - url="http://www.nico.schottelius.org/software/cdist/", + url="https://www.cdi.st/", classifiers=[ "Development Status :: 6 - Mature", "Environment :: Console", From 15f01149f96205d17711cbe8abdcabfd37f1087c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 9 May 2019 08:26:42 +0200 Subject: [PATCH 034/383] Update old homepage residual refs and non working git protocol --- PKGBUILD.in | 2 +- cdist/argparse.py | 2 +- cdist/conf/type/__cdist/man.rst | 4 ++-- cdist/conf/type/__cdist/parameter/default/source | 2 +- cdist/conf/type/__git/man.rst | 2 +- docs/changelog | 3 +++ docs/src/cdist-install.rst | 2 ++ docs/src/cdist-quickstart.rst | 4 +--- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/PKGBUILD.in b/PKGBUILD.in index c967249d..c0188e68 100755 --- a/PKGBUILD.in +++ b/PKGBUILD.in @@ -9,7 +9,7 @@ pkgver=$version pkgrel=1 pkgdesc='A Usable Configuration Management System"' arch=('any') -url='http://www.nico.schottelius.org/software/cdist/' +url='https://www.cdi.st/' license=('GPL3') depends=('python>=3.2.0') source=("http://pypi.python.org/packages/source/c/cdist/cdist-\${pkgver}.tar.gz") diff --git a/cdist/argparse.py b/cdist/argparse.py index 3ebdc138..421d1b54 100644 --- a/cdist/argparse.py +++ b/cdist/argparse.py @@ -13,7 +13,7 @@ BETA_COMMANDS = set(('install', 'inventory', )) BETA_ARGS = { 'config': set(('tag', 'all_tagged_hosts', 'use_archiving', )), } -EPILOG = "Get cdist at http://www.nico.schottelius.org/software/cdist/" +EPILOG = "Get cdist at https://code.ungleich.ch/ungleich-public/cdist" # Parser others can reuse parser = None diff --git a/cdist/conf/type/__cdist/man.rst b/cdist/conf/type/__cdist/man.rst index 15c77d7f..be082781 100644 --- a/cdist/conf/type/__cdist/man.rst +++ b/cdist/conf/type/__cdist/man.rst @@ -30,7 +30,7 @@ username source Select the source from which to clone cdist from. - Defaults to "git://code.ungleich.ch/ungleich-public/cdist.git". + Defaults to "git@code.ungleich.ch:ungleich-public/cdist.git". branch @@ -47,7 +47,7 @@ EXAMPLES __cdist /home/cdist/cdist # Use alternative source - __cdist --source "git://code.ungleich.ch/ungleich-public/cdist" /home/cdist/cdist + __cdist --source "git@code.ungleich.ch:ungleich-public/cdist.git" /home/cdist/cdist AUTHORS diff --git a/cdist/conf/type/__cdist/parameter/default/source b/cdist/conf/type/__cdist/parameter/default/source index 5f44a285..1ad3a250 100644 --- a/cdist/conf/type/__cdist/parameter/default/source +++ b/cdist/conf/type/__cdist/parameter/default/source @@ -1 +1 @@ -git://code.ungleich.ch/ungleich-public/cdist.git +git@code.ungleich.ch:ungleich-public/cdist.git diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index aa704d2b..130925c8 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -44,7 +44,7 @@ EXAMPLES __git /home/services/dokuwiki --source git://github.com/splitbrain/dokuwiki.git # Checkout cdist, stay on branch 2.1 - __git /home/nico/cdist --source git://code.ungleich.ch/ungleich-public/cdist.git --branch 2.1 + __git /home/nico/cdist --source git@code.ungleich.ch:ungleich-public/cdist.git --branch 2.1 AUTHORS diff --git a/docs/changelog b/docs/changelog index 38c59047..e3fd9368 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,9 @@ Changelog next: * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) * Build: Clean and separate end user targets into Makefile and maintainer targets into build-helper (Darko Poljak) + * Core: Update residual references to old cdist homepage (Darko Poljak) + * Documentation: Update residual references to old cdist homepage and git source (Darko Poljak) + * Type __cdist: Fix non working 'git://' protocol source (Darko Poljak) 5.0.0: 2019-05-05 * Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov) diff --git a/docs/src/cdist-install.rst b/docs/src/cdist-install.rst index 4d3df8f8..a9b7d6b5 100644 --- a/docs/src/cdist-install.rst +++ b/docs/src/cdist-install.rst @@ -43,6 +43,8 @@ To install cdist, execute the following commands: From version 4.2.0 cdist tags and releases are signed. You can get GPG public key used for signing `here <_static/pgp-key-EFD2AE4EC36B6901.asc>`_. +You can also get cdist from `github mirror `_. + To install cdist with distutils from cloned repository, first you have to create version.py: diff --git a/docs/src/cdist-quickstart.rst b/docs/src/cdist-quickstart.rst index b9220b67..99af869f 100644 --- a/docs/src/cdist-quickstart.rst +++ b/docs/src/cdist-quickstart.rst @@ -54,9 +54,7 @@ we can use cdist to configure it. You can copy and paste the following code into your shell to get started and configure localhost:: # Get cdist - # Mirrors can be found on - # http://www.nico.schottelius.org/software/cdist/install/#index2h4 - git clone git://code.ungleich.ch/ungleich-public/cdist + git clone git@code.ungleich.ch:ungleich-public/cdist.git # Create manifest (maps configuration to host(s) cd cdist From a8ee4356efbd15517c90763ea92e59c0faec2a23 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 9 May 2019 19:11:09 +0200 Subject: [PATCH 035/383] Release 5.0.1 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index e3fd9368..cd66c649 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.0.1: 2019-05-09 * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) * Build: Clean and separate end user targets into Makefile and maintainer targets into build-helper (Darko Poljak) * Core: Update residual references to old cdist homepage (Darko Poljak) From afa00a90943d69704aa9aa4c616992bada09c13c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 9 May 2019 19:35:52 +0200 Subject: [PATCH 036/383] Fix build-helper script --- bin/build-helper | 87 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index bba44ded..00fe4ec7 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -23,7 +23,7 @@ # usage() { - printf "usage: %s TARGET [RUN-AS] + printf "usage: %s TARGET RUN-AS Available targets: print-runas changelog-changes @@ -61,24 +61,19 @@ usage() { distclean Run as: nico - darko - default, if not specified\n" "$1" + darko - default, if empty string specified\n" "$1" } basename="${0##*/}" -if [ $# -lt 1 ] +if [ $# -lt 2 ] then usage "${basename}" exit 1 fi option=$1; shift -if [ $# -ge 1 ] -then - run_as="$1" -else - run_as="darko" -fi +run_as="$1"; shift case "$run_as" in nico) @@ -92,6 +87,10 @@ case "$run_as" in from_d=gmail.com ml_name="Darko Poljak" ml_sig_name="Darko" + if [ -z "${run_as}" ] + then + run_as="darko" + fi ;; *) printf "Unsupported RUN-AS value: '%s'.\n" "${run_as}" >&2 @@ -160,7 +159,7 @@ case "$option" in ;; check-unittest) - "$0" test + "$0" test "${run_as}" ;; ml-release) @@ -191,7 +190,7 @@ cdist $version has been released with the following changes: eof - "$0" changelog-changes "$version" + "$0" changelog-changes "${run_as}" "$version" cat << eof Cheers, @@ -226,7 +225,7 @@ eof pypi-release) # Ensure that pypi release has the right version - "$0" version + "$0" version "${run_as}" make docs-clean make docs @@ -234,7 +233,7 @@ eof ;; release-git-tag) - target_version=$($0 changelog-version) + target_version=$($0 changelog-version "${run_as}") if git rev-parse --verify "refs/tags/${target_version}" 2>/dev/null; then printf "Tag for %s exists, aborting\n" "${target_version}" exit 1 @@ -288,7 +287,7 @@ eof git archive --prefix="cdist-${tag}/" -o "${archivename}" "${tag}" \ || exit 1 # make sure target version is generated - "$0" target-version + "$0" target-version "${run_as}" 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 @@ -318,7 +317,7 @@ eof | sed "${sed_cmd}") || exit 1 # make release - changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') + changelog=$("$0" changelog-changes "${run_as}" "$1" | sed 's/^[[:space:]]*//') release_notes=$( printf "%s\n\n%s\n\n**Changelog**\n\n%s\n" \ "${response_archive}" "${response_archive_sig}" "${changelog}" @@ -339,19 +338,19 @@ eof release) set -e - target_version=$($0 changelog-version) - target_branch=$($0 version-branch) + target_version=$($0 changelog-version "${run_as}") + target_branch=$($0 version-branch "${run_as}") printf "Beginning release process for %s\n" "${target_version}" # First check everything is sane - "$0" check-date - "$0" check-unittest - "$0" check-pycodestyle - "$0" check-shellcheck + "$0" check-date "${run_as}" + "$0" check-unittest "${run_as}" + "$0" check-pycodestyle "${run_as}" + "$0" check-shellcheck "${run_as}" # Generate version file to be included in packaging - "$0" target-version + "$0" target-version "${run_as}" # Ensure the git status is clean, else abort if ! git diff-index --name-only --exit-code HEAD ; then @@ -386,8 +385,8 @@ eof fi # Verify that after the merge everything works - "$0" check-date - "$0" check-unittest + "$0" check-date "${run_as}" + "$0" check-unittest "${run_as}" # Generate documentation (man and html) # First, clean old generated docs @@ -398,7 +397,7 @@ eof # Everything green, let's do the release # Tag the current commit - "$0" release-git-tag + "$0" release-git-tag "${run_as}" # Also merge back the version branch if [ "$masterbranch" = yes ]; then @@ -419,21 +418,21 @@ eof # fi # Create and publish package for pypi - "$0" pypi-release + "$0" pypi-release "${run_as}" if [ "$run_as" = "nico" ] then # Archlinux release is based on pypi - "$0" archlinux-release + "$0" archlinux-release "${run_as}" fi # sign git tag printf "Enter upstream repository authentication token: " read -r token - "$0" sign-git-release "${target_version}" "${token}" + "$0" sign-git-release "${run_as}" "${target_version}" "${token}" # Announce change on ML - "$0" ml-release "${target_version}" + "$0" ml-release "${run_as}" "${target_version}" cat << eof Manual steps post release: @@ -477,7 +476,7 @@ eof ;; check-pycodestyle) - "$0" pycodestyle + "$0" pycodestyle "${run_as}" printf "\\nPlease review pycodestyle report.\\n" while true do @@ -523,20 +522,20 @@ eof ;; shellcheck-gencodes) - "$0" shellcheck-local-gencodes - "$0" shellcheck-remote-gencodes + "$0" shellcheck-local-gencodes "${run_as}" + "$0" shellcheck-remote-gencodes "${run_as}" ;; shellcheck-types) - "$0" shellcheck-type-explorers - "$0" shellcheck-manifests - "$0" shellcheck-gencodes + "$0" shellcheck-type-explorers "${run_as}" + "$0" shellcheck-manifests "${run_as}" + "$0" shellcheck-gencodes "${run_as}" ;; shellcheck) - "$0" shellcheck-global-explorers - "$0" shellcheck-types - "$0" shellcheck-scripts + "$0" shellcheck-global-explorers "${run_as}" + "$0" shellcheck-types "${run_as}" + "$0" shellcheck-scripts "${run_as}" ;; shellcheck-type-files) @@ -544,8 +543,8 @@ eof ;; shellcheck-with-files) - "$0" shellcheck - "$0" shellcheck-type-files + "$0" shellcheck "${run_as}" + "$0" shellcheck-type-files "${run_as}" ;; shellcheck-build-helper) @@ -553,7 +552,7 @@ eof ;; check-shellcheck) - "$0" shellcheck + "$0" shellcheck "${run_as}" printf "\\nPlease review shellcheck report.\\n" while true do @@ -575,7 +574,7 @@ eof ;; version-branch) - "$0" changelog-version | cut -d. -f '1,2' + "$0" changelog-version "${run_as}" | cut -d. -f '1,2' ;; version) @@ -583,7 +582,7 @@ eof ;; target-version) - target_version=$($0 changelog-version) + target_version=$($0 changelog-version "${run_as}") printf "VERSION = \"%s\"\n" "${target_version}" > cdist/version.py ;; @@ -606,7 +605,7 @@ eof ;; distclean) - "$0" clean + "$0" clean "${run_as}" rm -f cdist/version.py ;; *) From 66cdbc5233407d5f926e1db3e4031ffe6ef3a8b2 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 9 May 2019 21:05:33 +0200 Subject: [PATCH 037/383] Simplify maintainer's helper script --- bin/build-helper | 145 +++++++++++++---------------------------------- 1 file changed, 39 insertions(+), 106 deletions(-) diff --git a/bin/build-helper b/bin/build-helper index 00fe4ec7..1698a678 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -23,9 +23,8 @@ # usage() { - printf "usage: %s TARGET RUN-AS + printf "usage: %s TARGET [TARGET-ARGS...] Available targets: - print-runas changelog-changes changelog-version check-date @@ -58,64 +57,29 @@ usage() { version target-version clean - distclean - Run as: - nico - darko - default, if empty string specified\n" "$1" + distclean\n" "$1" } basename="${0##*/}" -if [ $# -lt 2 ] +if [ $# -lt 1 ] then usage "${basename}" exit 1 fi option=$1; shift -run_as="$1"; shift - -case "$run_as" in - nico) - from_a=nico.schottelius - from_d=ungleich.ch - ml_name="Nico Schottelius" - ml_sig_name="Nico" - ;; - darko|'') - from_a=darko.poljak - from_d=gmail.com - ml_name="Darko Poljak" - ml_sig_name="Darko" - if [ -z "${run_as}" ] - then - run_as="darko" - fi - ;; - *) - printf "Unsupported RUN-AS value: '%s'.\n" "${run_as}" >&2 - usage "${basename}" - exit 1 - ;; -esac 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\]' -to_a="cdist-configuration-management" -to_d="googlegroups.com" - # Change to checkout directory basedir="${0%/*}/../" cd "$basedir" case "$option" in - print-runas) - printf "run_as: '%s'\n" "$run_as" - ;; - changelog-changes) if [ "$#" -eq 1 ]; then start=$1 @@ -159,7 +123,7 @@ case "$option" in ;; check-unittest) - "$0" test "${run_as}" + "$0" test ;; ml-release) @@ -168,20 +132,10 @@ case "$option" in exit 1 fi - # Send mail only once - lock until new changelog things happened. - [ ! -f .lock-ml ] && touch .lock-ml - x=$(find 'docs' -name changelog -type f -newer .lock-ml) - [ -z "${x}" ] && exit 0 - version=$1; shift - to=${to_a}@${to_d} - from=${from_a}@${from_d} - ( cat << eof -From: ${ml_name} <$from> -To: cdist mailing list <$to> Subject: cdist $version has been released Hello .*, @@ -190,23 +144,11 @@ cdist $version has been released with the following changes: eof - "$0" changelog-changes "${run_as}" "$version" + "$0" changelog-changes "$version" cat << eof -Cheers, -${ml_sig_name} - --- -Automatisation at its best level. With cdist. eof ) > mailinglist.tmp - - if [ "$run_as" = "nico" ] - then - /usr/sbin/sendmail -f "$from" "$to" < mailinglist.tmp && rm -f mailinglist.tmp - fi - - touch .lock-ml ;; archlinux-release) @@ -225,7 +167,7 @@ eof pypi-release) # Ensure that pypi release has the right version - "$0" version "${run_as}" + "$0" version make docs-clean make docs @@ -233,7 +175,7 @@ eof ;; release-git-tag) - target_version=$($0 changelog-version "${run_as}") + target_version=$($0 changelog-version) if git rev-parse --verify "refs/tags/${target_version}" 2>/dev/null; then printf "Tag for %s exists, aborting\n" "${target_version}" exit 1 @@ -287,7 +229,7 @@ eof git archive --prefix="cdist-${tag}/" -o "${archivename}" "${tag}" \ || exit 1 # make sure target version is generated - "$0" target-version "${run_as}" + "$0" target-version 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 @@ -317,7 +259,7 @@ eof | sed "${sed_cmd}") || exit 1 # make release - changelog=$("$0" changelog-changes "${run_as}" "$1" | sed 's/^[[:space:]]*//') + changelog=$("$0" changelog-changes "$1" | sed 's/^[[:space:]]*//') release_notes=$( printf "%s\n\n%s\n\n**Changelog**\n\n%s\n" \ "${response_archive}" "${response_archive_sig}" "${changelog}" @@ -338,19 +280,19 @@ eof release) set -e - target_version=$($0 changelog-version "${run_as}") - target_branch=$($0 version-branch "${run_as}") + target_version=$($0 changelog-version) + target_branch=$($0 version-branch) printf "Beginning release process for %s\n" "${target_version}" # First check everything is sane - "$0" check-date "${run_as}" - "$0" check-unittest "${run_as}" - "$0" check-pycodestyle "${run_as}" - "$0" check-shellcheck "${run_as}" + "$0" check-date + "$0" check-unittest + "$0" check-pycodestyle + "$0" check-shellcheck # Generate version file to be included in packaging - "$0" target-version "${run_as}" + "$0" target-version # Ensure the git status is clean, else abort if ! git diff-index --name-only --exit-code HEAD ; then @@ -385,8 +327,8 @@ eof fi # Verify that after the merge everything works - "$0" check-date "${run_as}" - "$0" check-unittest "${run_as}" + "$0" check-date + "$0" check-unittest # Generate documentation (man and html) # First, clean old generated docs @@ -397,7 +339,7 @@ eof # Everything green, let's do the release # Tag the current commit - "$0" release-git-tag "${run_as}" + "$0" release-git-tag # Also merge back the version branch if [ "$masterbranch" = yes ]; then @@ -406,37 +348,28 @@ eof fi # Publish git changes - # if you want to have mirror locally then uncomment this support - # if [ "$run_as" = "nico" ] - # then + # if you want to have mirror locally then uncomment this and comment below # git push --mirror - # else - # if we are not Nico :) then just push, no mirror git push # push also new branch and set up tracking git push -u origin "${target_branch}" # fi # Create and publish package for pypi - "$0" pypi-release "${run_as}" - - if [ "$run_as" = "nico" ] - then - # Archlinux release is based on pypi - "$0" archlinux-release "${run_as}" - fi + "$0" pypi-release # sign git tag printf "Enter upstream repository authentication token: " read -r token - "$0" sign-git-release "${run_as}" "${target_version}" "${token}" + "$0" sign-git-release "${target_version}" "${token}" # Announce change on ML - "$0" ml-release "${run_as}" "${target_version}" + "$0" ml-release "${target_version}" cat << eof Manual steps post release: - cdist-web + - send mail body generated in mailinglist.tmp and inform Dmitry for deb - twitter eof ;; @@ -476,7 +409,7 @@ eof ;; check-pycodestyle) - "$0" pycodestyle "${run_as}" + "$0" pycodestyle printf "\\nPlease review pycodestyle report.\\n" while true do @@ -522,20 +455,20 @@ eof ;; shellcheck-gencodes) - "$0" shellcheck-local-gencodes "${run_as}" - "$0" shellcheck-remote-gencodes "${run_as}" + "$0" shellcheck-local-gencodes + "$0" shellcheck-remote-gencodes ;; shellcheck-types) - "$0" shellcheck-type-explorers "${run_as}" - "$0" shellcheck-manifests "${run_as}" - "$0" shellcheck-gencodes "${run_as}" + "$0" shellcheck-type-explorers + "$0" shellcheck-manifests + "$0" shellcheck-gencodes ;; shellcheck) - "$0" shellcheck-global-explorers "${run_as}" - "$0" shellcheck-types "${run_as}" - "$0" shellcheck-scripts "${run_as}" + "$0" shellcheck-global-explorers + "$0" shellcheck-types + "$0" shellcheck-scripts ;; shellcheck-type-files) @@ -543,8 +476,8 @@ eof ;; shellcheck-with-files) - "$0" shellcheck "${run_as}" - "$0" shellcheck-type-files "${run_as}" + "$0" shellcheck + "$0" shellcheck-type-files ;; shellcheck-build-helper) @@ -552,7 +485,7 @@ eof ;; check-shellcheck) - "$0" shellcheck "${run_as}" + "$0" shellcheck printf "\\nPlease review shellcheck report.\\n" while true do @@ -574,7 +507,7 @@ eof ;; version-branch) - "$0" changelog-version "${run_as}" | cut -d. -f '1,2' + "$0" changelog-version | cut -d. -f '1,2' ;; version) @@ -582,7 +515,7 @@ eof ;; target-version) - target_version=$($0 changelog-version "${run_as}") + target_version=$($0 changelog-version) printf "VERSION = \"%s\"\n" "${target_version}" > cdist/version.py ;; @@ -605,7 +538,7 @@ eof ;; distclean) - "$0" clean "${run_as}" + "$0" clean rm -f cdist/version.py ;; *) From 569ae29955961cd2901ef6307efff152daa87473 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 May 2019 11:47:15 +0200 Subject: [PATCH 038/383] [__package_apk] fix / add support for @yrepo syntax --- cdist/conf/type/__package_apk/explorer/state | 4 ++++ docs/changelog | 3 +++ 2 files changed, 7 insertions(+) diff --git a/cdist/conf/type/__package_apk/explorer/state b/cdist/conf/type/__package_apk/explorer/state index 29ccf3a5..b477ca7c 100755 --- a/cdist/conf/type/__package_apk/explorer/state +++ b/cdist/conf/type/__package_apk/explorer/state @@ -27,6 +27,10 @@ else name="$__object_id" fi +# Remove the @.. repo tag for finding out whether it is installed +# f.i. pass@testing => pass +name="$(echo "$name" | sed 's/@.*//')" + if [ "$(apk list -I "$name")" ]; then echo present else diff --git a/docs/changelog b/docs/changelog index cd66c649..af8fef8f 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) + 5.0.1: 2019-05-09 * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) * Build: Clean and separate end user targets into Makefile and maintainer targets into build-helper (Darko Poljak) From ca8bc959ed931734570b2c47d2d99c5b35c754a3 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Tue, 14 May 2019 13:27:43 +0300 Subject: [PATCH 039/383] __acl: add todo note --- cdist/conf/type/__acl/explorer/checks | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cdist/conf/type/__acl/explorer/checks b/cdist/conf/type/__acl/explorer/checks index 2f3b9e6d..2aae13f6 100755 --- a/cdist/conf/type/__acl/explorer/checks +++ b/cdist/conf/type/__acl/explorer/checks @@ -18,6 +18,8 @@ # along with cdist. If not, see . # +# TODO check if filesystem has ACL turned on etc + [ ! -e "/$__object_id" ] && exit 0 for parameter in user group From 7dfc5bc4736b00e8622555169c65800bb7bf4600 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Tue, 14 May 2019 13:41:32 +0300 Subject: [PATCH 040/383] __acl: we do not have to check here if file exist --- cdist/conf/type/__acl/explorer/checks | 2 -- 1 file changed, 2 deletions(-) diff --git a/cdist/conf/type/__acl/explorer/checks b/cdist/conf/type/__acl/explorer/checks index 2aae13f6..a2fcf44d 100755 --- a/cdist/conf/type/__acl/explorer/checks +++ b/cdist/conf/type/__acl/explorer/checks @@ -20,8 +20,6 @@ # TODO check if filesystem has ACL turned on etc -[ ! -e "/$__object_id" ] && exit 0 - for parameter in user group do if [ ! -f "$__object/parameter/$parameter" ] From 7a25ec00edb8458c8a11de3971024a9f99d1ba47 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Tue, 14 May 2019 13:42:56 +0300 Subject: [PATCH 041/383] __acl: add TODO note about dry-run --- cdist/conf/type/__acl/gencode-remote | 1 + 1 file changed, 1 insertion(+) diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index ef903816..d47469c1 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -20,6 +20,7 @@ file_is="$( cat "$__object/explorer/file_is" )" +# TODO this check is not needed with dry-run [ "$file_is" = 'missing' ] && exit 0 os="$( cat "$__global/explorer/os" )" From 5f462d638017c22548176aeb7594098d009af21e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 May 2019 16:49:33 +0200 Subject: [PATCH 042/383] ++alpine support --- cdist/conf/type/__postfix/manifest | 3 ++- cdist/conf/type/__postfix_postconf/explorer/value | 2 +- cdist/conf/type/__postfix_postconf/gencode-remote | 3 ++- docs/changelog | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__postfix/manifest b/cdist/conf/type/__postfix/manifest index 1aea53a1..f3616979 100755 --- a/cdist/conf/type/__postfix/manifest +++ b/cdist/conf/type/__postfix/manifest @@ -1,6 +1,7 @@ #!/bin/sh -e # # 2012-2014 Steven Armstrong (steven-cdist at armstrong.cc) +# 2019 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -22,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|scientific|centos|devuan) + alpine|ubuntu|debian|archlinux|suse|scientific|centos|devuan) __package postfix --state present ;; *) diff --git a/cdist/conf/type/__postfix_postconf/explorer/value b/cdist/conf/type/__postfix_postconf/explorer/value index 17126c94..67dacad8 100755 --- a/cdist/conf/type/__postfix_postconf/explorer/value +++ b/cdist/conf/type/__postfix_postconf/explorer/value @@ -22,7 +22,7 @@ os=$("$__explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|scientific|centos|devuan) + alpine|ubuntu|debian|archlinux|suse|scientific|centos|devuan) : ;; *) diff --git a/cdist/conf/type/__postfix_postconf/gencode-remote b/cdist/conf/type/__postfix_postconf/gencode-remote index 6df0da7f..279dddd4 100755 --- a/cdist/conf/type/__postfix_postconf/gencode-remote +++ b/cdist/conf/type/__postfix_postconf/gencode-remote @@ -1,6 +1,7 @@ #!/bin/sh -e # # 2012-2014 Steven Armstrong (steven-cdist at armstrong.cc) +# 2019 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -21,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|scientific|centos|devuan) + alpine|archlinux|centos|debian|devuan|suse|scientific|ubuntu) : ;; *) diff --git a/docs/changelog b/docs/changelog index af8fef8f..556fd42f 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,6 +3,8 @@ Changelog next: * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) + * Type __postfix: Add alpine support (Nico Schottelius) + * Type __postfix_postconf: Add alpine support (Nico Schottelius) 5.0.1: 2019-05-09 * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) From ce52203ba3a84297599f9b0eeb66ae83f967859e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 May 2019 17:10:26 +0200 Subject: [PATCH 043/383] __user add alpine support --- cdist/conf/type/__user/manifest | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 cdist/conf/type/__user/manifest diff --git a/cdist/conf/type/__user/manifest b/cdist/conf/type/__user/manifest new file mode 100644 index 00000000..8f10b38c --- /dev/null +++ b/cdist/conf/type/__user/manifest @@ -0,0 +1,32 @@ +#!/bin/sh -e +# +# 2019 Nico Schottelius (nico-cdist at schottelius.org) +# +# 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 . +# +# +# Manage users. + +os=$(cat "$__global/explorer/os") + +case "$os" in + alpine) + __package shadow + ;; + *) + : + ;; +esac From fe643b9092a61f5616624e10ebd0abdf0749823a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 May 2019 17:10:46 +0200 Subject: [PATCH 044/383] ++doc --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 556fd42f..41b0088f 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,6 +5,7 @@ next: * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) * Type __postfix: Add alpine support (Nico Schottelius) * Type __postfix_postconf: Add alpine support (Nico Schottelius) + * Type __user: Add alpine support (Nico Schottelius) 5.0.1: 2019-05-09 * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) From 69622b0fa5f0d29eaf6d4357a0e84f8a6f6b101b Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Thu, 16 May 2019 21:58:47 +0200 Subject: [PATCH 045/383] set __cdist_dry_run env var if dry-run --- cdist/config.py | 9 ++++++--- cdist/core/code.py | 5 ++++- cdist/core/explorer.py | 6 +++++- cdist/core/manifest.py | 5 ++++- docs/src/cdist-reference.rst.sh | 4 ++++ docs/src/cdist-type.rst | 9 +++++++++ 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index bc05a28c..30117382 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -104,9 +104,12 @@ class Config(object): self.remove_remote_files_dirs = remove_remote_files_dirs self.explorer = core.Explorer(self.local.target_host, self.local, - self.remote, jobs=self.jobs) - self.manifest = core.Manifest(self.local.target_host, self.local) - self.code = core.Code(self.local.target_host, self.local, self.remote) + self.remote, jobs=self.jobs, + dry_run=self.dry_run) + self.manifest = core.Manifest(self.local.target_host, self.local, + dry_run=self.dry_run) + self.code = core.Code(self.local.target_host, self.local, self.remote, + dry_run=self.dry_run) def _init_files_dirs(self): """Prepare files and directories for the run""" diff --git a/cdist/core/code.py b/cdist/core/code.py index 670029ed..1550880a 100644 --- a/cdist/core/code.py +++ b/cdist/core/code.py @@ -97,7 +97,7 @@ class Code(object): """ # target_host is tuple (target_host, target_hostname, target_fqdn) - def __init__(self, target_host, local, remote): + def __init__(self, target_host, local, remote, dry_run=False): self.target_host = target_host self.local = local self.remote = remote @@ -113,6 +113,9 @@ class Code(object): local.log), } + if dry_run: + self.env['__cdist_dry_run'] = '1' + def _run_gencode(self, cdist_object, which): cdist_type = cdist_object.cdist_type script = os.path.join(self.local.type_path, diff --git a/cdist/core/explorer.py b/cdist/core/explorer.py index acceacac..353d7681 100644 --- a/cdist/core/explorer.py +++ b/cdist/core/explorer.py @@ -67,7 +67,7 @@ class Explorer(object): """Executes cdist explorers. """ - def __init__(self, target_host, local, remote, jobs=None): + def __init__(self, target_host, local, remote, jobs=None, dry_run=False): self.target_host = target_host self._open_logger() @@ -84,6 +84,10 @@ class Explorer(object): '__cdist_log_level_name': util.log_level_name_env_var_val( self.log), } + + if dry_run: + self.env['__cdist_dry_run'] = '1' + self._type_explorers_transferred = [] self.jobs = jobs diff --git a/cdist/core/manifest.py b/cdist/core/manifest.py index 938ad8b8..07af0ef8 100644 --- a/cdist/core/manifest.py +++ b/cdist/core/manifest.py @@ -96,7 +96,7 @@ class Manifest(object): """Executes cdist manifests. """ - def __init__(self, target_host, local): + def __init__(self, target_host, local, dry_run=False): self.target_host = target_host self.local = local @@ -117,6 +117,9 @@ class Manifest(object): self.log), } + if dry_run: + self.env['__cdist_dry_run'] = '1' + def _open_logger(self): self.log = logging.getLogger(self.target_host[0]) diff --git a/docs/src/cdist-reference.rst.sh b/docs/src/cdist-reference.rst.sh index 2c9c7b40..f4a37816 100755 --- a/docs/src/cdist-reference.rst.sh +++ b/docs/src/cdist-reference.rst.sh @@ -219,6 +219,10 @@ __cdist_log_level, __cdist_log_level_name | TRACE | 5 | +----------------+-----------------+ + Available for: initial manifest, explorer, type manifest, type explorer, + type gencode. +__cdist_dry_run + Is set only when doing dry run (``-n`` flag). Available for: initial manifest, explorer, type manifest, type explorer, type gencode. __explorer diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index 7c0dab8d..7e5e39ef 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -371,6 +371,15 @@ It is available for initial manifest, explorer, type manifest, type explorer, type gencode. +Detecting dry run +----------------- + +If ``$__cdist_dry_run`` environment variable is set, then it's dry run. + +It is available for initial manifest, explorer, type manifest, +type explorer, type gencode. + + Hints for typewriters ---------------------- It must be assumed that the target is pretty dumb and thus does not have high From 7195b594f302be7742eaa84e1daa0bdc71bbc012 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 16 May 2019 21:59:30 +0200 Subject: [PATCH 046/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 41b0088f..47b4b14b 100644 --- a/docs/changelog +++ b/docs/changelog @@ -6,6 +6,7 @@ next: * Type __postfix: Add alpine support (Nico Schottelius) * Type __postfix_postconf: Add alpine support (Nico Schottelius) * Type __user: Add alpine support (Nico Schottelius) + * Core: Set __cdist_dry_run env var (Ander Punnar) 5.0.1: 2019-05-09 * Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak) From d604a9db7a080c1cc3782f6e488a2ed6a508fd02 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 17 May 2019 13:03:46 +0200 Subject: [PATCH 047/383] Fix pycodestyle --- cdist/inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/inventory.py b/cdist/inventory.py index 7da306fa..138a2034 100644 --- a/cdist/inventory.py +++ b/cdist/inventory.py @@ -315,7 +315,7 @@ class InventoryHost(Inventory): hostpath = self._host_path(host) self.log.trace("hostpath: {}".format(hostpath)) if self.action == "add" and not os.path.exists(hostpath): - self._new_hostpath(hostpath) + self._new_hostpath(hostpath) else: if not os.path.isfile(hostpath): raise cdist.Error(("Host path \'{}\' is" From 4a5425a95e8b5fce1d2e49064301a4e173f8d003 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 17 May 2019 13:02:05 +0200 Subject: [PATCH 048/383] Release 5.0.2 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 47b4b14b..515f7b69 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.0.2: 2019-05-17 * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) * Type __postfix: Add alpine support (Nico Schottelius) * Type __postfix_postconf: Add alpine support (Nico Schottelius) From 21a16f5584a08b8f155c01d2cbb78a003fc5725b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 18 May 2019 23:46:09 +0200 Subject: [PATCH 049/383] consul, changelog, consul agent => alpine --- .../type/__consul/files/versions/1.5.0/cksum | 1 + .../type/__consul/files/versions/1.5.0/source | 1 + cdist/conf/type/__consul/gencode-remote | 2 +- cdist/conf/type/__consul/manifest | 3 +- .../__consul_agent/files/consul.sys-openrc | 38 +++++++++++++++ cdist/conf/type/__consul_agent/manifest | 47 +++++++++---------- docs/changelog | 5 ++ 7 files changed, 71 insertions(+), 26 deletions(-) create mode 100644 cdist/conf/type/__consul/files/versions/1.5.0/cksum create mode 100644 cdist/conf/type/__consul/files/versions/1.5.0/source create mode 100644 cdist/conf/type/__consul_agent/files/consul.sys-openrc diff --git a/cdist/conf/type/__consul/files/versions/1.5.0/cksum b/cdist/conf/type/__consul/files/versions/1.5.0/cksum new file mode 100644 index 00000000..efca9caa --- /dev/null +++ b/cdist/conf/type/__consul/files/versions/1.5.0/cksum @@ -0,0 +1 @@ +886614099 103959898 consul diff --git a/cdist/conf/type/__consul/files/versions/1.5.0/source b/cdist/conf/type/__consul/files/versions/1.5.0/source new file mode 100644 index 00000000..cafa9248 --- /dev/null +++ b/cdist/conf/type/__consul/files/versions/1.5.0/source @@ -0,0 +1 @@ +https://releases.hashicorp.com/consul/1.5.0/consul_1.5.0_linux_amd64.zip diff --git a/cdist/conf/type/__consul/gencode-remote b/cdist/conf/type/__consul/gencode-remote index 1d2244ea..2a21054f 100755 --- a/cdist/conf/type/__consul/gencode-remote +++ b/cdist/conf/type/__consul/gencode-remote @@ -42,7 +42,7 @@ source_file_name="${source##*/}" cksum_should=$(cut -d' ' -f1,2 "$version_dir/cksum") cat << eof - tmpdir=\$(mktemp -d --tmpdir="/tmp" "${__type##*/}.XXXXXXXXXX") + tmpdir=\$(mktemp -d -p /tmp "${__type##*/}.XXXXXXXXXX") curl -s -L "$source" > "\$tmpdir/$source_file_name" unzip -p "\$tmpdir/$source_file_name" > "${destination}.tmp" rm -rf "\$tmpdir" diff --git a/cdist/conf/type/__consul/manifest b/cdist/conf/type/__consul/manifest index 0dd50f53..156eb667 100755 --- a/cdist/conf/type/__consul/manifest +++ b/cdist/conf/type/__consul/manifest @@ -24,7 +24,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo) + alpine|scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo) # any linux should work : ;; @@ -47,6 +47,7 @@ fi if [ -f "$__object/parameter/direct" ]; then __package unzip + __package curl else __staged_file /usr/local/bin/consul \ --source "$(cat "$version_dir/source")" \ diff --git a/cdist/conf/type/__consul_agent/files/consul.sys-openrc b/cdist/conf/type/__consul_agent/files/consul.sys-openrc new file mode 100644 index 00000000..1dbe9375 --- /dev/null +++ b/cdist/conf/type/__consul_agent/files/consul.sys-openrc @@ -0,0 +1,38 @@ +#!/sbin/openrc-run +# 2019 Nico Schottelius (nico-cdist at schottelius.org) + +description="consul agent" + +pidfile="${CONSUL_PIDFILE:-"/var/run/$RC_SVCNAME/pidfile"}" +command="${CONSUL_BINARY:-"/usr/local/bin/consul"}" + + +checkconfig() { + if [ ! -d /var/run/consul ] ; then + mkdir -p /var/run/consul || return 1 + chown consul:consul /var/run/$NAME || return 1 + chmod 2770 /var/run/$NAME || return 1 + fi +} + +start() { + need net + + start-stop-daemon --start --quiet --oknodo \ + --pidfile "$pidfile" --background \ + --exec $command -- agent -pid-file="$pidfile" -config-dir /etc/consul/conf.d +} +start_pre() { + checkconfig +} + +stop() { + if [ "${RC_CMD}" = "restart" ] ; then + checkconfig || return 1 + fi + + ebegin "Stopping $RC_SVCNAME" + start-stop-daemon --stop --exec "$command" \ + --pidfile "$pidfile" --quiet + eend $? +} diff --git a/cdist/conf/type/__consul_agent/manifest b/cdist/conf/type/__consul_agent/manifest index c48bfe85..a88d26ed 100755 --- a/cdist/conf/type/__consul_agent/manifest +++ b/cdist/conf/type/__consul_agent/manifest @@ -1,7 +1,7 @@ #!/bin/sh -e # # 2015 Steven Armstrong (steven-cdist at armstrong.cc) -# 2015 Nico Schottelius (nico-cdist at schottelius.org) +# 2015-2019 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -23,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - scientific|centos|debian|devuan|redhat|ubuntu) + alpine|scientific|centos|debian|devuan|redhat|ubuntu) # whitelist safeguard : ;; @@ -181,22 +181,25 @@ init_upstart() # Install init script to start on boot case "$os" in - centos|redhat) - os_version="$(sed 's/[^0-9.]//g' "$__global/explorer/os_version")" - major_version="${os_version%%.*}" - case "$major_version" in - [456]) - init_sysvinit redhat - ;; - 7) - init_systemd - ;; - *) - echo "Unsupported CentOS/Redhat version: $os_version" >&2 - exit 1 - ;; - esac - ;; + alpine|devuan) + init_sysvinit debian + ;; + centos|redhat) + os_version="$(sed 's/[^0-9.]//g' "$__global/explorer/os_version")" + major_version="${os_version%%.*}" + case "$major_version" in + [456]) + init_sysvinit redhat + ;; + 7) + init_systemd + ;; + *) + echo "Unsupported CentOS/Redhat version: $os_version" >&2 + exit 1 + ;; + esac + ;; debian) os_version=$(cat "$__global/explorer/os_version") @@ -214,13 +217,9 @@ case "$os" in exit 1 ;; esac - ;; - - devuan) - init_sysvinit debian - ;; + ;; ubuntu) init_upstart - ;; + ;; esac diff --git a/docs/changelog b/docs/changelog index 515f7b69..b8071ffe 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,11 @@ Changelog --------- +next: + * Type __consul: Add alpine support (Nico Schottelius) + * Type __consul: Add version 1.5.0 (Nico Schottelius) + * Type __consul_agent: Add alpine support (Nico Schottelius) + 5.0.2: 2019-05-17 * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) * Type __postfix: Add alpine support (Nico Schottelius) From 03f8c3aaed3d106792a05e9e24e14b86f7e0414c Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Sun, 19 May 2019 23:22:02 +0300 Subject: [PATCH 050/383] __acl: don't exit on missing file when dry run --- cdist/conf/type/__acl/gencode-remote | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index d47469c1..36eca3f8 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -20,8 +20,7 @@ file_is="$( cat "$__object/explorer/file_is" )" -# TODO this check is not needed with dry-run -[ "$file_is" = 'missing' ] && exit 0 +[ "$file_is" = 'missing' ] && [ -z "$__cdist_dry_run" ] && exit 0 os="$( cat "$__global/explorer/os" )" From 02e10b1ffd1d1fa28586caf234f5e007dfe7e606 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Sun, 19 May 2019 23:27:58 +0300 Subject: [PATCH 051/383] __acl: fix SC1117 --- cdist/conf/type/__acl/gencode-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index 36eca3f8..f5b0474f 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -48,7 +48,7 @@ do then [ "$file_is" = 'directory' ] && rep=x || rep=- - acl="$( echo "$acl" | sed "s/\(.*\)X/\1$rep/" )" + acl="$( echo "$acl" | sed "s/\\(.*\\)X/\\1$rep/" )" fi echo "$parameter" | grep -Eq '(mask|other)' && sep=:: || sep=: From e30d76014accf5e1f0860f504c287c5ed025da9c Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Sun, 19 May 2019 23:44:20 +0300 Subject: [PATCH 052/383] __acl: update man --- cdist/conf/type/__acl/man.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cdist/conf/type/__acl/man.rst b/cdist/conf/type/__acl/man.rst index e6784c87..d066aae5 100644 --- a/cdist/conf/type/__acl/man.rst +++ b/cdist/conf/type/__acl/man.rst @@ -10,9 +10,7 @@ DESCRIPTION ----------- ACL must be defined as 3-symbol combination, using ``r``, ``w``, ``x`` and ``-``. -Fully supported and tested on Linux, partial support for FreeBSD. - -OpenBSD, NetBSD and Solaris support is not possible. +Fully supported and tested on Linux (ext4 filesystem), partial support for FreeBSD. See ``setfacl`` and ``acl`` manpages for more details. From 34eec3c214b1fbd95246e9243196173b55aee41a Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 19 May 2019 13:40:24 +0200 Subject: [PATCH 053/383] Add cdist-new-type helper scrpt --- bin/build-helper | 2 +- docs/changelog | 1 + docs/src/cdist-troubleshooting.rst | 3 +- docs/src/cdist-type.rst | 3 + docs/src/index.rst | 1 + docs/src/man1/cdist-new-type.rst | 74 ++++++++++++++ scripts/cdist-new-type | 159 +++++++++++++++++++++++++++++ setup.py | 2 +- 8 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 docs/src/man1/cdist-new-type.rst create mode 100755 scripts/cdist-new-type diff --git a/bin/build-helper b/bin/build-helper index 1698a678..9a776491 100755 --- a/bin/build-helper +++ b/bin/build-helper @@ -451,7 +451,7 @@ eof ;; shellcheck-scripts) - ${SHELLCHECKCMD} scripts/cdist-dump || exit 0 + ${SHELLCHECKCMD} scripts/cdist-dump scripts/cdist-new-type || exit 0 ;; shellcheck-gencodes) diff --git a/docs/changelog b/docs/changelog index b8071ffe..acf462f2 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,6 +5,7 @@ next: * Type __consul: Add alpine support (Nico Schottelius) * Type __consul: Add version 1.5.0 (Nico Schottelius) * Type __consul_agent: Add alpine support (Nico Schottelius) + * New helper script: cdist-new-type (Steven Armstrong, Darko Poljak) 5.0.2: 2019-05-17 * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) diff --git a/docs/src/cdist-troubleshooting.rst b/docs/src/cdist-troubleshooting.rst index 6b7fb4af..e639aafd 100644 --- a/docs/src/cdist-troubleshooting.rst +++ b/docs/src/cdist-troubleshooting.rst @@ -47,7 +47,8 @@ you write to use the -e flag: Using debug dump helper script ------------------------------ Since cdist stores data to local cache that can be used for debugging there -is a helper script that dumps data from local cache. +is a helper script that dumps data from local cache, +`cdist-dump `_. For more info see: diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index 7e5e39ef..880df819 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -93,6 +93,9 @@ they are written in shell so they are executed using '/bin/sh -e' or 'CDIST_LOCA For executable shell code it is suggested that shebang is '#!/bin/sh -e'. +For creating type skeleton you can use helper script +`cdist-new-type `_. + Defining parameters ------------------- diff --git a/docs/src/index.rst b/docs/src/index.rst index 95e44d52..6cbd938a 100644 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -22,6 +22,7 @@ is being used in small up to enterprise grade environments. cdist-real-world man1/cdist man1/cdist-dump + man1/cdist-new-type cdist-bootstrap cdist-configuration cdist-manifest diff --git a/docs/src/man1/cdist-new-type.rst b/docs/src/man1/cdist-new-type.rst new file mode 100644 index 00000000..f1a8b992 --- /dev/null +++ b/docs/src/man1/cdist-new-type.rst @@ -0,0 +1,74 @@ +cdist-new-type(1) +================= + +NAME +---- +cdist-new-type - Create new type skeleton + + +SYNOPSIS +-------- + +:: + + cdist-new-type TYPE-NAME AUTHOR-NAME AUTHOR-EMAIL [TYPE-BASE-PATH] + + + +DESCRIPTION +----------- +cdist-new-type is a helper script that creates new type skeleton. +It is then up to the type author to finish the type. + +It creates skeletons for the following files: + +* man.rst +* manifest +* gencode-remote. + +Upon creation it prints the path to the newly created type directory. + + +ARGUMENTS +--------- +**TYPE-NAME** + Name of the new type. + +**AUTHOR-NAME** + Type author's full name. + +**AUTHOR-NAME** + Type author's email. + +**TYPE-BASE-PATH** + Path to the base directory of the type. If not set it defaults + to '$PWD/type'. + + +EXAMPLES +-------- + +.. code-block:: sh + + # Create new type __foo in ~/.cdist directory. + $ cd ~/.cdist + $ cdist-new-type '__foo' 'Foo Bar' 'foo.bar at foobar.org' + /home/foo/.cdist/type/__foo + + +SEE ALSO +-------- +:strong:`cdist`\ (1) + + +AUTHORS +------- + +| Steven Armstrong +| Darko Poljak + + +COPYING +------- +Copyright \(C) 2019 Steven Armstrong, Darko Poljak. Free use of this software is +granted under the terms of the GNU General Public License v3 or later (GPLv3+). diff --git a/scripts/cdist-new-type b/scripts/cdist-new-type new file mode 100755 index 00000000..79dcfd90 --- /dev/null +++ b/scripts/cdist-new-type @@ -0,0 +1,159 @@ +#!/bin/sh + +basename="${0##*/}" + +if [ $# -lt 3 ] +then + printf "usage: %s TYPE-NAME AUTHOR-NAME AUTHOR-EMAIL [TYPE-BASE-PATH] + TYPE-NAME Name of the type. + AUTHOR-NAME Type author's full name. + AUTHOR-EMAIL Type author's email. + TYPE-BASE-PATH Path to the base directory of the type. If not set it defaults + to '\$PWD/type'.\n" "${basename}" + exit 1 +fi + +type_name="$1" +shift +author_name="$1" +shift +author_email="$1" +shift + +if [ $# -ge 1 ] +then + type_base_path="$1" + shift +else + #type_base_path=~/.cdist/type + type_base_path="$PWD/type" +fi + +error() { + printf "%s\n" "$*" >&2 +} + +die() { + error "$@" + exit 1 +} + +cd "$type_base_path" || die "Could not change to type directory: $type_base_path. +You have to specify type base path or run me from within a cdist conf directory, +e.g. ~/.cdist." + +year=$(date +%Y) +copyright="# $year $author_name ($author_email)" + +license="# 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 . +# +" + +set -e + +mkdir "$type_name" +cd "$type_name" + +### man page +header="cdist-type${type_name}(7)" +header_length="${#header}" +cat >> man.rst << DONE +$header +$(while [ "${header_length}" -gt 0 ]; do printf "="; header_length=$((header_length - 1)); done; printf "\n";) + +NAME +---- +cdist-type${type_name} - TODO + + +DESCRIPTION +----------- +This space intentionally left blank. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +None. + + +BOOLEAN PARAMETERS +------------------ +None. + + +EXAMPLES +-------- + +.. code-block:: sh + + # TODO + ${type_name} + + +SEE ALSO +-------- +:strong:\`TODO\`\\ (7) + + +AUTHORS +------- +$author_name <$author_email> + + +COPYING +------- +Copyright \(C) $year $author_name. 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. +DONE + +### manifest +cat >> manifest << DONE +#!/bin/sh -e +# +${copyright} +# +${license} + +os=\$(cat "\$__global/explorer/os") + +case "\$os" in + *) + printf "Your operating system (%s) is currently not supported by this type (%s)\n" "\$os" "\${__type##*/}" >&2 + printf "Please contribute an implementation for it if you can.\n" >&2 + exit 1 + ;; +esac +DONE +chmod +x manifest + +# gencode-remote +cat >> gencode-remote << DONE +#!/bin/sh -e +# +${copyright} +# +${license} +DONE +chmod +x gencode-remote + +printf "%s/%s\n" "$type_base_path" "$type_name" diff --git a/setup.py b/setup.py index 5f14a2f4..ae651125 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name="cdist", packages=["cdist", "cdist.core", "cdist.exec", "cdist.util", ], package_data={'cdist': package_data}, - scripts=["scripts/cdist", "scripts/cdist-dump"], + scripts=["scripts/cdist", "scripts/cdist-dump", "scripts/cdist-new-type"], version=cdist.version.VERSION, description="A Usable Configuration Management System", author="Nico Schottelius", From 4949af894e917ac57fb5365c7ea482770bb1c3ba Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 20 May 2019 18:50:25 +0200 Subject: [PATCH 054/383] Add type deprecation support. --- cdist/config.py | 11 ++++++++ cdist/core/cdist_type.py | 11 ++++++++ cdist/test/cdist_type/__init__.py | 10 ++++++++ .../fixtures/__deprecated/deprecated | 0 docs/changelog | 1 + docs/src/cdist-type.rst | 25 +++++++++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 cdist/test/cdist_type/fixtures/__deprecated/deprecated diff --git a/cdist/config.py b/cdist/config.py index 30117382..1a0ab4d5 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -758,8 +758,19 @@ class Config(object): ("The requirements of the following objects could not be " "resolved:\n%s") % ("\n".join(info_string))) + def _handle_deprecation(self, cdist_object): + cdist_type = cdist_object.cdist_type + deprecated = cdist_type.deprecated + if deprecated is not None: + if deprecated: + self.log.warning("Type %s is deprecated: %s", cdist_type.name, + deprecated) + else: + self.log.warning("Type %s is deprecated.", cdist_type.name) + def object_prepare(self, cdist_object, transfer_type_explorers=True): """Prepare object: Run type explorer + manifest""" + self._handle_deprecation(cdist_object) self.log.verbose("Preparing object {}".format(cdist_object.name)) self.log.verbose( "Running manifest and explorers for " + cdist_object.name) diff --git a/cdist/core/cdist_type.py b/cdist/core/cdist_type.py index 99e40e70..7cabd72f 100644 --- a/cdist/core/cdist_type.py +++ b/cdist/core/cdist_type.py @@ -133,6 +133,17 @@ class CdistType(object): cannot run in parallel.""" return os.path.isfile(os.path.join(self.absolute_path, "nonparallel")) + @property + def deprecated(self): + """Get type deprecation message. If message is None then type + is not deprecated.""" + deprecated_path = os.path.join(self.absolute_path, "deprecated") + try: + with open(deprecated_path, 'r') as f: + return f.read() + except FileNotFoundError: + return None + @property def explorers(self): """Return a list of available explorers""" diff --git a/cdist/test/cdist_type/__init__.py b/cdist/test/cdist_type/__init__.py index ca961170..ac84d874 100644 --- a/cdist/test/cdist_type/__init__.py +++ b/cdist/test/cdist_type/__init__.py @@ -123,6 +123,16 @@ class TypeTestCase(test.CdistTestCase): cdist_type = core.CdistType(base_path, '__not_nonparallel') self.assertFalse(cdist_type.is_nonparallel) + def test_deprecated(self): + base_path = fixtures + cdist_type = core.CdistType(base_path, '__deprecated') + self.assertIsNotNone(cdist_type.deprecated) + + def test_not_deprecated(self): + base_path = fixtures + cdist_type = core.CdistType(base_path, '__not_deprecated') + self.assertIsNone(cdist_type.deprecated) + def test_install_is_install(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__install') diff --git a/cdist/test/cdist_type/fixtures/__deprecated/deprecated b/cdist/test/cdist_type/fixtures/__deprecated/deprecated new file mode 100644 index 00000000..e69de29b diff --git a/docs/changelog b/docs/changelog index acf462f2..ba092840 100644 --- a/docs/changelog +++ b/docs/changelog @@ -6,6 +6,7 @@ next: * Type __consul: Add version 1.5.0 (Nico Schottelius) * Type __consul_agent: Add alpine support (Nico Schottelius) * New helper script: cdist-new-type (Steven Armstrong, Darko Poljak) + * Core: Add support for deprecated type marker (Darko Poljak) 5.0.2: 2019-05-17 * Type __package_apk: Fix @repo handling in explorer (Nico Schottelius) diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index 880df819..dfad6fa0 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -71,6 +71,31 @@ when using -j option. Example of such a type is __package_dpkg type where dpkg i prevents to be run in more than one instance. +Deprecated types +----------------- +If a type is flagged with 'deprecated' marker then it is considered deprecated. +Upon it's usage cdist writes warning line. If 'deprecated' marker has content +then this content is printed as a deprecation messages, e.g.: + +.. code-block:: sh + + $ ls -l deprecated + -rw-r--r-- 1 darko darko 71 May 20 18:30 deprecated + $ cat deprecated + This type is deprecated. It will be removed in the next minor release. + $ echo '__foo foo' | ./bin/cdist config -i - 185.203.112.26 + WARNING: 185.203.112.26: Type __foo is deprecated: This type is deprecated. It will be removed in the next minor release. + +If 'deprecated' marker has no content then general message is printed, e.g.: + +.. code-block:: sh + + $ ls -l deprecated + -rw-r--r-- 1 darko darko 0 May 20 18:36 deprecated + $ echo '__bar foo' | ./bin/cdist config -i - 185.203.112.26 + WARNING: 185.203.112.26: Type __bar is deprecated. + + How to write a new type ----------------------- A type consists of From c58ae44409b7170ee44187eb3622612baf91ac51 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 22 May 2019 18:34:31 +0200 Subject: [PATCH 055/383] Release 5.1.0 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index ba092840..86ac6c9e 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.1.0: 2019-05-22 * Type __consul: Add alpine support (Nico Schottelius) * Type __consul: Add version 1.5.0 (Nico Schottelius) * Type __consul_agent: Add alpine support (Nico Schottelius) From 1d57305d359fd773a540adcec8116d785f51e9db Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Sat, 25 May 2019 15:58:39 +0200 Subject: [PATCH 056/383] Use gpg key, fallback to deprecated apt-key Fixes #762 --- cdist/conf/type/__apt_key/explorer/state | 18 ++++- cdist/conf/type/__apt_key/gencode-remote | 76 ++++++++++++++++++- cdist/conf/type/__apt_key/man.rst | 17 ++++- cdist/conf/type/__apt_key/manifest | 8 ++ .../type/__apt_key/parameter/default/keydir | 1 + cdist/conf/type/__apt_key/parameter/optional | 2 + 6 files changed, 114 insertions(+), 8 deletions(-) create mode 100755 cdist/conf/type/__apt_key/manifest create mode 100644 cdist/conf/type/__apt_key/parameter/default/keydir diff --git a/cdist/conf/type/__apt_key/explorer/state b/cdist/conf/type/__apt_key/explorer/state index f7940741..38f1bd3c 100755 --- a/cdist/conf/type/__apt_key/explorer/state +++ b/cdist/conf/type/__apt_key/explorer/state @@ -27,6 +27,18 @@ else keyid="$__object_id" fi -apt-key export "$keyid" | head -n 1 | grep -Fqe "BEGIN PGP PUBLIC KEY BLOCK" \ - && echo present \ - || echo absent +keydir="$(cat "$__object/parameter/keydir")" +keyfile="$keydir/$__object_id.gpg" + +if [ -d "$keydir" ] +then + if [ -f "$keyfile" ] + then echo present + else echo absent + fi +else + # fallback to deprecated apt-key + apt-key export "$keyid" | head -n 1 | grep -Fqe "BEGIN PGP PUBLIC KEY BLOCK" \ + && echo present \ + || echo absent +fi diff --git a/cdist/conf/type/__apt_key/gencode-remote b/cdist/conf/type/__apt_key/gencode-remote index 9c4fa00c..47c8bb49 100755 --- a/cdist/conf/type/__apt_key/gencode-remote +++ b/cdist/conf/type/__apt_key/gencode-remote @@ -31,12 +31,84 @@ if [ "$state_should" = "$state_is" ]; then exit 0 fi +keydir="$(cat "$__object/parameter/keydir")" +keyfile="$keydir/$__object_id.gpg" + case "$state_should" in present) keyserver="$(cat "$__object/parameter/keyserver")" - echo "apt-key adv --keyserver \"$keyserver\" --recv-keys \"$keyid\"" + + if [ -f "$__object/parameter/uri" ]; then + uri="$(cat "$__object/parameter/uri")" + + if [ -d "$keydir" ]; then + cat << EOF + +curl -s -L \\ + -o "$keyfile" \\ + "$uri" + +if grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK' \\ + "$keyfile" +then + cat "$keyfile" \\ + | gpg --export > "$keyfile" +fi + +EOF + else + # fallback to deprecated apt-key + echo "curl -s -L '$uri' | apt-key add -" + fi + elif [ -d "$keydir" ]; then + tmp='/tmp/cdist_apt_key_tmp' + + # we need to kill gpg after 30 seconds, because gpg + # can get stuck if keyserver is not responding. + # exporting env var and not exit 1, + # because we need to clean up and kill dirmngr. + cat << EOF + +mkdir -m 700 -p "$tmp" + +if timeout 30s \\ + gpg --homedir "$tmp" \\ + --keyserver "$keyserver" \\ + --recv-keys "$keyid" +then + gpg --homedir "$tmp" \\ + --export "$keyid" \\ + > "$keyfile" +else + export GPG_GOT_STUCK=1 +fi + +GNUPGHOME="$tmp" gpgconf --kill dirmngr + +rm -rf "$tmp" + +if [ -n "\$GPG_GOT_STUCK" ] +then + echo "GPG GOT STUCK - no response from keyserver after 30 seconds" >&2 + exit 1 +fi + +EOF + else + # fallback to deprecated apt-key + echo "apt-key adv --keyserver \"$keyserver\" --recv-keys \"$keyid\"" + fi + + echo "added '$keyid'" >> "$__messages_out" ;; absent) - echo "apt-key del \"$keyid\"" + if [ -f "$keyfile" ]; then + echo "rm '$keyfile'" + else + # fallback to deprecated apt-key + echo "apt-key del \"$keyid\"" + fi + + echo "removed '$keyid'" >> "$__messages_out" ;; esac diff --git a/cdist/conf/type/__apt_key/man.rst b/cdist/conf/type/__apt_key/man.rst index 9009877e..234bc715 100644 --- a/cdist/conf/type/__apt_key/man.rst +++ b/cdist/conf/type/__apt_key/man.rst @@ -28,6 +28,12 @@ keyserver the keyserver from which to fetch the key. If omitted the default set in ./parameter/default/keyserver is used. +keydir + key save location, defaults to ``/etc/apt/trusted.pgp.d`` + +uri + the URI from which to download the key + EXAMPLES -------- @@ -47,15 +53,20 @@ EXAMPLES # same thing with other keyserver __apt_key UbuntuArchiveKey --keyid 437D05B5 --keyserver keyserver.ubuntu.com + # download key from the internet + __apt_key rabbitmq \ + --uri http://www.rabbitmq.com/rabbitmq-signing-key-public.asc + AUTHORS ------- Steven Armstrong +Ander Punnar COPYING ------- -Copyright \(C) 2011-2014 Steven Armstrong. 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 +Copyright \(C) 2011-2019 Steven Armstrong and Ander Punnar. 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. diff --git a/cdist/conf/type/__apt_key/manifest b/cdist/conf/type/__apt_key/manifest new file mode 100755 index 00000000..010357cd --- /dev/null +++ b/cdist/conf/type/__apt_key/manifest @@ -0,0 +1,8 @@ +#!/bin/sh -e + +__package gnupg + +if [ -f "$__object/parameter/uri" ] +then __package curl +else __package dirmngr +fi diff --git a/cdist/conf/type/__apt_key/parameter/default/keydir b/cdist/conf/type/__apt_key/parameter/default/keydir new file mode 100644 index 00000000..190eb2de --- /dev/null +++ b/cdist/conf/type/__apt_key/parameter/default/keydir @@ -0,0 +1 @@ +/etc/apt/trusted.gpg.d diff --git a/cdist/conf/type/__apt_key/parameter/optional b/cdist/conf/type/__apt_key/parameter/optional index 18cf2586..de647375 100644 --- a/cdist/conf/type/__apt_key/parameter/optional +++ b/cdist/conf/type/__apt_key/parameter/optional @@ -1,3 +1,5 @@ state keyid keyserver +keydir +uri From 520cfeda989fbcaf12706a3540a9267ad23afdee Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 25 May 2019 16:10:18 +0200 Subject: [PATCH 057/383] ++ --- docs/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog b/docs/changelog index 86ac6c9e..66140bb1 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,10 @@ Changelog --------- +next: + * Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar) + * Type __acl: Fix and improve (Ander Punnar) + 5.1.0: 2019-05-22 * Type __consul: Add alpine support (Nico Schottelius) * Type __consul: Add version 1.5.0 (Nico Schottelius) From 68837e45cc768fed8a891d22c60cde4ecb3ed62b Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 25 May 2019 19:19:47 +0200 Subject: [PATCH 058/383] Document type stdin inside loop caveats --- docs/changelog | 1 + docs/src/cdist-type.rst | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/docs/changelog b/docs/changelog index 66140bb1..1cded1f9 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,7 @@ Changelog next: * Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar) * Type __acl: Fix and improve (Ander Punnar) + * Documentation: Document type stdin inside loop caveats (Darko Poljak) 5.1.0: 2019-05-22 * Type __consul: Add alpine support (Nico Schottelius) diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index dfad6fa0..6cf83258 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -216,6 +216,73 @@ In the __file type, stdin is used as source for the file, if - is used for sourc .... +Stdin inside a loop +~~~~~~~~~~~~~~~~~~~ +Since cdist saves type's stdin content in the object as **$__object/stdin**, +so it can be accessed in manifest and gencode-* scripts, this can lead to +unexpected behavior. For example, suppose you have some type with the following +in its manifest: + +.. code-block:: sh + + if [ -f "$__object/parameter/foo" ] + then + while read -r l + do + __file "$l" + echo "$l" >&2 + done < "$__object/parameter/foo" + fi + +and init manifest: + +.. code-block:: sh + + __foo foo --foo a --foo b --foo c + +You expect that manifest stderr content is: + +.. code-block:: sh + + a + b + c + +and that files *a*, *b* and *c* are created. But all you get in manifest stderr +is: + +.. code-block:: sh + + a + +and only *a* file is created. + +When redirecting parameter *foo* file content to while's stdin that means that all +commands in while body have this same stdin. So when *__file* type gets executed, +cdist saves its stdin which means it gets the remaining content of parameter *foo* +file, i.e.: + +.. code-block:: sh + + b + c + +The solution is to make sure that your types inside such loops get their stdin +from somewhere else, e.g. for the above problem *__file* type can get empty +stdin from */dev/null*: + +.. code-block:: sh + + if [ -f "$__object/parameter/foo" ] + then + while read -r l + do + __file "$l" < /dev/null + echo "$l" >&2 + done < "$__object/parameter/foo" + fi + + Writing the manifest -------------------- In the manifest of a type you can use other types, so your type extends From 8315677ad1fc6dff6e10cb78754cbb5748340811 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 28 May 2019 17:53:34 +0200 Subject: [PATCH 059/383] Release 5.1.1 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 1cded1f9..2f20fd84 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.1.1: 2019-05-28 * Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar) * Type __acl: Fix and improve (Ander Punnar) * Documentation: Document type stdin inside loop caveats (Darko Poljak) From 55ba49efacc962d3233e28483b4237059356f887 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 19 Jun 2019 18:19:32 +0200 Subject: [PATCH 060/383] Add support for deprecated type parameters --- cdist/config.py | 5 ++++ cdist/core/cdist_type.py | 21 ++++++++++++++++ cdist/test/cdist_type/__init__.py | 12 ++++++++++ .../__with_deprecated_parameters/deprecated | 0 .../parameter/deprecated | 2 ++ .../parameter/optional | 4 ++++ docs/src/cdist-type.rst | 24 ++++++++++++++++++- 7 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 cdist/test/cdist_type/fixtures/__with_deprecated_parameters/deprecated create mode 100644 cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated create mode 100644 cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional diff --git a/cdist/config.py b/cdist/config.py index 1a0ab4d5..6622823b 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -767,6 +767,11 @@ class Config(object): deprecated) else: self.log.warning("Type %s is deprecated.", cdist_type.name) + for param in cdist_object.parameters: + if param in cdist_type.deprecated_parameters: + self.log.warning(("%s parameter of type %s is deprecated, " + "see man page for details"), + param, cdist_type.name) def object_prepare(self, cdist_object, transfer_type_explorers=True): """Prepare object: Run type explorer + manifest""" diff --git a/cdist/core/cdist_type.py b/cdist/core/cdist_type.py index 7cabd72f..48926a03 100644 --- a/cdist/core/cdist_type.py +++ b/cdist/core/cdist_type.py @@ -69,6 +69,7 @@ class CdistType(object): self.__optional_multiple_parameters = None self.__boolean_parameters = None self.__parameter_defaults = None + self.__deprecated_parameters = None def __hash__(self): return hash(self.name) @@ -275,3 +276,23 @@ class CdistType(object): finally: self.__parameter_defaults = defaults return self.__parameter_defaults + + @property + def deprecated_parameters(self): + """Return a list of deprecated parameters""" + if not self.__deprecated_parameters: + parameters = [] + try: + with open(os.path.join(self.absolute_path, + "parameter", + "deprecated")) as fd: + for line in fd: + line = line.strip() + if line: + parameters.append(line) + except EnvironmentError: + # error ignored + pass + finally: + self.__deprecated_parameters = parameters + return self.__deprecated_parameters diff --git a/cdist/test/cdist_type/__init__.py b/cdist/test/cdist_type/__init__.py index ac84d874..9eee395c 100644 --- a/cdist/test/cdist_type/__init__.py +++ b/cdist/test/cdist_type/__init__.py @@ -200,3 +200,15 @@ class TypeTestCase(test.CdistTestCase): self.assertEqual( list(sorted(cdist_type.parameter_defaults.keys())), ['bar', 'foo']) + + def test_without_deprecated_parameters(self): + base_path = fixtures + cdist_type = core.CdistType(base_path, + '__without_deprecated_parameters') + self.assertEqual(cdist_type.deprecated_parameters, []) + + def test_with_deprecated_parameters(self): + base_path = fixtures + cdist_type = core.CdistType(base_path, '__with_deprecated_parameters') + self.assertEqual(cdist_type.deprecated_parameters, + ['eggs', 'spam']) diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/deprecated b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/deprecated new file mode 100644 index 00000000..e69de29b diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated new file mode 100644 index 00000000..81830edb --- /dev/null +++ b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated @@ -0,0 +1,2 @@ +eggs +spam diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional new file mode 100644 index 00000000..7c804d5f --- /dev/null +++ b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional @@ -0,0 +1,4 @@ +spam +eggs +sausage +spam diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index 6cf83258..623ba481 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -74,7 +74,7 @@ prevents to be run in more than one instance. Deprecated types ----------------- If a type is flagged with 'deprecated' marker then it is considered deprecated. -Upon it's usage cdist writes warning line. If 'deprecated' marker has content +When it is used cdist writes warning line. If 'deprecated' marker has content then this content is printed as a deprecation messages, e.g.: .. code-block:: sh @@ -186,6 +186,28 @@ Example: (e.g. in cdist/conf/type/__nginx_vhost/manifest) fi +Deprecated parameters +--------------------- +To deprecate type parameters one can declare a newline separated file +**parameter/deprecated** where each line contains deprecated parameter. +When it is used cdist writes warning line, e.g.: + +.. code-block:: sh + + $ cat parameter/optional_multiple + foo + spam + eggs + $ cat parameter/deprecated + spam + eggs + $ echo '__foo foo --foo foo --spam spam' | ./bin/cdist config -i - 185.203.112.26 + WARNING: 185.203.112.26: spam parameter of type __foo is deprecated, see man page for details + $ echo '__foo foo --foo foo --eggs eggs --spam spam' | ./bin/cdist config -i - 185.203.112.26 + WARNING: 185.203.112.26: spam parameter of type __foo is deprecated, see man page for details + WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated, see man page for details + + Input from stdin ---------------- Every type can access what has been written on stdin when it has been called. From 3cb4e76175c06370cc7b69a326c9ae1c6c0b0c37 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 19 Jun 2019 18:19:32 +0200 Subject: [PATCH 061/383] Allow custom message for each deprecated parameter --- cdist/config.py | 11 +++++-- cdist/core/cdist_type.py | 24 +++++++------- cdist/test/cdist_type/__init__.py | 9 ++++-- .../parameter/deprecated | 2 -- .../parameter/deprecated/eggs | 1 + .../{deprecated => parameter/deprecated/spam} | 0 .../parameter/optional | 1 - docs/src/cdist-type.rst | 31 ++++++++++--------- 8 files changed, 44 insertions(+), 35 deletions(-) delete mode 100644 cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated create mode 100644 cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/eggs rename cdist/test/cdist_type/fixtures/__with_deprecated_parameters/{deprecated => parameter/deprecated/spam} (100%) diff --git a/cdist/config.py b/cdist/config.py index 6622823b..26d07fc4 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -769,9 +769,14 @@ class Config(object): self.log.warning("Type %s is deprecated.", cdist_type.name) for param in cdist_object.parameters: if param in cdist_type.deprecated_parameters: - self.log.warning(("%s parameter of type %s is deprecated, " - "see man page for details"), - param, cdist_type.name) + msg = cdist_type.deprecated_parameters[param] + if msg: + format = "%s parameter of type %s is deprecated: %s" + args = [param, cdist_type.name, msg] + else: + format = "%s parameter of type %s is deprecated." + args = [param, cdist_type.name] + self.log.warning(format, *args) def object_prepare(self, cdist_object, transfer_type_explorers=True): """Prepare object: Run type explorer + manifest""" diff --git a/cdist/core/cdist_type.py b/cdist/core/cdist_type.py index 48926a03..4500f50d 100644 --- a/cdist/core/cdist_type.py +++ b/cdist/core/cdist_type.py @@ -279,20 +279,20 @@ class CdistType(object): @property def deprecated_parameters(self): - """Return a list of deprecated parameters""" if not self.__deprecated_parameters: - parameters = [] + deprecated = {} try: - with open(os.path.join(self.absolute_path, - "parameter", - "deprecated")) as fd: - for line in fd: - line = line.strip() - if line: - parameters.append(line) + deprecated_dir = os.path.join(self.absolute_path, + "parameter", + "deprecated") + for name in cdist.core.listdir(deprecated_dir): + try: + with open(os.path.join(deprecated_dir, name)) as fd: + deprecated[name] = fd.read().strip() + except EnvironmentError: + pass # Swallow errors raised by open() or read() except EnvironmentError: - # error ignored - pass + pass # Swallow error raised by os.listdir() finally: - self.__deprecated_parameters = parameters + self.__deprecated_parameters = deprecated return self.__deprecated_parameters diff --git a/cdist/test/cdist_type/__init__.py b/cdist/test/cdist_type/__init__.py index 9eee395c..a51a1e6f 100644 --- a/cdist/test/cdist_type/__init__.py +++ b/cdist/test/cdist_type/__init__.py @@ -205,10 +205,13 @@ class TypeTestCase(test.CdistTestCase): base_path = fixtures cdist_type = core.CdistType(base_path, '__without_deprecated_parameters') - self.assertEqual(cdist_type.deprecated_parameters, []) + self.assertEqual(cdist_type.deprecated_parameters, {}) def test_with_deprecated_parameters(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__with_deprecated_parameters') - self.assertEqual(cdist_type.deprecated_parameters, - ['eggs', 'spam']) + self.assertTrue('eggs' in cdist_type.deprecated_parameters) + self.assertTrue('spam' in cdist_type.deprecated_parameters) + self.assertEqual(cdist_type.deprecated_parameters['eggs'], + 'Deprecated') + self.assertEqual(cdist_type.deprecated_parameters['spam'], '') diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated deleted file mode 100644 index 81830edb..00000000 --- a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated +++ /dev/null @@ -1,2 +0,0 @@ -eggs -spam diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/eggs b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/eggs new file mode 100644 index 00000000..69d9f456 --- /dev/null +++ b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/eggs @@ -0,0 +1 @@ +Deprecated diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/deprecated b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/spam similarity index 100% rename from cdist/test/cdist_type/fixtures/__with_deprecated_parameters/deprecated rename to cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/deprecated/spam diff --git a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional index 7c804d5f..bfe09199 100644 --- a/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional +++ b/cdist/test/cdist_type/fixtures/__with_deprecated_parameters/parameter/optional @@ -1,4 +1,3 @@ spam eggs sausage -spam diff --git a/docs/src/cdist-type.rst b/docs/src/cdist-type.rst index 623ba481..582c0938 100644 --- a/docs/src/cdist-type.rst +++ b/docs/src/cdist-type.rst @@ -188,24 +188,27 @@ Example: (e.g. in cdist/conf/type/__nginx_vhost/manifest) Deprecated parameters --------------------- -To deprecate type parameters one can declare a newline separated file -**parameter/deprecated** where each line contains deprecated parameter. -When it is used cdist writes warning line, e.g.: +To deprecate type parameters one can declare a file for each deprecated +parameter under **parameter/deprecated** directory. + +When such parameter is used cdist writes warning line with deprecation message. +If such file has content then this content is printed as deprecation message. +If there is no content then generic parameter deprecation message is printed. + +Example: .. code-block:: sh - $ cat parameter/optional_multiple - foo - spam - eggs - $ cat parameter/deprecated - spam - eggs - $ echo '__foo foo --foo foo --spam spam' | ./bin/cdist config -i - 185.203.112.26 - WARNING: 185.203.112.26: spam parameter of type __foo is deprecated, see man page for details + $ ls parameter/deprecated/ + eggs spam + $ cat parameter/deprecated/eggs + eggs parameter is deprecated, please use multiple egg parameter. + $ cat parameter/deprecated/spam + $ echo '__foo foo --foo foo --eggs eggs' | ./bin/cdist config -i - 185.203.112.26 + WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated: eggs parameter is deprecated, please use multiple egg parameter. $ echo '__foo foo --foo foo --eggs eggs --spam spam' | ./bin/cdist config -i - 185.203.112.26 - WARNING: 185.203.112.26: spam parameter of type __foo is deprecated, see man page for details - WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated, see man page for details + WARNING: 185.203.112.26: spam parameter of type __foo is deprecated. + WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated: eggs parameter is deprecated, please use multiple egg parameter. Input from stdin From d723f60673c35b91017319a6699c53e3d0f38425 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 20 Jun 2019 18:12:50 +0200 Subject: [PATCH 062/383] ++changelog --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index 2f20fd84..a79b116d 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Core: Add support for type parameters deprecation (Darko Poljak) + 5.1.1: 2019-05-28 * Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar) * Type __acl: Fix and improve (Ander Punnar) From 91a6ecc70173638aae928ddadabd93d9d46f097e Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Thu, 30 May 2019 23:04:46 +0300 Subject: [PATCH 063/383] __acl: rewrite --- cdist/conf/type/__acl/explorer/checks | 32 ++++------ cdist/conf/type/__acl/gencode-remote | 54 ++++++++--------- cdist/conf/type/__acl/man.rst | 59 ++++++++++--------- cdist/conf/type/__acl/parameter/optional | 2 - .../type/__acl/parameter/optional_multiple | 2 - .../type/__acl/parameter/required_multiple | 1 + 6 files changed, 66 insertions(+), 84 deletions(-) delete mode 100644 cdist/conf/type/__acl/parameter/optional delete mode 100644 cdist/conf/type/__acl/parameter/optional_multiple create mode 100644 cdist/conf/type/__acl/parameter/required_multiple diff --git a/cdist/conf/type/__acl/explorer/checks b/cdist/conf/type/__acl/explorer/checks index a2fcf44d..5b379a08 100755 --- a/cdist/conf/type/__acl/explorer/checks +++ b/cdist/conf/type/__acl/explorer/checks @@ -20,29 +20,17 @@ # TODO check if filesystem has ACL turned on etc -for parameter in user group +grep -E '^(default:)?(user|group):' "$__object/parameter/acl" \ +| while read -r acl do - if [ ! -f "$__object/parameter/$parameter" ] + param="$( echo "$acl" | awk -F: '{print $(NF-2)}' )" + check="$( echo "$acl" | awk -F: '{print $(NF-1)}' )" + + [ "$param" = 'user' ] && db=passwd || db="$param" + + if ! getent "$db" "$check" > /dev/null then - continue + echo "missing $param '$check'" >&2 + exit 1 fi - - while read -r acl - do - check="$( echo "$acl" | awk -F: '{print $1}' )" - - if [ "$parameter" = 'user' ] - then - getent_db=passwd - else - getent_db="$parameter" - fi - - if ! getent "$getent_db" "$check" > /dev/null - then - echo "missing $parameter '$check'" >&2 - exit 1 - fi - done \ - < "$__object/parameter/$parameter" done diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index f5b0474f..3c7085f0 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -24,41 +24,35 @@ file_is="$( cat "$__object/explorer/file_is" )" os="$( cat "$__global/explorer/os" )" -acl_is="$( cat "$__object/explorer/acl_is" )" - acl_path="/$__object_id" -if [ -f "$__object/parameter/default" ] && [ "$file_is" = 'directory' ] +acl_is="$( cat "$__object/explorer/acl_is" )" + +acl_should="$( cat "$__object/parameter/acl" )" + +if [ -f "$__object/parameter/default" ] then - set_default=1 -else - set_default=0 + acl_should="$( echo "$acl_should" \ + | sed 's/^default://' \ + | sort -u \ + | sed 's/\(.*\)/default:\1\n\1/' )" fi -acl_should="$( for parameter in user group mask other -do - if [ ! -f "$__object/parameter/$parameter" ] - then - continue - fi +if [ "$file_is" = 'regular' ] \ + && echo "$acl_should" | grep -Eq '^default:' +then + # only directories can have default ACLs, + # but instead of error, + # let's just remove default entries + acl_should="$( echo "$acl_should" | grep -Ev '^default:' )" +fi - while read -r acl - do - if echo "$acl" | awk -F: '{ print $NF }' | grep -Fq 'X' - then - [ "$file_is" = 'directory' ] && rep=x || rep=- +if echo "$acl_should" | awk -F: '{ print $NF }' | grep -Fq 'X' +then + [ "$file_is" = 'directory' ] && rep=x || rep=- - acl="$( echo "$acl" | sed "s/\\(.*\\)X/\\1$rep/" )" - fi - - echo "$parameter" | grep -Eq '(mask|other)' && sep=:: || sep=: - - echo "$parameter$sep$acl" - - [ "$set_default" = '1' ] && echo "default:$parameter$sep$acl" - done \ - < "$__object/parameter/$parameter" -done )" + acl_should="$( echo "$acl_should" | sed "s/\\(.*\\)X/\\1$rep/" )" +fi setfacl_exec='setfacl' @@ -76,7 +70,7 @@ if [ -f "$__object/parameter/remove" ] then echo "$acl_is" | while read -r acl do - # Skip wanted ACL entries which already exist + # skip wanted ACL entries which already exist # and skip mask and other entries, because we # can't actually remove them, but only change. if echo "$acl_should" | grep -Eq "^$acl" \ @@ -103,7 +97,7 @@ do if echo "$os" | grep -Fq 'freebsd' \ && echo "$acl" | grep -Eq '^default:' then - echo "setting default ACL in $os is currently not supported. sorry :(" >&2 + echo "setting default ACL in $os is currently not supported" >&2 else echo "$setfacl_exec -m \"$acl\" \"$acl_path\"" echo "added '$acl'" >> "$__messages_out" diff --git a/cdist/conf/type/__acl/man.rst b/cdist/conf/type/__acl/man.rst index d066aae5..a71e0d3c 100644 --- a/cdist/conf/type/__acl/man.rst +++ b/cdist/conf/type/__acl/man.rst @@ -8,42 +8,30 @@ cdist-type__acl - Set ACL entries DESCRIPTION ----------- -ACL must be defined as 3-symbol combination, using ``r``, ``w``, ``x`` and ``-``. - Fully supported and tested on Linux (ext4 filesystem), partial support for FreeBSD. See ``setfacl`` and ``acl`` manpages for more details. -OPTIONAL MULTIPLE PARAMETERS +REQUIRED MULTIPLE PARAMETERS ---------------------------- -user - Add user ACL entry. - -group - Add group ACL entry. - - -OPTIONAL PARAMETERS -------------------- -mask - Add mask ACL entry. - -other - Add other ACL entry. +acl + Set ACL entry following ``getfacl`` output syntax. BOOLEAN PARAMETERS ------------------ +default + Set all ACL entries as default too. + Only directories can have default ACLs. + Setting default ACL in FreeBSD is currently not supported. + recursive Make ``setfacl`` recursive (Linux only), but not ``getfacl`` in explorer. -default - Add default ACL entries (FreeBSD not supported). - remove - Remove undefined ACL entries (Solaris not supported). - ACL entries for ``mask`` and ``other`` can't be removed. + Remove undefined ACL entries. + ``mask`` and ``other`` entries can't be removed, but only changed. EXAMPLES @@ -52,15 +40,30 @@ EXAMPLES .. code-block:: sh __acl /srv/project \ + --default \ --recursive \ + --remove \ + --acl user:alice:rwx \ + --acl user:bob:r-x \ + --acl group:project-group:rwx \ + --acl group:some-other-group:r-x \ + --acl mask::r-x \ + --acl other::r-x + + # give Alice read-only access to subdir, + # but don't allow her to see parent content. + + __acl /srv/project2 \ + --remove \ + --acl default:group:secret-project:rwx \ + --acl group:secret-project:rwx \ + --acl user:alice:--x + + __acl /srv/project2/subdir \ --default \ --remove \ - --user alice:rwx \ - --user bob:r-x \ - --group project-group:rwx \ - --group some-other-group:r-x \ - --mask r-x \ - --other r-x + --acl group:secret-project:rwx \ + --acl user:alice:r-x AUTHORS diff --git a/cdist/conf/type/__acl/parameter/optional b/cdist/conf/type/__acl/parameter/optional deleted file mode 100644 index 4b32086b..00000000 --- a/cdist/conf/type/__acl/parameter/optional +++ /dev/null @@ -1,2 +0,0 @@ -mask -other diff --git a/cdist/conf/type/__acl/parameter/optional_multiple b/cdist/conf/type/__acl/parameter/optional_multiple deleted file mode 100644 index 22f5a52c..00000000 --- a/cdist/conf/type/__acl/parameter/optional_multiple +++ /dev/null @@ -1,2 +0,0 @@ -user -group diff --git a/cdist/conf/type/__acl/parameter/required_multiple b/cdist/conf/type/__acl/parameter/required_multiple new file mode 100644 index 00000000..39fead3b --- /dev/null +++ b/cdist/conf/type/__acl/parameter/required_multiple @@ -0,0 +1 @@ +acl From a5df0badaf1d38bc0f47e3e30bfd9f2e683677d1 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Sun, 16 Jun 2019 15:18:39 +0300 Subject: [PATCH 064/383] __acl: add compatibility for deprecated parameters --- cdist/conf/type/__acl/explorer/checks | 27 ++++++++++--------- cdist/conf/type/__acl/gencode-remote | 22 ++++++++++++++- cdist/conf/type/__acl/man.rst | 6 +++++ cdist/conf/type/__acl/parameter/optional | 2 ++ .../type/__acl/parameter/optional_multiple | 3 +++ .../type/__acl/parameter/required_multiple | 1 - 6 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 cdist/conf/type/__acl/parameter/optional create mode 100644 cdist/conf/type/__acl/parameter/optional_multiple delete mode 100644 cdist/conf/type/__acl/parameter/required_multiple diff --git a/cdist/conf/type/__acl/explorer/checks b/cdist/conf/type/__acl/explorer/checks index 5b379a08..70bb0412 100755 --- a/cdist/conf/type/__acl/explorer/checks +++ b/cdist/conf/type/__acl/explorer/checks @@ -20,17 +20,20 @@ # TODO check if filesystem has ACL turned on etc -grep -E '^(default:)?(user|group):' "$__object/parameter/acl" \ -| while read -r acl -do - param="$( echo "$acl" | awk -F: '{print $(NF-2)}' )" - check="$( echo "$acl" | awk -F: '{print $(NF-1)}' )" +if [ -f "$__object/parameter/acl" ] +then + grep -E '^(default:)?(user|group):' "$__object/parameter/acl" \ + | while read -r acl + do + param="$( echo "$acl" | awk -F: '{print $(NF-2)}' )" + check="$( echo "$acl" | awk -F: '{print $(NF-1)}' )" - [ "$param" = 'user' ] && db=passwd || db="$param" + [ "$param" = 'user' ] && db=passwd || db="$param" - if ! getent "$db" "$check" > /dev/null - then - echo "missing $param '$check'" >&2 - exit 1 - fi -done + if ! getent "$db" "$check" > /dev/null + then + echo "missing $param '$check'" >&2 + exit 1 + fi + done +fi diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index 3c7085f0..6dab4d09 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -28,7 +28,27 @@ acl_path="/$__object_id" acl_is="$( cat "$__object/explorer/acl_is" )" -acl_should="$( cat "$__object/parameter/acl" )" +if [ -f "$__object/parameter/acl" ] +then + acl_should="$( cat "$__object/parameter/acl" )" +elif + [ -f "$__object/parameter/user" ] \ + || [ -f "$__object/parameter/group" ] \ + || [ -f "$__object/parameter/mask" ] \ + || [ -f "$__object/parameter/other" ] +then + acl_should="$( for param in user group mask other + do + [ ! -f "$__object/parameter/$param" ] && continue + + echo "$param" | grep -Eq 'mask|other' && sep=:: || sep=: + + echo "$param$sep$( cat "$__object/parameter/$param" )" + done )" +else + echo 'no parameters set' >&2 + exit 1 +fi if [ -f "$__object/parameter/default" ] then diff --git a/cdist/conf/type/__acl/man.rst b/cdist/conf/type/__acl/man.rst index a71e0d3c..85e946ce 100644 --- a/cdist/conf/type/__acl/man.rst +++ b/cdist/conf/type/__acl/man.rst @@ -34,6 +34,12 @@ remove ``mask`` and ``other`` entries can't be removed, but only changed. +DEPRECATED PARAMETERS +--------------------- +Parameters ``user``, ``group``, ``mask`` and ``other`` are deprecated and they +will be removed in future versions. Please use ``acl`` parameter instead. + + EXAMPLES -------- diff --git a/cdist/conf/type/__acl/parameter/optional b/cdist/conf/type/__acl/parameter/optional new file mode 100644 index 00000000..4b32086b --- /dev/null +++ b/cdist/conf/type/__acl/parameter/optional @@ -0,0 +1,2 @@ +mask +other diff --git a/cdist/conf/type/__acl/parameter/optional_multiple b/cdist/conf/type/__acl/parameter/optional_multiple new file mode 100644 index 00000000..95c25d55 --- /dev/null +++ b/cdist/conf/type/__acl/parameter/optional_multiple @@ -0,0 +1,3 @@ +acl +user +group diff --git a/cdist/conf/type/__acl/parameter/required_multiple b/cdist/conf/type/__acl/parameter/required_multiple deleted file mode 100644 index 39fead3b..00000000 --- a/cdist/conf/type/__acl/parameter/required_multiple +++ /dev/null @@ -1 +0,0 @@ -acl From a4bc051ad9ecb538d5d239a03990b788acf81d88 Mon Sep 17 00:00:00 2001 From: Ander Punnar Date: Fri, 21 Jun 2019 13:02:44 +0300 Subject: [PATCH 065/383] __acl: use type deprecation --- cdist/conf/type/__acl/parameter/deprecated/group | 1 + cdist/conf/type/__acl/parameter/deprecated/mask | 1 + cdist/conf/type/__acl/parameter/deprecated/other | 1 + cdist/conf/type/__acl/parameter/deprecated/user | 1 + 4 files changed, 4 insertions(+) create mode 100644 cdist/conf/type/__acl/parameter/deprecated/group create mode 100644 cdist/conf/type/__acl/parameter/deprecated/mask create mode 100644 cdist/conf/type/__acl/parameter/deprecated/other create mode 100644 cdist/conf/type/__acl/parameter/deprecated/user diff --git a/cdist/conf/type/__acl/parameter/deprecated/group b/cdist/conf/type/__acl/parameter/deprecated/group new file mode 100644 index 00000000..94e14159 --- /dev/null +++ b/cdist/conf/type/__acl/parameter/deprecated/group @@ -0,0 +1 @@ +see manual for details diff --git a/cdist/conf/type/__acl/parameter/deprecated/mask b/cdist/conf/type/__acl/parameter/deprecated/mask new file mode 100644 index 00000000..94e14159 --- /dev/null +++ b/cdist/conf/type/__acl/parameter/deprecated/mask @@ -0,0 +1 @@ +see manual for details diff --git a/cdist/conf/type/__acl/parameter/deprecated/other b/cdist/conf/type/__acl/parameter/deprecated/other new file mode 100644 index 00000000..94e14159 --- /dev/null +++ b/cdist/conf/type/__acl/parameter/deprecated/other @@ -0,0 +1 @@ +see manual for details diff --git a/cdist/conf/type/__acl/parameter/deprecated/user b/cdist/conf/type/__acl/parameter/deprecated/user new file mode 100644 index 00000000..94e14159 --- /dev/null +++ b/cdist/conf/type/__acl/parameter/deprecated/user @@ -0,0 +1 @@ +see manual for details From 8881ff22246afb78e71a7b992fcb032eb4ce1e90 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 21 Jun 2019 12:55:33 +0200 Subject: [PATCH 066/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index a79b116d..2548b4ce 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,6 +3,7 @@ Changelog next: * Core: Add support for type parameters deprecation (Darko Poljak) + * Type __acl: Rewrite and improve (Ander Punnar) 5.1.1: 2019-05-28 * Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar) From 6915d300153e690e569f3f691d8bdec4952d91a6 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 21 Jun 2019 14:13:25 +0200 Subject: [PATCH 067/383] Release 5.1.2 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 2548b4ce..4952991b 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) * Type __acl: Rewrite and improve (Ander Punnar) From 5c11c15ae4f7962588f88a9fcdad5bc812d819d0 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 23 Jun 2019 19:55:37 +0200 Subject: [PATCH 068/383] Overcome bash CDPATH issue Thanks to Dmitry Bogatov. --- Makefile | 6 +++--- docs/changelog | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b739ab1f..fa3327d1 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ help: @echo "docs-clean clean documentation" @echo "clean clean" -DOCS_SRC_DIR=docs/src -SPEECHDIR=docs/speeches -TYPEDIR=cdist/conf/type +DOCS_SRC_DIR=./docs/src +SPEECHDIR=./docs/speeches +TYPEDIR=./cdist/conf/type SPHINXM=make -C $(DOCS_SRC_DIR) man SPHINXH=make -C $(DOCS_SRC_DIR) html diff --git a/docs/changelog b/docs/changelog index 4952991b..e4e312fd 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) + 5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) * Type __acl: Rewrite and improve (Ander Punnar) From 6bb58f882086f5f46c20355f768ee1095540f4d2 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Wed, 24 Jul 2019 13:32:39 +0200 Subject: [PATCH 069/383] Updated the __grafana_dashboard type for the new package repository - Changed the signing key uri - Changed the repo uri --- cdist/conf/type/__grafana_dashboard/manifest | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__grafana_dashboard/manifest b/cdist/conf/type/__grafana_dashboard/manifest index 9cd1465d..c1fe9416 100755 --- a/cdist/conf/type/__grafana_dashboard/manifest +++ b/cdist/conf/type/__grafana_dashboard/manifest @@ -21,10 +21,10 @@ case $os in __apt_key_uri grafana \ --name 'Grafana Release Signing Key' \ - --uri https://packagecloud.io/gpg.key + --uri https://packages.grafana.com/gpg.key require="$require __apt_key_uri/grafana" __apt_source grafana \ - --uri https://packagecloud.io/grafana/stable/debian/ \ + --uri https://packages.grafana.com/oss/deb \ --distribution $apt_source_distribution \ --component main From a70d2e0af5a7b842d8a1b0ceb03abb90a770e001 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Wed, 24 Jul 2019 13:35:46 +0200 Subject: [PATCH 070/383] Had to change the apt_source_distribution to stable, since the repository doesn't differ in distributions --- cdist/conf/type/__grafana_dashboard/manifest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__grafana_dashboard/manifest b/cdist/conf/type/__grafana_dashboard/manifest index c1fe9416..e652202b 100755 --- a/cdist/conf/type/__grafana_dashboard/manifest +++ b/cdist/conf/type/__grafana_dashboard/manifest @@ -8,10 +8,12 @@ case $os in debian|devuan) case $os_version in 8*|jessie) - apt_source_distribution=jessie + # Differntation not needed anymore + apt_source_distribution=stable ;; 9*|ascii/ceres|ascii) - apt_source_distribution=stretch + # Differntation not needed anymore + apt_source_distribution=stable ;; *) echo "Don't know how to install Grafana on $os $os_version. Send us a pull request!" >&2 From f7efde0d0a28cd0e82f6126abcbc7f797a0602b8 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 25 Jul 2019 08:06:58 +0200 Subject: [PATCH 071/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index e4e312fd..ae2eac8d 100644 --- a/docs/changelog +++ b/docs/changelog @@ -3,6 +3,7 @@ Changelog next: * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) + * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) 5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) From 031d59c82ccadb931db70bc3c22a013f1104b8e5 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Sun, 4 Aug 2019 21:23:44 +0200 Subject: [PATCH 072/383] Added Devuan support for __docker type --- cdist/conf/type/__docker/manifest | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cdist/conf/type/__docker/manifest b/cdist/conf/type/__docker/manifest index 04a9ff27..f20337d7 100755 --- a/cdist/conf/type/__docker/manifest +++ b/cdist/conf/type/__docker/manifest @@ -64,6 +64,43 @@ case "$os" in require="__apt_source/docker" __package docker-ce --state "${state}" fi ;; + devuan) + os_version="$(cat "$__global/explorer/os_version")" + + case "$os_version" in + ascii) + distributione="stretch" + ;; + jessie) + distribution="jessie" + ;; + *) + echo "Your devuan release ($os_version) is currently not supported by this type (${__type##*/}).">&2 + echo "Please contribute an implementation for it if you can." >&2 + exit 1 + ;; + esac + + if [ "${state}" = "present" ]; then + __package apt-transport-https + __package ca-certificates + __package gnupg2 + fi + __apt_key_uri docker --name "Docker Release (CE deb) " \ + --uri "https://download.docker.com/linux/${os}/gpg" --state "${state}" + + require="__apt_key_uri/docker" __apt_source docker \ + --uri "https://download.docker.com/linux/${os}" \ + --distribution "${distribution}" \ + --state "${state}" \ + --component "stable" + if [ "$version" != "latest" ]; then + require="__apt_source/docker" __package docker-ce --version "${version}" --state "${state}" + else + require="__apt_source/docker" __package docker-ce --state "${state}" + fi + + ;; *) echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 echo "Please contribute an implementation for it if you can." >&2 From c6b739b5b6de870e629d421b140587278777b5de Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 4 Aug 2019 21:52:59 +0200 Subject: [PATCH 073/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index ae2eac8d..57412999 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,7 @@ Changelog next: * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) + * Type __docker: Add devuan support (Dominique Roux) 5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) From 2f7dc5a65d264d7f210ab06834980d8782c4a565 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 4 Aug 2019 21:54:13 +0200 Subject: [PATCH 074/383] Fix variable typo --- cdist/conf/type/__docker/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__docker/manifest b/cdist/conf/type/__docker/manifest index f20337d7..6a57d85a 100755 --- a/cdist/conf/type/__docker/manifest +++ b/cdist/conf/type/__docker/manifest @@ -69,7 +69,7 @@ case "$os" in case "$os_version" in ascii) - distributione="stretch" + distribution="stretch" ;; jessie) distribution="jessie" From c0aa2214aa5b34ae1a073682fc3bd6545ceacf36 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 15 Aug 2019 14:19:54 +0200 Subject: [PATCH 075/383] [letsencrypt] add support for devuan/beowulf --- cdist/conf/type/__letsencrypt_cert/manifest | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdist/conf/type/__letsencrypt_cert/manifest b/cdist/conf/type/__letsencrypt_cert/manifest index d6892c9b..072fa398 100755 --- a/cdist/conf/type/__letsencrypt_cert/manifest +++ b/cdist/conf/type/__letsencrypt_cert/manifest @@ -67,6 +67,9 @@ if [ -z "${certbot_fullpath}" ]; then require="__apt_source/ascii-backports" __package_apt certbot \ --target-release ascii-backports ;; + bewoulf*) + __package_apt certbot + ;; *) echo "Unsupported OS version: $os_version" >&2 exit 1 From 7182de596891f963c6867c1d0b08a5276450c56f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 15 Aug 2019 14:20:14 +0200 Subject: [PATCH 076/383] ++changes --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index ae2eac8d..b13e54fa 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,7 @@ Changelog next: * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) + * Type __letsencrypt_cert: Add Devuan Beowulf support (Nico Schottelius) 5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) From a86893889b3a9d84712a71a23da60461671ca0e9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 15 Aug 2019 14:24:11 +0200 Subject: [PATCH 077/383] [letsencrypt] devuan/ascii: only install certbot package It seems python-certbot is gone --- cdist/conf/type/__letsencrypt_cert/manifest | 2 -- 1 file changed, 2 deletions(-) diff --git a/cdist/conf/type/__letsencrypt_cert/manifest b/cdist/conf/type/__letsencrypt_cert/manifest index 072fa398..d598949e 100755 --- a/cdist/conf/type/__letsencrypt_cert/manifest +++ b/cdist/conf/type/__letsencrypt_cert/manifest @@ -62,8 +62,6 @@ if [ -z "${certbot_fullpath}" ]; then --distribution ascii-backports \ --component main - require="__apt_source/ascii-backports" __package_apt python-certbot \ - --target-release ascii-backports require="__apt_source/ascii-backports" __package_apt certbot \ --target-release ascii-backports ;; From 6c780c24c7d1fdf8a316fef98a304c07ffd57d0e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 15 Aug 2019 14:25:16 +0200 Subject: [PATCH 078/383] ++changes --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 6e20c64e..f3b84ba8 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,6 +5,7 @@ next: * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) * Type __letsencrypt_cert: Add Devuan Beowulf support (Nico Schottelius) + * Type __letsencrypt_cert: Fix Devuan Ascii: support (Nico Schottelius) * Type __docker: Add devuan support (Dominique Roux) 5.1.2: 2019-06-21 From 451dfaffe49fc85f8222da19177b7aa05c864f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=BDubom=C3=ADr=20Ku=C4=8Dera?= Date: Fri, 23 Aug 2019 11:28:13 +0200 Subject: [PATCH 079/383] __docker_swarm: Fix for Docker 19.03 --- cdist/conf/type/__docker_swarm/explorer/swarm-state | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__docker_swarm/explorer/swarm-state b/cdist/conf/type/__docker_swarm/explorer/swarm-state index 9c1bc32d..2c9fd598 100755 --- a/cdist/conf/type/__docker_swarm/explorer/swarm-state +++ b/cdist/conf/type/__docker_swarm/explorer/swarm-state @@ -18,4 +18,4 @@ # along with cdist. If not, see . # -docker info 2>/dev/null | grep "^Swarm: " | cut -d " " -f 2- +docker info 2>/dev/null | grep '^ *Swarm: ' | awk '{print $2}' From 65b9e1d00f230ca97ef30546e1490a8b51e83c19 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 29 Aug 2019 14:40:16 +0200 Subject: [PATCH 080/383] ++changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index f3b84ba8..b790b983 100644 --- a/docs/changelog +++ b/docs/changelog @@ -7,6 +7,7 @@ next: * Type __letsencrypt_cert: Add Devuan Beowulf support (Nico Schottelius) * Type __letsencrypt_cert: Fix Devuan Ascii: support (Nico Schottelius) * Type __docker: Add devuan support (Dominique Roux) + * Type __docker_swarm: Fix for Docker 19.03 (Ľubomír Kučera) 5.1.2: 2019-06-21 * Core: Add support for type parameters deprecation (Darko Poljak) From 067d0a62e73d89fef35e1f7183a3b376634da5c0 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 30 Aug 2019 08:51:08 +0200 Subject: [PATCH 081/383] Release 5.1.3 --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index b790b983..7594a6d4 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -next: +5.1.3: 2019-08-30 * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) * Type __letsencrypt_cert: Add Devuan Beowulf support (Nico Schottelius) From 4294ff55e16ae8aba978721f8077605c6157eaf1 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Mon, 9 Sep 2019 16:12:16 +0200 Subject: [PATCH 082/383] [type/__git] Add --recursive parameter --- cdist/conf/type/__git/gencode-remote | 32 ++++++++++++------------- cdist/conf/type/__git/man.rst | 2 ++ cdist/conf/type/__git/parameter/boolean | 1 + 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 cdist/conf/type/__git/parameter/boolean diff --git a/cdist/conf/type/__git/gencode-remote b/cdist/conf/type/__git/gencode-remote index 5a9e23fc..3ba21add 100755 --- a/cdist/conf/type/__git/gencode-remote +++ b/cdist/conf/type/__git/gencode-remote @@ -19,32 +19,31 @@ # # -state_is="$(cat "$__object/explorer/state")" -owner_is="$(cat "$__object/explorer/owner")" -group_is="$(cat "$__object/explorer/group")" +state_is=$(cat "$__object/explorer/state") +owner_is=$(cat "$__object/explorer/owner") +group_is=$(cat "$__object/explorer/group") -state_should="$(cat "$__object/parameter/state")" +state_should=$(cat "$__object/parameter/state") -branch="$(cat "$__object/parameter/branch")" +branch=$(cat "$__object/parameter/branch") -source="$(cat "$__object/parameter/source")" +source=$(cat "$__object/parameter/source") destination="/$__object_id" -owner="$(cat "$__object/parameter/owner")" -group="$(cat "$__object/parameter/group")" -mode="$(cat "$__object/parameter/mode")" +owner=$(cat "$__object/parameter/owner") +group=$(cat "$__object/parameter/group") +mode=$(cat "$__object/parameter/mode") -[ "$state_should" = "$state_is" ] && \ -[ "$owner" = "$owner_is" ] && \ -[ "$group" = "$group_is" ] && \ -[ -n "$mode" ] && exit 0 +[ "$state_should" = "$state_is" ] \ + && [ "$owner" = "$owner_is" ] \ + && [ "$group" = "$group_is" ] \ + && [ -n "$mode" ] && exit 0 case $state_should in present) - if [ "$state_should" != "$state_is" ]; then - echo git clone --quiet --branch "$branch" "$source" "$destination" + echo git clone --quiet $([ -f "$__object/parameter/recursive" ] && echo '--recursive') --branch "$branch" "$source" "$destination" fi if { [ -n "$owner" ] && [ "$owner_is" != "$owner" ]; } || \ { [ -n "$group" ] && [ "$group_is" != "$group" ]; }; then @@ -54,8 +53,9 @@ case $state_should in echo chmod -R "$mode" "$destination" fi ;; - # Handled in manifest + absent) + # Handled in manifest ;; *) diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index 130925c8..e4c06c99 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -35,6 +35,8 @@ mode owner User to chown to. +recursive + Recursive clone... EXAMPLES -------- diff --git a/cdist/conf/type/__git/parameter/boolean b/cdist/conf/type/__git/parameter/boolean new file mode 100644 index 00000000..a633e659 --- /dev/null +++ b/cdist/conf/type/__git/parameter/boolean @@ -0,0 +1 @@ +recursive From 88fe83ed735d533a77c1cd68081893442a1acc1e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 14 Sep 2019 15:24:36 +0530 Subject: [PATCH 083/383] Fix beowulf's spelling --- cdist/conf/type/__letsencrypt_cert/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__letsencrypt_cert/manifest b/cdist/conf/type/__letsencrypt_cert/manifest index d598949e..f736f3f2 100755 --- a/cdist/conf/type/__letsencrypt_cert/manifest +++ b/cdist/conf/type/__letsencrypt_cert/manifest @@ -65,7 +65,7 @@ if [ -z "${certbot_fullpath}" ]; then require="__apt_source/ascii-backports" __package_apt certbot \ --target-release ascii-backports ;; - bewoulf*) + beowulf*) __package_apt certbot ;; *) From eab540bd0fc4a81408890f0dc8f45e8a7f609d06 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 18 Sep 2019 07:04:41 +0200 Subject: [PATCH 084/383] ++ --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index 7594a6d4..e7e6b182 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Type __letsencrypt_cert: Fix beowulf's spelling (Mondi Ravi) + 5.1.3: 2019-08-30 * Build: Overcome bash CDPATH when building docs (Dmitry Bogatov) * Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux) From 799ec7236971fac597ccb3f80a646fae7e4817f5 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 20 Sep 2019 07:15:37 +0200 Subject: [PATCH 085/383] Implement preos --- cdist/argparse.py | 6 +- cdist/preos.py | 101 + cdist/preos/debootstrap/__init__.py | 1 + cdist/preos/debootstrap/debootstrap.py | 240 ++ cdist/preos/debootstrap/files/code | 274 ++ .../files/devuan-debootstrap/Makefile | 18 + .../files/devuan-debootstrap/README | 65 + .../debootstrap/files/devuan-debootstrap/TODO | 11 + .../devuan-debootstrap/debian/.gitignore | 6 + .../debian/README.DevuanSource | 15 + .../files/devuan-debootstrap/debian/changelog | 2655 +++++++++++++++++ .../files/devuan-debootstrap/debian/compat | 1 + .../files/devuan-debootstrap/debian/control | 26 + .../files/devuan-debootstrap/debian/copyright | 30 + .../debian/debootstrap.docs | 1 + .../debian/debootstrap.manpages | 1 + .../files/devuan-debootstrap/debian/gbp.conf | 9 + .../files/devuan-debootstrap/debian/rules | 47 + .../devuan-debootstrap/debian/source/format | 1 + .../files/devuan-debootstrap/debootstrap | 703 +++++ .../files/devuan-debootstrap/debootstrap.8 | 189 ++ .../files/devuan-debootstrap/functions | 1735 +++++++++++ .../files/devuan-debootstrap/scripts/aequorea | 202 ++ .../files/devuan-debootstrap/scripts/ascii | 1 + .../devuan-debootstrap/scripts/bartholomea | 1 + .../files/devuan-debootstrap/scripts/breezy | 163 + .../files/devuan-debootstrap/scripts/bullseye | 1 + .../files/devuan-debootstrap/scripts/buster | 1 + .../files/devuan-debootstrap/scripts/ceres | 218 ++ .../devuan-debootstrap/scripts/chromodoris | 1 + .../files/devuan-debootstrap/scripts/dapper | 168 ++ .../files/devuan-debootstrap/scripts/dasyatis | 1 + .../files/devuan-debootstrap/scripts/edgy | 187 ++ .../files/devuan-debootstrap/scripts/etch | 1 + .../devuan-debootstrap/scripts/etch-m68k | 1 + .../files/devuan-debootstrap/scripts/feisty | 190 ++ .../files/devuan-debootstrap/scripts/gutsy | 230 ++ .../files/devuan-debootstrap/scripts/hardy | 1 + .../files/devuan-debootstrap/scripts/hoary | 179 ++ .../devuan-debootstrap/scripts/hoary.buildd | 159 + .../files/devuan-debootstrap/scripts/intrepid | 1 + .../files/devuan-debootstrap/scripts/jaunty | 1 + .../files/devuan-debootstrap/scripts/jessie | 1 + .../scripts/jessie-kfreebsd | 1 + .../files/devuan-debootstrap/scripts/karmic | 1 + .../files/devuan-debootstrap/scripts/lenny | 1 + .../files/devuan-debootstrap/scripts/lucid | 1 + .../files/devuan-debootstrap/scripts/maverick | 1 + .../files/devuan-debootstrap/scripts/natty | 1 + .../devuan-debootstrap/scripts/oldoldstable | 1 + .../devuan-debootstrap/scripts/oldstable | 1 + .../files/devuan-debootstrap/scripts/oneiric | 1 + .../files/devuan-debootstrap/scripts/potato | 104 + .../files/devuan-debootstrap/scripts/precise | 1 + .../files/devuan-debootstrap/scripts/quantal | 1 + .../files/devuan-debootstrap/scripts/raring | 1 + .../files/devuan-debootstrap/scripts/sarge | 218 ++ .../devuan-debootstrap/scripts/sarge.buildd | 166 ++ .../scripts/sarge.fakechroot | 171 ++ .../files/devuan-debootstrap/scripts/saucy | 1 + .../files/devuan-debootstrap/scripts/sid | 214 ++ .../files/devuan-debootstrap/scripts/squeeze | 1 + .../files/devuan-debootstrap/scripts/stable | 1 + .../files/devuan-debootstrap/scripts/stretch | 1 + .../files/devuan-debootstrap/scripts/testing | 1 + .../files/devuan-debootstrap/scripts/trusty | 1 + .../files/devuan-debootstrap/scripts/unstable | 1 + .../files/devuan-debootstrap/scripts/utopic | 1 + .../files/devuan-debootstrap/scripts/vivid | 1 + .../files/devuan-debootstrap/scripts/warty | 166 ++ .../devuan-debootstrap/scripts/warty.buildd | 159 + .../files/devuan-debootstrap/scripts/wheezy | 1 + .../files/devuan-debootstrap/scripts/wily | 1 + .../files/devuan-debootstrap/scripts/woody | 203 ++ .../devuan-debootstrap/scripts/woody.buildd | 166 ++ .../files/devuan-debootstrap/scripts/xenial | 1 + .../files/devuan-debootstrap/scripts/yakkety | 1 + .../files/devuan-debootstrap/scripts/zesty | 1 + .../debootstrap/files/init-manifest-debian | 39 + .../debootstrap/files/init-manifest-devuan | 39 + .../debootstrap/files/init-manifest-ubuntu | 39 + cdist/preos/debootstrap/files/remote-copy.sh | 8 + cdist/preos/debootstrap/files/remote-exec.sh | 24 + completions/bash/cdist-completion.bash | 2 +- completions/zsh/_cdist | 2 +- docs/changelog | 1 + docs/src/cdist-preos.rst | 137 + docs/src/cdist-reference.rst.sh | 3 + docs/src/index.rst | 1 + docs/src/man1/cdist.rst | 172 +- hacking/preos-sh/init | 32 + hacking/preos-sh/preos.sh | 31 + hacking/preos-sh/remote-copy.sh | 8 + hacking/preos-sh/remote-exec.sh | 24 + scripts/cdist | 3 + 95 files changed, 9997 insertions(+), 4 deletions(-) create mode 100644 cdist/preos.py create mode 100644 cdist/preos/debootstrap/__init__.py create mode 100644 cdist/preos/debootstrap/debootstrap.py create mode 100755 cdist/preos/debootstrap/files/code create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/Makefile create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/README create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/TODO create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/.gitignore create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/README.DevuanSource create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/changelog create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/compat create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/control create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/copyright create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.docs create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.manpages create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/gbp.conf create mode 100755 cdist/preos/debootstrap/files/devuan-debootstrap/debian/rules create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debian/source/format create mode 100755 cdist/preos/debootstrap/files/devuan-debootstrap/debootstrap create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/debootstrap.8 create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/functions create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/aequorea create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/ascii create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/bartholomea create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/breezy create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/bullseye create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/buster create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/ceres create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/chromodoris create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/dapper create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/dasyatis create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/edgy create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/etch create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/etch-m68k create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/feisty create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/gutsy create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/hardy create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/hoary create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/hoary.buildd create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/intrepid create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/jaunty create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/jessie create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/jessie-kfreebsd create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/karmic create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/lenny create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/lucid create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/maverick create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/natty create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/oldoldstable create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/oldstable create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/oneiric create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/potato create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/precise create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/quantal create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/raring create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/sarge create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/sarge.buildd create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/sarge.fakechroot create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/saucy create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/sid create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/squeeze create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/stable create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/stretch create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/testing create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/trusty create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/unstable create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/utopic create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/vivid create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/warty create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/warty.buildd create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/wheezy create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/wily create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/woody create mode 100644 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/woody.buildd create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/xenial create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/yakkety create mode 120000 cdist/preos/debootstrap/files/devuan-debootstrap/scripts/zesty create mode 100644 cdist/preos/debootstrap/files/init-manifest-debian create mode 100644 cdist/preos/debootstrap/files/init-manifest-devuan create mode 100644 cdist/preos/debootstrap/files/init-manifest-ubuntu create mode 100755 cdist/preos/debootstrap/files/remote-copy.sh create mode 100755 cdist/preos/debootstrap/files/remote-exec.sh create mode 100644 docs/src/cdist-preos.rst create mode 100644 hacking/preos-sh/init create mode 100644 hacking/preos-sh/preos.sh create mode 100644 hacking/preos-sh/remote-copy.sh create mode 100644 hacking/preos-sh/remote-exec.sh diff --git a/cdist/argparse.py b/cdist/argparse.py index 421d1b54..3ccc0545 100644 --- a/cdist/argparse.py +++ b/cdist/argparse.py @@ -5,10 +5,11 @@ import logging import collections import functools import cdist.configuration +import cdist.preos # set of beta sub-commands -BETA_COMMANDS = set(('install', 'inventory', )) +BETA_COMMANDS = set(('install', 'inventory', 'preos', )) # set of beta arguments for sub-commands BETA_ARGS = { 'config': set(('tag', 'all_tagged_hosts', 'use_archiving', )), @@ -422,6 +423,9 @@ def get_parsers(): parser['inventory'].set_defaults( func=cdist.inventory.Inventory.commandline) + # PreOs + parser['preos'] = parser['sub'].add_parser('preos', add_help=False) + # Shell parser['shell'] = parser['sub'].add_parser( 'shell', parents=[parser['loglevel']]) diff --git a/cdist/preos.py b/cdist/preos.py new file mode 100644 index 00000000..46b45554 --- /dev/null +++ b/cdist/preos.py @@ -0,0 +1,101 @@ +import os +import os.path +import sys +import inspect +import argparse +import cdist +import logging + + +_PREOS_CALL = "commandline" +_PREOS_NAME = "_preos_name" +_PREOS_MARKER = "_cdist_preos" +_PLUGINS_DIR = "preos" +_PLUGINS_PATH = [os.path.join(os.path.dirname(__file__), _PLUGINS_DIR), ] +cdist_home = cdist.home_dir() +if cdist_home: + cdist_home_preos = os.path.join(cdist_home, "preos") + if os.path.isdir(cdist_home_preos): + _PLUGINS_PATH.append(cdist_home_preos) +sys.path.extend(_PLUGINS_PATH) + + +log = logging.getLogger("PreOS") + + +def preos_plugin(obj): + """It is preos if _PREOS_MARKER is True and has _PREOS_CALL.""" + if hasattr(obj, _PREOS_MARKER): + is_preos = getattr(obj, _PREOS_MARKER) + else: + is_preos = False + + if is_preos and hasattr(obj, _PREOS_CALL): + yield obj + + +def scan_preos_dir_plugins(dir): + for fname in os.listdir(dir): + if os.path.isfile(os.path.join(dir, fname)): + fname = os.path.splitext(fname)[0] + module_name = fname + try: + module = __import__(module_name) + yield from preos_plugin(module) + clsmembers = inspect.getmembers(module, inspect.isclass) + for cm in clsmembers: + c = cm[1] + yield from preos_plugin(c) + except ImportError as e: + log.warning("Cannot import '{}': {}".format(module_name, e)) + + +def find_preos_plugins(): + for dir in _PLUGINS_PATH: + yield from scan_preos_dir_plugins(dir) + + +def find_preoses(): + preoses = {} + for preos in find_preos_plugins(): + if hasattr(preos, _PREOS_NAME): + preos_name = getattr(preos, _PREOS_NAME) + else: + preos_name = preos.__name__.lower() + preoses[preos_name] = preos + return preoses + + +def check_root(): + if os.geteuid() != 0: + raise cdist.Error("Must be run with root privileges") + + +class PreOS(object): + preoses = None + + @classmethod + def commandline(cls, argv): + + if not cls.preoses: + cls.preoses = find_preoses() + + parser = argparse.ArgumentParser( + description="Create PreOS", prog="cdist preos") + parser.add_argument('preos', help='PreOS to create, one of: {}'.format( + set(cls.preoses))) + args = parser.parse_args(argv[1:2]) + + preos_name = args.preos + if preos_name in cls.preoses: + preos = cls.preoses[preos_name] + func = getattr(preos, _PREOS_CALL) + if inspect.ismodule(preos): + func_args = [preos, argv[2:], ] + else: + func_args = [argv[2:], ] + log.info("Running preos : {}".format(preos_name)) + func(*func_args) + else: + log.error("Unknown preos: {}, available preoses: {}".format( + preos_name, set(cls.preoses.keys()))) diff --git a/cdist/preos/debootstrap/__init__.py b/cdist/preos/debootstrap/__init__.py new file mode 100644 index 00000000..6d340b4a --- /dev/null +++ b/cdist/preos/debootstrap/__init__.py @@ -0,0 +1 @@ +from debootstrap.debootstrap import Debian, Ubuntu, Devuan diff --git a/cdist/preos/debootstrap/debootstrap.py b/cdist/preos/debootstrap/debootstrap.py new file mode 100644 index 00000000..617d280b --- /dev/null +++ b/cdist/preos/debootstrap/debootstrap.py @@ -0,0 +1,240 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# 2016 Darko Poljak (darko.poljak at ungleich.ch) +# +# 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 . +# +# + +import cdist +import cdist.config +import cdist.core +import cdist.preos +import argparse +import cdist.argparse +import logging +import os +import subprocess + + +class Debian(object): + _preos_name = 'debian' + _cdist_preos = True + + _files_dir = os.path.join(os.path.dirname(__file__), "files") + + @classmethod + def default_args(cls): + default_remote_exec = os.path.join(cls._files_dir, "remote-exec.sh") + default_remote_copy = os.path.join(cls._files_dir, "remote-copy.sh") + default_init_manifest = os.path.join( + cls._files_dir, "init-manifest-{}".format(cls._preos_name)) + + defargs = argparse.Namespace() + defargs.arch = 'amd64' + defargs.bootstrap = False + defargs.configure = False + defargs.cdist_params = '-v' + defargs.rm_bootstrap_dir = False + defargs.suite = 'stable' + defargs.remote_exec = default_remote_exec + defargs.remote_copy = default_remote_copy + defargs.manifest = default_init_manifest + + return defargs + + @classmethod + def get_parser(cls): + defargs = cls.default_args() + cdist_parser = cdist.argparse.get_parsers() + parser = argparse.ArgumentParser( + prog='cdist preos {}'.format(cls._preos_name), + parents=[cdist_parser['loglevel'], cdist_parser['beta']]) + parser.add_argument('target_dir', nargs=1, + help=("target directory where PreOS will be " + "bootstrapped")) + parser.add_argument( + '-a', '--arch', + help="target debootstrap architecture, by default '{}'".format( + defargs.arch), dest='arch', default=defargs.arch) + parser.add_argument( + '-B', '--bootstrap', + help='do bootstrap step', + dest='bootstrap', action='store_true', default=defargs.bootstrap) + parser.add_argument( + '-C', '--configure', + help='do configure step', + dest='configure', action='store_true', default=defargs.configure) + parser.add_argument( + '-c', '--cdist-params', + help=("parameters that will be passed to cdist config, by default" + " '{}' is used".format(defargs.cdist_params)), + dest='cdist_params', default=defargs.cdist_params) + parser.add_argument( + '-D', '--drive-boot', + help='create bootable PreOS on specified drive', + dest='drive') + parser.add_argument( + '-e', '--remote-exec', + help=("remote exec that cdist config will use, by default " + "internal script is used"), + dest='remote_exec', default=defargs.remote_exec) + parser.add_argument( + '-i', '--init-manifest', + help=("init manifest that cdist config will use, by default " + "internal init manifest is used"), + dest='manifest', default=defargs.manifest) + parser.add_argument( + '-k', '--keyfile', action="append", + help=("ssh key files that will be added to cdist config; " + "'__ssh_authorized_keys root ...' type is appended to " + "initial manifest"), + dest='keyfile') + parser.add_argument( + '-m', '--mirror', + help='use specified mirror for debootstrap', + dest='mirror') + parser.add_argument( + '-P', '--root-password', + help='Set specified password for root, generated by default', + dest='root_password') + parser.add_argument('-p', '--pxe-boot-dir', help='PXE boot directory', + dest='pxe_boot_dir') + parser.add_argument( + '-r', '--rm-bootstrap-dir', + help='remove target directory after finishing', + dest='rm_bootstrap_dir', action='store_true', + default=defargs.rm_bootstrap_dir) + parser.add_argument( + '-S', '--script', + help='use specified script for debootstrap', + dest='script') + parser.add_argument('-s', '--suite', + help="suite used for debootstrap, " + "by default '{}'".format(defargs.suite), + dest='suite', default=defargs.suite) + parser.add_argument( + '-y', '--remote-copy', + help=("remote copy that cdist config will use, by default " + "internal script is used"), + dest='remote_copy', default=defargs.remote_copy) + parser.epilog = cdist.argparse.EPILOG + + return parser + + @classmethod + def update_env(cls, env): + pass + + @classmethod + def commandline(cls, argv): + log = logging.getLogger(cls.__name__) + + parser = cls.get_parser() + cdist.argparse.add_beta_command(cls._preos_name) + args = parser.parse_args(argv) + if args.script and not args.mirror: + raise cdist.Error("script option cannot be used without " + "mirror option") + + args.command = cls._preos_name + cdist.argparse.check_beta(vars(args)) + + cdist.preos.check_root() + + args.target_dir = os.path.realpath(args.target_dir[0]) + args.os = cls._preos_name + args.remote_exec = os.path.realpath(args.remote_exec) + args.remote_copy = os.path.realpath(args.remote_copy) + args.manifest = os.path.realpath(args.manifest) + if args.keyfile: + new_keyfile = [os.path.realpath(x) for x in args.keyfile] + args.keyfile = new_keyfile + if args.pxe_boot_dir: + args.pxe_boot_dir = os.path.realpath(args.pxe_boot_dir) + + cdist.argparse.handle_loglevel(args) + log.debug("preos: {}, args: {}".format(cls._preos_name, args)) + try: + env = vars(args) + new_env = {} + for key in env: + if key == 'verbose': + if env[key] >= 3: + new_env['debug'] = "yes" + elif env[key] == 2: + new_env['verbose'] = "yes" + elif not env[key]: + new_env[key] = '' + elif isinstance(env[key], bool) and env[key]: + new_env[key] = "yes" + elif isinstance(env[key], list): + val = env[key] + new_env[key + "_cnt"] = str(len(val)) + for i, v in enumerate(val): + new_env[key + "_" + str(i)] = v + else: + new_env[key] = str(env[key]) + env = new_env + env.update(os.environ) + cls.update_env(env) + log.debug("preos: {} env: {}".format(cls._preos_name, env)) + cmd = os.path.join(cls._files_dir, "code") + info_msg = ["Running preos: {}, suite: {}, arch: {}".format( + cls._preos_name, args.suite, args.arch), ] + if args.mirror: + info_msg.append("mirror: {}".format(args.mirror)) + if args.script: + info_msg.append("script: {}".format(args.script)) + if args.bootstrap: + info_msg.append("bootstrapping") + if args.configure: + info_msg.append("configuring") + if args.pxe_boot_dir: + info_msg.append("creating PXE") + if args.drive: + info_msg.append("creating bootable drive") + log.info(info_msg) + log.debug("cmd={}".format(cmd)) + subprocess.check_call(cmd, env=env, shell=True) + except subprocess.CalledProcessError as e: + log.error("preos {} failed: {}".format(cls._preos_name, e)) + + +class Ubuntu(Debian): + _preos_name = "ubuntu" + + @classmethod + def default_args(cls): + defargs = super().default_args() + defargs.suite = 'xenial' + return defargs + + +class Devuan(Debian): + _preos_name = "devuan" + + @classmethod + def default_args(cls): + defargs = super().default_args() + defargs.suite = 'jessie' + return defargs + + @classmethod + def update_env(cls, env): + env['DEBOOTSTRAP_DIR'] = os.path.join(cls._files_dir, + 'devuan-debootstrap') diff --git a/cdist/preos/debootstrap/files/code b/cdist/preos/debootstrap/files/code new file mode 100755 index 00000000..9e37003b --- /dev/null +++ b/cdist/preos/debootstrap/files/code @@ -0,0 +1,274 @@ +#!/bin/sh +## +## 2016 Darko Poljak (darko.poljak at ungleich.ch) +## +## 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 . + +set -e + +if [ "${debug}" ] +then + set -x + cdist_params="${cdist_params} -d" +fi + +bootstrap_dir="${target_dir}" + +case "${os}" in + ubuntu|debian|devuan) + # nothing, those are valid values + ;; + *) + echo "ERROR: invalid os value: ${os}" >&2 + exit 1 + ;; +esac + +check_bootstrap_dir() { + if [ ! -e "$1" ] + then + echo "ERROR: bootstrap directory $1 does not exist" >&2 + exit 1 + fi +} + +# bootstrap +if [ "${bootstrap}" ] +then + if [ "${DEBOOTSTRAP_DIR}" ] + then + debootstrap_cmd="${DEBOOTSTRAP_DIR}/debootstrap" + else + command -v debootstrap 2>&1 > /dev/null || { + echo "ERROR: debootstrap not found" >&2 + exit 1 + } + debootstrap_cmd="debootstrap" + fi + + # If PreOS on drive then do not check for directory emptiness. + # Partition can at least contain 'lost+found' directory. + if [ ! "${drive}" ] + then + if [ -e "${bootstrap_dir}" ] + then + dir_content=$(ls -A "${bootstrap_dir}" | wc -l) + else + dir_content=0 + fi + if [ "${dir_content}" -ne 0 ] + then + echo "ERROR: "${bootstrap_dir}" not empty " >&2 + exit 1 + fi + fi + + if [ "${verbose}" -o "${debug}" ] + then + echo "bootstrapping..." + fi + mkdir -p "${bootstrap_dir}" + "${debootstrap_cmd}" --include=openssh-server --arch=${arch} ${suite} ${bootstrap_dir} \ + ${mirror} ${script} + if [ "${verbose}" -o "${debug}" ] + then + echo "bootstrap finished" + fi +fi + +chroot_mount() { + mount -t proc none "${bootstrap_dir}/proc" || true + mount -t sysfs none "${bootstrap_dir}/sys" || true + mount -o bind /dev "${bootstrap_dir}/dev" || true + mount -t devpts none "${bootstrap_dir}/dev/pts" || true +} + +chroot_umount() { + umount "${bootstrap_dir}/dev/pts" || true + umount "${bootstrap_dir}/dev" || true + umount "${bootstrap_dir}/sys" || true + umount "${bootstrap_dir}/proc" || true +} + +TRAPFUNC="umount \"${bootstrap_dir}/dev/pts\" || true; \ +umount \"${bootstrap_dir}/dev\" || true; \ +umount \"${bootstrap_dir}/sys\" || true; \ +umount \"${bootstrap_dir}/proc\" || true;" + +# config +if [ "${configure}" ] +then + if [ ! -f "${manifest}" ] + then + echo "ERROR: ${manifest} does not exist" >&2 + exit 1 + fi + if [ ! -f "${remote_exec}" ] + then + echo "ERROR: ${remote_exec} does not exist" >&2 + exit 1 + fi + if [ ! -f "${remote_copy}" ] + then + echo "ERROR: ${remote_copy} does not exist" >&2 + exit 1 + fi + + if [ "${keyfile_cnt}" -a "${keyfile_cnt}" -gt 0 ] + then + i="$((keyfile_cnt - 1))" + keyfiles="" + while [ "${i}" -ge 0 ] + do + kf_var="keyfile_${i}" + eval kf='$'"${kf_var}" + if [ ! -f "${kf}" ] + then + echo "ERROR: ${kf} does not exist" >&2 + exit 1 + fi + key=$(cat "${kf}") + keyfiles="${keyfiles} --key '${key}'" + i=$((i - 1)) + done + ssh_auth_keys_line="__ssh_authorized_keys root ${keyfiles}\n" + else + ssh_auth_keys_line="" + fi + + check_bootstrap_dir "${bootstrap_dir}" + + if [ "${verbose}" -o "${debug}" ] + then + echo "configuring..." + fi + + trap "${TRAPFUNC}" 0 1 2 3 15 + + chroot_mount + + chroot "${bootstrap_dir}" /usr/bin/apt-get update + + if [ "${drive}" ] + then + grub_manifest_line="__package grub-pc --state present\n" + grub_kern_params_line="__line linux_kernel_params \ +--file /etc/default/grub \ +--line 'GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash net.ifnames=0\"'\n" + else + grub_manifest_line="" + grub_kern_params_line="" + fi + grub_lines="${grub_manifest_line}${grub_kern_params_line}" + + printf "${ssh_auth_keys_line}${grub_lines}" \ + | cat "${manifest}" - |\ + cdist config \ + ${cdist_params} -i - \ + --remote-exec "${remote_exec}" \ + --remote-copy "${remote_copy}" \ + "${bootstrap_dir}" + + # __hostname with systmed uses hostnamectl which needs dbus running + # set hostname explicitly here instead + printf "preos\n" > "${bootstrap_dir}/etc/hostname" + + chroot "${bootstrap_dir}" /usr/bin/apt-get autoclean + chroot "${bootstrap_dir}" /usr/bin/apt-get clean + chroot "${bootstrap_dir}" /usr/bin/apt-get autoremove + + chroot_umount + + trap - 0 1 2 3 15 + + if [ "${verbose}" -o "${debug}" ] + then + echo "configuring finished" + fi +fi + +if [ "${pxe_boot_dir}" ] +then + check_bootstrap_dir "${bootstrap_dir}" + + if [ "${verbose}" -o "${debug}" ] + then + echo "creating pxe..." + fi + + mkdir -p "${pxe_boot_dir}" + cp "${bootstrap_dir}"/boot/vmlinuz-* "${pxe_boot_dir}/kernel" + cd "${bootstrap_dir}" + find . -print0 | cpio --null -o --format=newc | gzip -9 > "${pxe_boot_dir}/initramfs" + + mkdir -p "${pxe_boot_dir}/pxelinux.cfg" + cat < "${pxe_boot_dir}/pxelinux.cfg/default" + DEFAULT preos + LABEL preos + KERNEL kernel + APPEND utf8 load_ramdisk=1 root=/dev/ram nofb initrd=initramfs console=ttyS1,115200 net.ifnames=0 +EOPXEF + + cp "${bootstrap_dir}/usr/lib/PXELINUX/pxelinux.0" "${pxe_boot_dir}/pxelinux.0" + cp "${bootstrap_dir}/usr/lib/syslinux/modules/bios/ldlinux.c32" \ + "${pxe_boot_dir}/ldlinux.c32" + # network boot need all files world readable + chmod -R 644 "${pxe_boot_dir}"/* + + if [ "${verbose}" -o "${debug}" ] + then + echo "pxe creation finished" + fi +fi + +if [ "${drive}" ] +then + trap "${TRAPFUNC}" 0 1 2 3 15 + chroot_mount + chroot "${bootstrap_dir}" grub-install ${drive} + chroot "${bootstrap_dir}" /bin/sh -c "GRUB_DISABLE_OS_PROBER=true update-grub" + # set root password + if [ ! "${root_password}" ] + then + if ! which strings >/dev/null 2>&1 + then + printf "strings is missing\n" >&2 + exit 1 + fi + root_password="$(head -n 1000 /dev/urandom | strings | \ + grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n')" + printf "Generated root password (without quotes):'${root_password}'\n" + fi + chroot "${bootstrap_dir}" /bin/sh -c "echo \"root:${root_password}\" | \ + chpasswd" + # /etc/securetty must not be world writeable. + chmod 644 "${bootstrap_dir}"/etc/securetty + chroot_umount + trap - 0 1 2 3 15 +fi + +if [ "${rm_bootstrap_dir}" ] +then + if [ "${verbose}" -o "${debug}" ] + then + echo "removing bootstrap dir..." + fi + rm -r -f "${bootstrap_dir}" + if [ "${verbose}" -o "${debug}" ] + then + echo "removing bootstrap dir finished" + fi +fi diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/Makefile b/cdist/preos/debootstrap/files/devuan-debootstrap/Makefile new file mode 100644 index 00000000..85168031 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/Makefile @@ -0,0 +1,18 @@ +# avoid dpkg-dev dependency; fish out the version with sed +VERSION := $(shell sed 's/.*(\(.*\)).*/\1/; q' debian/changelog) + +all: + +clean: + +DSDIR=$(DESTDIR)/usr/share/debootstrap +install: + mkdir -p $(DSDIR)/scripts + mkdir -p $(DESTDIR)/usr/sbin + + cp -a scripts/* $(DSDIR)/scripts/ + install -o root -g root -m 0644 functions $(DSDIR)/ + + sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap + chown root:root $(DESTDIR)/usr/sbin/debootstrap + chmod 0755 $(DESTDIR)/usr/sbin/debootstrap diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/README b/cdist/preos/debootstrap/files/devuan-debootstrap/README new file mode 100644 index 00000000..4d8c3049 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/README @@ -0,0 +1,65 @@ +README for debootstrap +====================== + +See the manpage for (some) documentation. + +Running debootstrap from source +------------------------------- + +You can run debootstrap from its source tree without installing it. This +can be useful if you want a quick way to make a Debian chroot on another +system, or if you are testing modifications to debootstrap. + +First, get the source. + +* Either by using git + git clone https://anonscm.debian.org/git/d-i/debootstrap.git + +* Or by visiting + and downloading the tar.gz file + +Then in the debootstrap source directory: + + export DEBOOTSTRAP_DIR=`pwd` + sudo ./debootstrap stable my-stable-dir + +If you are running a multi-stage boot strap (for example for a QEMU +rootfs) you don't even need root: + + export DEBOOTSTRAP_DIR=`pwd` + fakeroot ./debootstrap --foreign --arch=armhf testing my-testing-dir http://deb.debian.org/debian + +Of course you will need to execute the second stage as root to finish the bootstrap: + + (on foreign hardware) + /debootstrap/debootstrap --second-stage + + +Future +------ + + * Cross-strap support - so you can bootstrap a filesystem to the + point where it will successfully boot, and finish installing itself + without having to be running the target architecture or OS yourself. + + debootstrap --arch powerpc sarge ./sarge-ppc-chroot ... + + on an i386 system, boot a powerpc box with sarge-ppc-chroot as its + root files system, and have it "work". The cross-hurd package does + something similar, and should be replaced by this feature. + + * There should be some (better) way of telling debootstrap what "base" + packages you want to install -- this varies between making a chroot, + doing an install, and doing a buildd. Also, some installs want + different base packages (to setup networking, or kernels, eg) + + +NMUing +------ + +If there's a problem with debootstrap that you need fixed, feel free to do +an NMU to fix it. Usual rules: try not to break anything, and mail the +patch to the BTS. Don't worry about asking first though. + +However, note that debootstrap is now team maintained. Anyone in d-i can do +a release without the bother of a NMU. diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/TODO b/cdist/preos/debootstrap/files/devuan-debootstrap/TODO new file mode 100644 index 00000000..e5fde0e4 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/TODO @@ -0,0 +1,11 @@ + +Features: + ++ second stage via chroot debootstrap/debootstrap + ++ debootstrap/deb file to record deb destinations/information + + -- configuration file + -- versus command line + -- support for sources (vs mirrors) + -- faux-pinning for packages + + ++ makedev in second stage diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/.gitignore b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/.gitignore new file mode 100644 index 00000000..39638d97 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/.gitignore @@ -0,0 +1,6 @@ +debootstrap +debootstrap-udeb +files +*.debhelper.log +*.substvars + diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/README.DevuanSource b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/README.DevuanSource new file mode 100644 index 00000000..6446a088 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/README.DevuanSource @@ -0,0 +1,15 @@ +To sync up with debians source for inspiration you should run the following: + + `git remote add alioth-git git://anonscm.debian.org/d-i/debootstrap.git` + `git fetch alioth-git` + +After that you can either cherry-pick or merge releases from debian. To +merge a release, it's do: + `git tag` to list the release tags +and + `git merge ` +followed by all the fixups and then commit with an appropriate message like + "Merging Release from debian" + +Copyright 2016 Daniel Reurich + diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/changelog b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/changelog new file mode 100644 index 00000000..8688197d --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/changelog @@ -0,0 +1,2655 @@ +debootstrap (1.0.87+devuan1.1) unstable; urgency=medium + + * add git to builddeps + + -- Daniel Reurich Fri, 13 Jan 2017 23:12:50 +1300 + +debootstrap (1.0.87+devuan1.0) unstable; urgency=high + + [ Julien Cristau ] + * Default to split /usr again, as merged-/usr breaks dpkg-shlibdeps + (closes: #844221). + + [ Riku Voipio ] + * remove scratchbox2 support (closes: #796189) + + -- Christian Perrier Wed, 16 Nov 2016 06:47:27 +0100 + +debootstrap (1.0.86+devuan1.0) unstable; urgency=high + + [ Daniel Reurich ] + * Restore Devuan Jessie version + * switch to 3.0 (git) source format + * set git-depth + * Add directions for inspiration from debians source + * removed file so we can build using git source format + * merge 1.0.86 for jessie + + -- Daniel Reurich Fri, 13 Jan 2017 15:58:19 +1300 + +debootstrap (1.0.86) unstable; urgency=high + + * Rework split_inline_sig by using shell built-ins instead of trying to + mix sed and tr together, which might work on regular systems but not + from inside the Debian Installer (Closes: #842591). Thanks to Ansgar + Burchardt for the proof of concept! + + -- Cyril Brulebois Sun, 30 Oct 2016 23:35:45 +0100 + +debootstrap (1.0.85-1+devuan1) unstable; urgency=medium + + * sync with debian upstream package + * add right keyrings with the new schema on devuan-keyring package + + -- Franco (nextime) Lanza Sat, 29 Oct 2016 23:21:57 +0200 + + +debootstrap (1.0.85) unstable; urgency=medium + + [ Julien Cristau ] + * Add support for downloading and validating InRelease files, by splitting + up detached signature from signed data. + * Switch default mirror to deb.debian.org. + + [ Colin Watson ] + * Add (Ubuntu) zesty as a symlink to gutsy. + + [ Ansgar Burchardt ] + * Add jessie-kfreebsd to merged-/usr blacklist. + * No longer Build-Depend on makedev. The code using it was already + removed in debootstrap 1.0.82. + * Do not use `tar -k` for older releases which might have file + conflicts between the packages to be installed. (Closes: #838388) + * Error out when seeing short options. (Closes: #548880) + * Add oldoldstable -> sid script symlink. (Closes: #792734) + * Add buster -> sid and bullseye -> sid script symlinks. + * Only unpack and configure the base system when there are actually + packages to install. (Closes: #825034) + * debootstrap.8: Use stretch instead of wheezy in examples. + + [ Marco d'Itri ] + * Enable merged-/usr by default. (Closes: #839046) + + -- Julien Cristau Fri, 21 Oct 2016 20:22:49 +0200 + +debootstrap (1.0.84) unstable; urgency=medium + + [ Ansgar Burchardt ] + * Add support for xz-compressed Packages indices. (Closes: #837649) + + -- Christian Perrier Thu, 06 Oct 2016 06:59:38 +0200 + +debootstrap (1.0.83) unstable; urgency=medium + + [ Ansgar Burchardt ] + * functions: Validate that the requested suite is listed in the + Release file's Suite or Codename field. (Closes: #837075) + * Add support for merged-/usr, enabled by a new --merged-usr option. + (Closes: #810301) + * Feign install of dpkg in second stage. This avoids problems when + using dpkg-deb together with busybox' tar. (Closes: #837185) + * README: Use https://. + + [ Steve McIntyre ] + * Update Standards-Version to 3.9.8 (no changes needed) + + -- Steve McIntyre <93sam@debian.org> Tue, 13 Sep 2016 13:16:41 +0100 + +debootstrap (1.0.82) unstable; urgency=medium + + [ Alex Bennée ] + * Excise all devices.tar.gz code. Closes: #830869 + + -- Christian Perrier Thu, 08 Sep 2016 07:09:56 +0200 + +debootstrap (1.0.81) unstable; urgency=medium + + [ Luca Falavigna ] + * Add (Ubuntu) yakkety as a symlink to gutsy. + + -- Christian Perrier Tue, 03 May 2016 06:51:57 +0200 + +debootstrap (1.0.80-1+devuan1) unstable; urgency=medium + + * sync with debian upstream package. + + -- Franco (nextime) Lanza Sun, 24 Apr 2016 06:16:29 +0200 + +debootstrap (1.0.80) unstable; urgency=medium + + [ Jon Boden ] + * scripts/gutsy: Support kfreebsd & hurd arches on Ubuntu targets + (closes: #818748) + + -- Christian Perrier Tue, 22 Mar 2016 19:27:45 +0100 + +debootstrap (1.0.79) unstable; urgency=medium + + [ Samuel Thibault ] + * hurd: move setting up dev and servers firmlink to setup_proc stage. Also + firmlink proc there. Thanks Gabriele Giacone for all the investigation! + (Closes: #768102) + + -- Christian Perrier Fri, 19 Feb 2016 07:23:59 +0100 + +debootstrap (1.0.78+nmu1) unstable; urgency=medium + + * Non-maintainer upload. + * Split setup_devices in setup_devices (which now only deals with static + device nodes) and setup_dynamic_devices, and move the calls to + setup_devices from the beginning of the second stage to the end of the + first stage. + setup_dynamic_devices mounts the appropriate filesystems which provide + dynamic device nodes for the architectures which need one in + debootstrap (kfreebsd and hurd). + This fixes a bug in --second-stage introduced in 1.0.34 and exposed + by the devices-related changes of 1.0.76: the second stage debootstrap + runs "dpkg --print-architecture >/dev/null" at the very beginning of + the program when /dev is still empty, so it creates an empty regular + file in place of /dev/null and this will cause mknod to fail later. + (Closes: #813232) + + -- Marco d'Itri Wed, 17 Feb 2016 01:23:23 +0100 + +debootstrap (1.0.78) unstable; urgency=high + + * Use HTTPS for Vcs-* URLs, and link to cgit rather than gitweb. + * Don't call mknod with the --mode option, it's not supported in + busybox. Use -m instead - fixes the broken fix for #812811. + Closes: #813124. Urgency high to get this fix propagated quickly - + it's breaking d-i installs right now. Adding myself to uploaders and + uploading. + + -- Steve McIntyre <93sam@debian.org> Fri, 29 Jan 2016 16:36:00 +0000 + +debootstrap (1.0.77) unstable; urgency=medium + + [ Marco d'Itri ] + * Fix permissions on device nodes (Closes: #812811). + + -- Cyril Brulebois Wed, 27 Jan 2016 20:22:05 +0100 + +debootstrap (1.0.76) unstable; urgency=medium + + [ Marco d'Itri ] + * Stop creating useless device nodes (Closes: #571136). + + -- Cyril Brulebois Sun, 24 Jan 2016 08:55:18 +0100 + +debootstrap (1.0.75-1+devuan1) unstable; urgency=medium + + * sync with debian upstream package + + -- Franco (nextime) Lanza Wed, 02 Dec 2015 04:05:36 +0100 + +debootstrap (1.0.75) unstable; urgency=medium + + * Stop cleaning KEEP_DEBOOTSTRAP_DIR twice, as spotted by Chris Lamb + (Closes: #804415). + * Add Tanglu support (Closes: #771687), thanks to Matthias Klumpp. At + the moment, the following extra suites are recognized: + - aequorea + - bartholomea + - chromodoris + - dasyatis + + -- Cyril Brulebois Wed, 11 Nov 2015 18:49:28 +0100 + +debootstrap (1.0.74) unstable; urgency=medium + + [ Colin Watson ] + * Add (Ubuntu) xenial as a symlink to gutsy. + + -- Christian Perrier Tue, 03 Nov 2015 07:09:23 +0100 + +debootstrap (1.0.73) unstable; urgency=medium + + * Generate a deburis file with (package, version, uri) tuples, similar + to the existing debpaths. + + -- Cyril Brulebois Thu, 22 Oct 2015 12:43:35 +0200 + +debootstrap (1.0.72-1+devuan1) unstable; urgency=medium + + * Rebase on debian 1.0.70 debootstrap version + * Added Daniel Reurich in Uploaders + * Integrating Daniel Reurich patches for d-i + * Updated manpage with Daniel Reurich changes + + -- Franco (nextime) Lanza Thu, 21 May 2015 05:45:36 +0200 + +debootstrap (1.0.72) unstable; urgency=medium + + [ Iain Lane ] + * Add (Ubuntu) wily as a symlink to gutsy (closes: #787117). + + [ Colin Watson ] + * Fix resolve_deps and setup_available to work in the --foreign case + (closes: #757819, LP: #1450980). + + -- Colin Watson Tue, 28 Jul 2015 14:32:19 +0100 + +debootstrap (1.0.71-1+devuan1) unstable; urgency=medium + + * make devuan-baseconf and devuan-keyring requireds packages + * make sure we have sysvinit-core and not systemd in the chroot + + -- Franco (nextime) Lanza Fri, 01 May 2015 02:13:04 +0200 + +debootstrap (1.0.71) unstable; urgency=medium + + * Adjust sed call to render it more portable (missing ';'), making it + work with FreeBSD sed. Thanks to Nikolai Lifanov for the report and + the patch (Closes: #791802). + + -- Cyril Brulebois Fri, 10 Jul 2015 01:29:52 +0200 + +debootstrap (1.0.70-1+devuan1) unstable; urgency=medium + + * Debianization of debootstrap. + * added ceres script and link jessie and ascii to it + + -- Franco (nextime) Lanza Sat, 11 Apr 2015 08:03:36 +0200 + +debootstrap (1.0.70) unstable; urgency=medium + + * Use tr instead of (missing in d-i) xargs (Closes: #785693). Thanks, + Julian Schauder! + + -- Cyril Brulebois Tue, 19 May 2015 11:38:27 +0200 + +debootstrap (1.0.69-1+devuan1) unstable; urgency=medium + + * Fix package description. + + -- Franco (nextime) Lanza Sat, 07 Mar 2015 21:31:07 +0100 + +debootstrap (1.0.69) unstable; urgency=medium + + [ Cyril Brulebois ] + * Make sure to deduplicate package list in download_release to avoid + issues while counting downloaded packages. The failure path could lead + to printing some strange integer (Closes: #709751, #768445, #785276, + #774752). + This was reported to mostly happen whenever --no-resolve-deps is used. + * Add support for --force-check-gpg so that one can programmatically + make sure keyring checks are used and that no fallback to an https + mirror happens (Closes: #661501, #733179, #775454). + * Switch default mirror from ftp.us.debian.org to the new, official + http redirector service: httpredir.debian.org + * Make it possible to override the MAKEDEV variable (Closes: #734743). + Thanks, Wookey! + + [ Christian Perrier ] + * Update Standards to 3.9.6 (checked) + + -- Christian Perrier Mon, 18 May 2015 14:07:43 +0200 + +debootstrap (1.0.68-2+devuan1) unstable; urgency=medium + + * Added missing symlink. + + -- Franco (nextime) Lanza Sat, 07 Mar 2015 21:18:26 +0100 + +debootstrap (1.0.68-1+devuan1) unstable; urgency=medium + + * Added script for ascii. + + -- Franco (nextime) Lanza Sat, 07 Mar 2015 11:47:02 +0100 +debootstrap (1.0.68) unstable; urgency=medium + + [ Steven Chamberlain ] + * Support the jessie-kfreebsd suite, by using the same script as + jessie (a symlink to sid) (Closes: #784927). + + -- Christian Perrier Mon, 11 May 2015 07:46:19 +0200 + +debootstrap (1.0.67-1+devuan2) unstable; urgency=medium + + * Switch to quilt format + + -- Franco (nextime) Lanza Tue, 03 Mar 2015 07:44:11 +0100 + +debootstrap (1.0.67+devuan1) unstable; urgency=medium + + * Applied init freedom patch (debian bug 668001) + * moved to devuan + + -- Franco (nextime) Lanza Tue, 03 Mar 2015 07:09:36 +0100 + +debootstrap (1.0.67) unstable; urgency=medium + + [ Cyril Brulebois ] + * Apply patch by Jérémy Bobbio to support reproducible builds: specify + a modification time on the tar side, and add the -n option to gzip + (Closes: #774069). Thanks, Jérémy! + * Update setup_apt_sources to look at USE_COMPONENTS if COMPONENTS is + empty, fixing the empty sources.list bug with foreign architectures + (Closes: #732255, #773867). + + -- Christian Perrier Wed, 14 Jan 2015 07:03:17 +0100 + +debootstrap (1.0.66) unstable; urgency=low + + [ Cyril Brulebois ] + * Specify gzip compression in debian/source/options to allow for better + portability on other platforms (Closes: #770214). Thanks, Joey Hess! + * Specify gzip compression for debootstrap, and xz for debootstrap-udeb, + to mitigate the need for xz on non-Debian platforms (see: #770217). + + -- Christian Perrier Mon, 24 Nov 2014 09:15:50 +0100 + +debootstrap (1.0.65) unstable; urgency=medium + + [ Julien Cristau ] + * Add support for stretch. + + -- Christian Perrier Mon, 10 Nov 2014 09:24:56 +0100 + +debootstrap (1.0.64) unstable; urgency=medium + + * Add (Ubuntu) vivid as a symlink to gutsy. + + -- Colin Watson Mon, 20 Oct 2014 16:48:49 +0100 + +debootstrap (1.0.63) unstable; urgency=medium + + [ Joey Hess ] + * Move set -e out of shebang line. Closes: #762713 + + -- Christian Perrier Thu, 25 Sep 2014 06:44:16 +0200 + +debootstrap (1.0.62) unstable; urgency=medium + + [ Cyril Brulebois ] + * Fix reporting of package version in retrieval and validation steps + to cope with epochs. + + -- Christian Perrier Mon, 15 Sep 2014 11:40:54 +0200 + +debootstrap (1.0.61) unstable; urgency=medium + + * Fix "possibly the package $pkg is at fault" warnings to account for + changed error output in dpkg 1.17.2. + + -- Colin Watson Sun, 31 Aug 2014 22:07:49 +0100 + +debootstrap (1.0.60) unstable; urgency=medium + + [ Adam Conrad ] + * Add (Ubuntu) utopic as a symlink to gutsy. + + [ Guillem Jover ] + * Sync deb support with latest dpkg-deb (closes: #739136): + - Add uncompressed data.tar deb member support. + - Add uncompressed and xz control.tar deb member support. + + -- Colin Watson Tue, 06 May 2014 09:37:34 +0100 + +debootstrap (1.0.59) unstable; urgency=medium + + * Install ca-certificates as well as apt-transport-https for HTTPS + installations. This makes it possible to copy certificates that were + built into the installer to /usr/local/share/ca-certificates/ and thus + have them continue to be trusted after installation. + + -- Colin Watson Thu, 13 Feb 2014 13:42:54 +0000 + +debootstrap (1.0.58) unstable; urgency=medium + + * Policy version 3.9.5: no changes required. + * Install apt-transport-https if installing from an HTTPS mirror + (LP: #1135163). It may still be necessary to copy certificates into + place, but there's at least a reasonable chance that somebody installing + from HTTPS may want to keep using it, and we have to install + apt-transport-https at this point otherwise they won't be able to do + that end-to-end. + + -- Colin Watson Tue, 11 Feb 2014 17:46:41 +0000 + +debootstrap (1.0.57) unstable; urgency=medium + + * pkgdetails_perl: Only interpret percentages following whitespace, to + cope with GNU wget outputting the local file name (which may contain "%" + due to URL-encoding) after it finishes the download (LP: #1172101). + + -- Colin Watson Fri, 07 Feb 2014 16:12:23 +0000 + +debootstrap (1.0.56) unstable; urgency=low + + [ Tollef Fog Heen ] + * Install base-passwd and base-files in two calls rather than one to + avoid problems with home-built media with different ordering in + Packages. Thanks to Jo Shields for pointing this out and providing + the workaround. Closes: #601670. LP: #1001131. + + [ Joey Hess ] + * When deboostrapping Debian, and the debian-archive-keyring is not + available, switch the default mirror to a https url. This way at + least the CA level of security is available even for users who + have no way to check gpg keys in the WoT. The https mirror is + currently https://mirrors.kernel.org/debian. + * Avoid writing https urls into sources.list, as apt does not support https. + + -- Christian Perrier Mon, 30 Dec 2013 08:00:41 +0100 + +debootstrap (1.0.55) unstable; urgency=low + + [ Matthias Klose ] + * Add (Ubuntu) trusty as a symlink to gutsy. + + -- Christian Perrier Tue, 22 Oct 2013 13:43:23 +0200 + +debootstrap (1.0.53) unstable; urgency=low + + [ Dmitrijs Ledkovs ] + * Set debian source format to '3.0 (native)'. + * Bump debhelper compat level to 9. + * Set Vcs-* to canonical format. + + [ Christian Perrier ] + * Update Standards to 3.9.4 (checked) + + -- Christian Perrier Sun, 14 Jul 2013 13:06:33 +0200 + +debootstrap (1.0.52) unstable; urgency=low + + * scripts/gutsy: Make the fake initctl pass through "initctl version" + calls, used by such things as invoke-rc.d to figure out whether it's + running under Upstart (LP: #1182540). + * scripts/sid, scripts/gutsy: Add a policy-rc.d, matching that in + debian-installer-utils. This is the primary way to disable daemon + startup. + + -- Colin Watson Wed, 22 May 2013 16:55:59 +0100 + +debootstrap (1.0.51) unstable; urgency=low + + [ Scott Kitterman ] + * Add (Ubuntu) saucy as a symlink to gutsy (closes: #706989). + + [ Colin Watson ] + * Clarify location of pkgdetails.c in error message (closes: #708771). + * Resolve mount point symlinks relative to the target chroot before + unmounting them (closes: #702861, #703037, #704744). + + -- Colin Watson Sat, 18 May 2013 23:18:08 +0100 + +debootstrap (1.0.50) unstable; urgency=low + + [ Hector Oron ] + * Report package version information on package retrieve and validation. + Closes: #697675 + + -- Christian Perrier Fri, 17 May 2013 13:34:34 +0200 + +debootstrap (1.0.49) unstable; urgency=medium + + * Add support for jessie. Closes: #706788 + + -- Joey Hess Sat, 04 May 2013 23:37:52 -0400 + +debootstrap (1.0.48) unstable; urgency=low + + * Team upload + + [ Julien Cristau ] + * Disable InRelease support. gpgv won't give us back the signed data, and + full gpg is not available inside d-i (closes: #703889). + * Move extract_release_components to after signature verification. + Suggested by Ansgar Burchardt. + + -- Didier Raboud Thu, 04 Apr 2013 16:17:57 +0200 + +debootstrap (1.0.47) unstable; urgency=low + + * Team upload + * Properly decrypt the InRelease file when downloading from an archive + where InRelease is used. This longstanding bug was masked by former + APT behaviour and was revealed only with recent APT versions + Closes: #703146 + Thanks to Michael Vogt for the analysis and patch + * Add a dependency on gpg because of the above change. + + -- Christian Perrier Wed, 20 Mar 2013 21:34:29 +0100 + +debootstrap (1.0.46) unstable; urgency=low + + * Team upload. + * Use `which` to find out sh only if /bin/sh does not exist. + + -- Samuel Thibault Thu, 27 Dec 2012 15:47:16 +0100 + +debootstrap (1.0.45) unstable; urgency=low + + [ Joey Hess ] + * Better support use on Android by not hardcoding /bin/sh + in a test file that's created, and instead putting in the + actual path to sh. Closes: #694310 Thanks, Shawn Landden + + -- Christian Perrier Sat, 22 Dec 2012 12:56:32 +0100 + +debootstrap (1.0.44) unstable; urgency=low + + * Remove double quotes to fix for loop on GNU/kFreeBSD, thanks to + Oleg Ginzburg (Closes: #693718). + + -- Cyril Brulebois Tue, 20 Nov 2012 23:55:53 +0100 + +debootstrap (1.0.43) unstable; urgency=low + + [ Joey Hess ] + * Fix "arc" typo. Closes: #686680 + + [ Colin Watson ] + * Add (Ubuntu) raring as a symlink to gutsy. + + [ Christian Perrier ] + * Add myself to Uploaders and drop Anthony Towns who is no + longer active in debootstrap maintenance for a few years. Thanks + for your work, Anthony. + * Bump Standards to 3.9.3 (checked) + * Replace XC-Package-Type by Package-Type in debian/control + + -- Christian Perrier Sat, 27 Oct 2012 12:46:46 +0200 + +debootstrap (1.0.42) unstable; urgency=low + + * Downgrade the absence of an InRelease file from a warning to an info + message. For now, debootstrap can cope fine without, and it's possible + there are Debian mirrors that don't have InRelease; Ubuntu doesn't quite + have InRelease support yet either (LP: #1017398). + + -- Colin Watson Tue, 03 Jul 2012 15:34:57 +0100 + +debootstrap (1.0.41) unstable; urgency=low + + [ Mehdi Dogguy ] + * Add support for InRelease files (Closes: #638682) + + -- Joey Hess Thu, 21 Jun 2012 13:16:22 -0400 + +debootstrap (1.0.40) unstable; urgency=low + + [ Joey Hess ] + * When installation or configuration of a package fails, output a message + that points the user to the log file. Attempt to grep out the first + package that dpkg failed on and show its name too. Closes: #472704 + + [ Colin Watson ] + * Add (Ubuntu) quantal as a symlink to gutsy. + + -- Colin Watson Thu, 26 Apr 2012 17:44:44 +0100 + +debootstrap (1.0.39) unstable; urgency=low + + * Retry corrupted downloads rather than carrying on almost regardless. + Patch mostly due to Michael Gilbert, rearranged somewhat by me (closes: + #618920). + * Stop at the end of the retrieval phase if any packages failed to + download. + + -- Colin Watson Tue, 13 Mar 2012 17:21:13 +0000 + +debootstrap (1.0.38) unstable; urgency=low + + [ Joey Hess ] + * Improve error message when a decompressor is not available, + to indicate which package has been built with bzip today. + Closes: #644719 + + [ Otavio Salvador ] + * Fix --print-debs support when using --foreign param. Closes: + #551837. + + [ Colin Watson ] + * pkgdetails_perl: Use the last of a sequence of stanzas for the same + package name, rather than the first (closes: #649319). + + -- Colin Watson Mon, 21 Nov 2011 13:20:53 +0000 + +debootstrap (1.0.37) unstable; urgency=low + + * Add (Ubuntu) precise as a symlink to gutsy. + + -- Colin Watson Wed, 05 Oct 2011 21:58:37 +0100 + +debootstrap (1.0.36) unstable; urgency=low + + * Guess host OS based on uname for non-Debian systems. Closes: #637363 + * Clarify "target" in usage message. + * Fix support for running debootstrap on a FreeBSD host to create a kFreeBSD + chroot or jail. Thanks, Arno Toell. + * Search PATH for programs, rather than checking hardcoded locations. + * Support using md5 and shaN programs, as found on FreeBSD, in addition + to md5sum and shaNsum. + * When FreeBSD (not kfreebsd) is the host, don't chroot to mount special + filesystems. + * When debootstrapping on FreeBSD, warn if necessary modules are not + loaded. Thanks, Arno Toell. + * Workaround for umount bug #634107, which broke pbuilder and "debootstrap ." + Closes: #631087 + + -- Joey Hess Sun, 21 Aug 2011 18:39:26 -0400 + +debootstrap (1.0.35) unstable; urgency=low + + [ Robert Millan ] + * Don't build devices.tar.gz if building on GNU/kFreeBSD (closes: + #637297). + * Don't use --arch when we specifically care about the host architecture + (closes: #637298). + + -- Colin Watson Wed, 10 Aug 2011 13:04:41 +0100 + +debootstrap (1.0.34) unstable; urgency=low + + * Add more information regarding the version and architecture in case + a download fails. Closes: #633625. + * add /usr/sbin and /sbin to PATH for fakechroot variant. Closes: + #588773 + * Move setup_devices to second stage of bootstrap. Closes: #498731, + #531316 + + -- Otavio Salvador Thu, 28 Jul 2011 19:13:10 +0200 + +debootstrap (1.0.33) unstable; urgency=low + + [ Joey Hess ] + * Mention minbase variant in --help. Closes: #632418 + * Use md5sums for sarge, which did not consistently have sha1sums + everywhere. Closes: #633158 + + [ Colin Watson ] + * Improve text of error message when decompression command is not + available. + + -- Otavio Salvador Sun, 24 Jul 2011 10:33:56 +0200 + +debootstrap (1.0.32) unstable; urgency=low + + * Use md5sums for woody and potato, which only had those checksums + in the Packages files. Closes: #627365 + + -- Joey Hess Mon, 30 May 2011 13:57:46 -0400 + +debootstrap (1.0.31) unstable; urgency=low + + [ Mark Hymers ] + * Don't use the Build-Essential: yes field in Debian, use the + build-essential package. Closes: #619700. + + [ Colin Watson ] + * If ubuntu-keyring is installed, check Release signatures against it when + bootstrapping Ubuntu gutsy and later. + * Recommend ubuntu-keyring rather than debian-archive-keyring on + Ubuntu-derived systems. + + -- Colin Watson Fri, 20 May 2011 09:45:48 +0100 + +debootstrap (1.0.30) unstable; urgency=low + + [ Joey Hess ] + * Recommend debian-archive-keyring, and if it is installed, + default to checking gpg signatures of the Release file against it + when bootstrapping sid, squeeze, wheezy, etch, and lenny. + Closes: #560038 + * Add --no-check-gpg option that can be used to disable release file + verification. Closes: #624229 + * Needs base-installer 1.117. + * Add a warning message if the keyring file is not available, and + --no-check-gpg is not specified. + * Clear all global variables used for options, so that unclean + environment doesn't break debootstrap. Closes: #621657 + * Removed the --boot-floppies switch and mode. Assuming this has + not been used in 10 years. + + [ Colin Watson ] + * Resolve dependencies from all requested components (LP: #740167). + + -- Joey Hess Tue, 26 Apr 2011 17:10:00 -0400 + +debootstrap (1.0.29) unstable; urgency=low + + [ Joey Hess ] + * Support bootstrapping oldstable. (Lenny could already be bootstrapped + using that suite name.) + + [ Colin Watson ] + * Add (Ubuntu) oneiric as a symlink to gutsy. + + -- Colin Watson Tue, 22 Mar 2011 10:58:49 +0000 + +debootstrap (1.0.28) unstable; urgency=low + + [ Miguel Figueiredo ] + * Fix for ar usage, thanks to Guillem Jover. Closes: #598729 + + [ Joey Hess ] + * Remove 5 second sleeps when debootstrap finds additional required + dependencies. d-i just got that much faster. + * Use SHA checksums. Defaulting to SHA256, and configurable by + SHA_SIZE environment variable. Closes: #614315 + * If a sha256sum program is not available, fall back to sha1sum. + This is to support debootstrap use on embedded systems, which are more + likely to have the latter. + * Avoid new(?) warning from dpkg about missing Maintainer field when + feigning install of a package. + + -- Joey Hess Mon, 21 Feb 2011 20:48:46 -0400 + +debootstrap (1.0.27) unstable; urgency=low + + [ Miguel Figueiredo ] + * Fix bug and typo on --private-key + Patch by Jonathan Klee. + + [ Jeremie Koenig ] + * Hurd support: + - Use the newer setup-translators script and firmlink + $TARGET/{dev,servers} in setup_devices_hurd; + - Don't attempt to build devices.tar.gz, which is not needed. + + -- Otavio Salvador Mon, 07 Feb 2011 19:40:24 -0200 + +debootstrap (1.0.26) unstable; urgency=low + + [ Christian Perrier ] + * Consistently use tab indenting in scripts/gutsy and scripts/sid + Patch by Karl Goetz. Closes: #601821 + * Fix a typo in the debootstrap script + Patch by Karl Goetz. Closes: #601822 + + [ Joey Hess ] + * sid: Remove old workaround for etch era coreutils/textutils md5sum + diversion problem. (#329394) + + -- Otavio Salvador Fri, 12 Nov 2010 10:07:41 -0200 + +debootstrap (1.0.25) unstable; urgency=low + + * Remove debug statement that slipped in. + * Add test to guard against devices.tar.gz being empty. + * /dev/MAKEDEV cannot be relied on (udev likes to make it a symlink to + true). Always use /sbin/MAKEDEV. Closes: #598080 + + -- Joey Hess Sun, 26 Sep 2010 13:18:31 -0400 + +debootstrap (1.0.24) unstable; urgency=low + + [ Miguel Figueiredo ] + * Apply patches from by Jonathan Klee and Guillaume Chauvel + to add support to https (closes: #521196). + + [ Colin Watson ] + * Add (Ubuntu) natty as a symlink to gutsy. + + [ Joey Hess ] + * Add support for wheezy. Closes: #597461 + + -- Joey Hess Sun, 19 Sep 2010 21:40:00 -0400 + +debootstrap (1.0.23) unstable; urgency=low + + * Add (Ubuntu) maverick as a symlink to gutsy. + * Add ${misc:Depends}. + + -- Colin Watson Wed, 19 May 2010 13:35:34 +0100 + +debootstrap (1.0.22) unstable; urgency=low + + * Redo release since it ended up with testing directory in tar.gz. + + -- Otavio Salvador Mon, 22 Feb 2010 16:52:49 -0300 + +debootstrap (1.0.21) unstable; urgency=low + + [ Otavio Salvador ] + * Apply patch from Clint Adams to add support for + gz/bz2/xz data.tar (closes: #458663). + + [ Guillem Jover ] + * Refactor deb extractors into two new functions. + * Use dpkg-deb if available instead of ar (closes: #557296). + * Add an --extractor option to override the automatic extractor selection. + + [ Otavio Salvador ] + * Document new --extractor option in manpage. + * Apply patch from Vagrant Cascadian not + fail if resolv.conf is a broken symlink (closes: #390647). + + [ Frans Pop ] + * Use tab indentation in scripts/debian/sid to reduce its size (relevant + for Debian Installer). + * Add apt to base packages for the buildd variant as it is no longer marked + Build-Essential. + + [ Otavio Salvador ] + * Apply patch from Andres Salomon to honor + --components when using mirror_style 'main' (closes: #561283). + * Apply patch from Andres Salomon to fix + iteration through components in download_main (closes: #561298). + + [ Joey Hess ] + * Allow the suite to be stable, testing, or unstable when debootstrapping + Debian. Closes: #288109 + * Make scripts directory in source tree look like installed directory, + and add a section to README explaining an easy way to run + debootstrap w/o installing it. Closes: #345762 + * Convert rules file to use dh with overrides. + * Remove binary-basedebs target from debian/rules. + This target has been broken in multiple ways since 2007. While I + accidentially partially fixed it with the above changes, this is evidence + it's dead code that can be safely removed. + + -- Otavio Salvador Sun, 21 Feb 2010 23:11:06 -0300 + +debootstrap (1.0.20) unstable; urgency=low + + * For recent Ubuntu versions, move $TARGET/sbin/initctl aside in the same + way we do start-stop-daemon, so that attempts to control Upstart jobs + won't inadvertently affect jobs in the host system. + * Rename EXAMPLE section in debootstrap(8) to EXAMPLES (closes: #548458). + + -- Colin Watson Sun, 04 Oct 2009 21:23:07 +0100 + +debootstrap (1.0.19) unstable; urgency=low + + * Ignore failures from dpkg --predep-package. It exits 1 if there are no + suitable packages available, which isn't an error for us, but in_target + complains anyway, so just use in_target_nofail; the termination + condition is handled immediately afterwards anyway. + + -- Colin Watson Thu, 24 Sep 2009 19:57:05 +0100 + +debootstrap (1.0.18) unstable; urgency=low + + * Only use dpkg from the chroot, as there is no guarantee dpkg is + available outside of the chroot (d-i installation for example). + + -- Aurelien Jarno Wed, 23 Sep 2009 11:37:01 +0200 + +debootstrap (1.0.17) unstable; urgency=low + + * Remove boneheaded use of sudo left over from testing (closes: #547949). + + -- Colin Watson Tue, 22 Sep 2009 20:10:19 +0100 + +debootstrap (1.0.16) unstable; urgency=low + + [ Colin Watson ] + * Cope with pre-dependencies of included packages that aren't in Priority: + required (closes: #487908). + * Upgrade to debhelper v7. (Override rules get pretty hairy for this + package, so I haven't switched to dh(1).) + * Use ports.ubuntu.com as default mirror on sparc for Ubuntu hardy and + beyond (LP: #431145). + * Add (Ubuntu) lucid as a symlink to gutsy. + + [ Frans Pop ] + * Makefile: remove unused ARCH variable. + + -- Colin Watson Mon, 21 Sep 2009 16:28:40 +0100 + +debootstrap (1.0.15) unstable; urgency=low + + * On Linux, clear out /etc/mtab on exit if it's not a symlink. Should fix + problems Wouter Verhelst and Martin Michlmayr are seeing with + initramfs-tools MODULES=dep, although it probably isn't a perfect + solution. + + -- Colin Watson Thu, 23 Jul 2009 16:45:00 +0100 + +debootstrap (1.0.14) unstable; urgency=low + + * Apply patch from Felix Zielcke to use "dpkg + --print-architecture" to avoid deprecation warning. Closes: #531680. + * Reference squeeze instead of sarge in manpage. Based on a patch from + Geoff Simmons . Closes: #534575. + * Apply patch from Riku Voipio to add support for + scratchbox variant. Closes: #536820. + + -- Otavio Salvador Wed, 22 Jul 2009 12:34:54 -0300 + +debootstrap (1.0.13) unstable; urgency=low + + [ Otavio Salvador ] + * Apply patch from Luca Favatella to improve + coding style. + + [ Colin Watson ] + * Add (Ubuntu) karmic as a symlink to gutsy. + + -- Colin Watson Fri, 24 Apr 2009 20:08:24 +0100 + +debootstrap (1.0.12) unstable; urgency=low + + [ Otavio Salvador ] + * Improve code to choose between libc packages. Thanks to Luca Favatella + for first version of the patch. + + [ Colin Watson ] + * Remove partial support for emitting translated progress messages with + gettext. Don't panic; d-i still has all the support necessary for this. + debootstrap's own support for doing this outside d-i with gettext's + shell bindings has been completely broken ever since it was added in + 2003, though, and nobody has complained. Fixing it would require a big + pile of infrastructure and some non-trivial patches, plus arranging to + copy all the translations over from base-installer, and it just doesn't + seem worth it, so lose the cruft (LP: #188690). + * Export PATH, just to make sure. It isn't necessarily exported by shells + running from init=/bin/sh or similar, and the upstream bash maintainer + is unwilling to export it by default; it's easy enough to do so here + (LP: #320188). + + -- Colin Watson Tue, 17 Mar 2009 16:38:46 +0000 + +debootstrap (1.0.11) unstable; urgency=low + + * Add (Ubuntu) jaunty as a symlink to gutsy. + * Clarify that --second-stage is needed to complete the bootstrapping + process after --foreign. + * Fix --make-tarball= option (closes: #484869). + * Fix old Debian scripts and all Ubuntu scripts to cope with Anthony's + change in 1.0.8 to make --second-stage not bother recalculating required + and base. + * Rename 'repeat' to 'repeatn', since 'repeat' is a reserved word in zsh; + although strictly speaking this seems like an incompatibility in zsh + when linked to /bin/sh (closes: #340058). + * Fix --unpack-tarball= option (thanks, Torsten Landschoff; closes: + #500759). + * Fix handling of relative DEBOOTSTRAP_DIR (thanks, Mikhail Gusarov; + closes: #503460). + * Cope with ancient versions of chroot(8) that don't call chdir() (thanks, + Patrik Arvhult; closes: #350635). + * Recommend gnupg for --keyring option (thanks, Robert Millan; closes: + #467571). + * Note that you can't --include packages with non-required Pre-Depends + (see #487908). + * Mention /sys in EXAMPLE section of manual page, and use "defaults" + rather than "none" as the mount options for /proc (thanks, Raúl Sánchez + Siles; closes: #410787). + * Add /dev/console to devices.tar.gz (after all, MAKEDEV's 'consoleonly' + was added for boot-floppies in the first place; see + https://lists.ubuntu.com/archives/ubuntu-devel/2009-January/027230.html). + * Add support for squeeze (closes: #513488). + + -- Colin Watson Wed, 18 Feb 2009 23:46:12 +0000 + +debootstrap (1.0.10) unstable; urgency=low + + [ Joey Hess ] + * Avoid "broken pipe" errors in bootstrap.log from the the smallyes function. + The errors themselves are inherent to how the function is used, so just + suppress them. Closes: #480560. + + [ Frans Pop ] + * Do not cache Release and Release.gpg files. Closes: #488424. + * Abort if a Packages file failed to verify. + * Update standards version to 3.8.0; no other changes needed. + + -- Frans Pop Wed, 02 Jul 2008 17:44:25 +0200 + +debootstrap (1.0.9) unstable; urgency=low + + [ Frans Pop ] + * Error out on unrecognized options to avoid invalid options to be + recognized as arguments. + + [ Colin Watson ] + * Use 'chown 0:0' in all scripts rather than deprecated 'chown 0.0' + (thanks, Evan Klitzke). + * Add (Ubuntu) intrepid as a symlink to gutsy. + + -- Colin Watson Tue, 29 Apr 2008 19:36:19 +0100 + +debootstrap (1.0.8) unstable; urgency=low + + [ Frans Pop ] + * Change Priority for the udeb to extra in line with overrides file. + + [ Colin Watson ] + * Partially revert r50134; there are people who depend on being able to + use the "upstream" Makefile on non-Debian systems. Create necessary + directories in the Makefile rather than relying on dh_installdirs to do + it (LP: #172645). + * Use ftp.us.debian.org rather than ftp.debian.org + (http://lists.debian.org/debian-devel-announce/2007/12/msg00002.html). + + [ Anthony Towns ] + * Add minbase variant for the sid script that only install apt (and + its dependencies) instead of all of base. (Closes: Bug#351912, + Bug#452654) + * Make --second-stage not bother recalculating required and base as + it's not needed. + * Make --arch and other arguments accept both "--arch i386" and + "--arch=i386" forms of specifying a parameter to avoid the + inconsistency. + + [ Stephen R. Marenka ] + * Allow installation of etch-m68k. (Closes: Bug#458965) + + [ Colin Watson ] + * Add minbase variant for Ubuntu gutsy/hardy; see Anthony's change above. + * Minor manual page formatting improvements. + + -- Colin Watson Tue, 15 Jan 2008 11:19:34 +0000 + +debootstrap (1.0.7) unstable; urgency=low + + * No longer include full devices tarball in udeb. + * Also try 'udpkg --print-architecture' when determining the target + architecture. + * Utility pkgdetails moved from debootstrap-udeb to bootstrap-base so that + the udeb can become 'Architecture: all'. + * Change /usr/lib/debootstrap to /usr/share/debootstrap. Closes: #430615. + * Use tab indentation in debootstrap and functions saving 3kB (relevant for + Debian Installer). + * Fix various inconsistencies in build scripts. + * Fix dpkg-genchanges warning 'missing Priority for source files'. + * Update Standards-Version to 3.7.2. No changes needed. + * Changes in udeb require base-installer 1.85. + + -- Frans Pop Wed, 14 Nov 2007 12:15:45 +0100 + +debootstrap (1.0.6) unstable; urgency=low + + * Ensure that the target directory exists in check_sane_mount. + * Don't ignore 'make clean' errors. (The Makefile is always present.) + + -- Colin Watson Sun, 21 Oct 2007 10:50:59 +0100 + +debootstrap (1.0.5) unstable; urgency=low + + [ Colin Watson ] + * Don't rely on GNU sed's s///I extension (closes: #350583). + + [ Joey Hess ] + * Skip the noexec/nodev test when running --print-debs or other operations + that do not involve building systems. + + -- Joey Hess Sat, 20 Oct 2007 23:10:34 -0400 + +debootstrap (1.0.4) unstable; urgency=low + + [ Neil Williams ] + * Add --second-stage-target option that allows embedded to test for + installations in a chroot on the device (closes: #445157). + + [ Colin Watson ] + * Add (Ubuntu) hardy as a symlink to gutsy. + * Unmount /lib/init/rw on exit (closes: #391604). + * Cope if uncompressed Packages is missing from Release (closes: #402380). + * Don't rely on XSI test(1) extensions. + * Add support for ssh:/// URLs (thanks, Steffen Joeris; closes: #434893). + * Fix Ubuntu hoary and breezy scripts to unmount /dev etc. on exit + (closes: #327708). + * Emit an error if we cannot create working devices or executables on the + target (based on work by Bastian Kleineidam; closes: #233798). + + -- Colin Watson Fri, 19 Oct 2007 14:57:37 +0100 + +debootstrap (1.0.3) unstable; urgency=low + + * Ignore errors when unmounting filesystems, to avoid stopping at the + first one with problems. + + -- Colin Watson Tue, 21 Aug 2007 12:32:37 +0100 + +debootstrap (1.0.2) unstable; urgency=low + + [ Joey Hess ] + * Document --components in man page. + * Update man page, as packages listed in --include should now be auto + dep-resolved by default. + + [ Colin Watson ] + * Extensive quoting fixes, allowing installation to a target containing + spaces (closes: #387673). + * scripts/debian/sid: Handle libc0.3 on hurd-i386 (thanks, Michael Banck; + closes: #314304). + * functions: Stub out /proc setup and add device setup for the Hurd + (thanks, Michael Banck; closes: #314311). + * Add --version option (closes: #294484). + + [ Otavio Salvador ] + * Fix bunzip2 path. Thanks Martín Ferrari by + the patch (closes: #436218). + + -- Otavio Salvador Tue, 07 Aug 2007 20:12:55 -0300 + +debootstrap (1.0.1) unstable; urgency=low + + * scripts/ubuntu/gutsy: Determine buildd variant dynamically using + Build-Essential: yes. + * scripts/ubuntu/gutsy.fakechroot: Remove devmapper postinst hack, no + longer needed. + * scripts/ubuntu/*.fakechroot: Merge into the corresponding main scripts + as variants. + + -- Colin Watson Fri, 20 Jul 2007 11:55:22 +0100 + +debootstrap (1.0.0) unstable; urgency=low + + [ Anthony Towns ] + * Make debootstrap team maintained under the d-i banner. + * Add Joey, Frans and Junichi as uploaders, remove JHM (not in the + d-i group). + * Make pkgdetails.c not need C99 extensions. (Closes: Bug#398977) + * Fix am_doing_phase implementation in debootstrap script. Thanks to + Tero Janka for spotting the problem and the fix. (Closes: Bug#409881) + + [ Joey Hess ] + * Drop support for sarge from the udeb. + * Update README.Debian: + - One todo item is done. (I think cross-strap is too, but unsure.) + - Reword NMU policy to note that it's team-maintained now. + * ACK my prior NMU. Closes: #418600 + * If /dev/MAKEDEV DNE, as on certain s390 machines, use /sbin/MAKEDEV. + Closes: #420908 + Note that /dev/MAKEDEV is still the correct location, and is still tried + first so that building works on all FHS systems, as noted in #190239. + + [ Colin Watson ] + * Add support for Ubuntu dapper (Closes: #342838), edgy, feisty, and + gutsy. Exclude everything but gutsy from the udeb. + * Fix "deboostrap" typo in debootstrap(8) (thanks, Adam Conrad). + * Fix "htp" typo in temporary /etc/apt/sources.list. + * Drop support for woody from the udeb too. + * When removing $TARGET/debootstrap, debootstrap.log is still open as + stdout/stderr and needs to remain so, but after unlinking it some NFS + servers implement this by a temporary file in the same directory, which + makes it impossible to rmdir that directory. Moving it instead works + around the problem (thanks, Steven McCoy; + https://launchpad.net/bugs/65003). + * Fix formatting error in debootstrap(8) (.R is not a macro). + * Reorganise scripts into scripts/debian/ and scripts/ubuntu/ directories + in the source tree to declutter the top level. + * Add default_mirror function; reorganise the debootstrap script a little + so that it works. Set the default mirror for Ubuntu suites to + http://archive.ubuntu.com/ubuntu, and the default mirror for Debian + etch/lenny/sid architectures other than amd64 and i386 to + http://ftp.us.debian.org/debian (per ajt; see bug #363049). + * Add devices created by fd to devices-std.tar.gz, so that + /dev/std{in,out,err} is available conveniently in chroots with /proc and + /dev/pts mounted (thanks, Matthias Klose). + * Document --keyring and --make-tarball. (Closes: #368988) + * Update Ubuntu mirrors: warty/hoary/breezy => old-releases.ubuntu.com, + unsupported architectures => ports.ubuntu.com. + * Add myself to Uploaders. + * Bump to 1.0.0. Nobody uses debootstrap in production, do they? + + [ Joey Hess ] + * Remove the extended package description (aka bloat) from the udeb. + + -- Colin Watson Sat, 23 Jun 2007 02:19:27 +0100 + +debootstrap (0.3.3.3) unstable; urgency=low + + * NMU + * Add support for lenny. + + -- Joey Hess Tue, 10 Apr 2007 15:24:15 -0400 + +debootstrap (0.3.3.2) unstable; urgency=low + + * NMU with maintainer approval + * Remove --force-auto-select option for 'sid' script as it is no longer + supported by dpkg. Closes: #409527. + + -- Frans Pop Fri, 16 Feb 2007 20:43:36 +0100 + +debootstrap (0.3.3.1) unstable; urgency=low + + * NMU with maintainer approval + * functions/get_debs: build list of available packages from all specified + sources; this allows debootstrap to also use e.g. custom versions of base + packages from a source of local packages included on an installation CD. + Closes: #398762. + + -- Frans Pop Thu, 16 Nov 2006 05:30:43 +0100 + +debootstrap (0.3.3) unstable; urgency=low + + * Include kFreeBSD and fakechroot support from 0.3.2.1 and 0.3.2.2 NMUs, + thanks to Otavio Salvador and Piotr Roszatycki. (Closes: Bug#319100, + Bug#328446, Bug#204652, Bug#315044, Bug#Bug#319799) + + * Require target to be specified in all cases; document usage of target + for --print-debs. (Closes: Bug#335922, Bug#337230) + + * Use ln -sf when symlinking awk for woody and sarge. (Closes: Bug#299048) + + -- Anthony Towns Sun, 6 Nov 2005 04:12:39 +1000 + +debootstrap (0.3.2.2) unstable; urgency=low + + * NMU + * Added relicensed fakechroot variant. Closes: #204652. + + -- Piotr Roszatycki Sat, 29 Oct 2005 11:29:00 +0200 + +debootstrap (0.3.2.1) unstable; urgency=low + + * NMU with maintainer approval + * Applied patch from Robert Millan to add support to + Debian GNU/kFreeBSD. Closes: #319799 + + -- Otavio Salvador Fri, 28 Oct 2005 16:14:57 -0200 + +debootstrap (0.3.2) unstable; urgency=low + + * Revert fakechroot NMUs (0.3.1.1, 0.3.1.3, 0.3.1.7) due to incompatible + license requirements (GPL) (Reopens: Bug#204652) + + * Changes from 0.3.1.2 NMU, thanks to Joey Hess: (Closes: Bug#314810) + + Fix incorrect use of "$@" in local. Closes: #314157, #314547 + + Fix fd redirection in download progress code. See #314373 + + Remove md5sums file from udeb. Closes: #314378 + + Fix debian-installer mode warning code. Closes: #314340 + + * Changes from 0.3.1.4 NMU, thanks to Joey Hess: + + Wrap eval statement in exit_function in parens, working around + bug #315444 in busybox sh. Closes: #314373 + + * Changes from 0.3.1.5 NMU, thanks to Anibal Monsalve Salazar: + + Fixed "--variant=buildd option does not work" for pbuilder, + closes: #314858. Patch by Matt Kraai . + + * Changes from 0.3.1.6 NMU, thanks to Joey Hess: + + Patch from Colin to redirect status messages to stderr when running + --print-debs. Closes: #315875 + + Restore logging to stderr in debian-installer mode. Closes: #314160 + + * Changes from 0.3.1.8 NMU, thanks to Petter Reinholdtsen: + + [functions] Mount /sys if it exist and is supported by the kernel. + Patch from Cajus Pollmeier, Colin Watson and Ubuntu. (Closes: #289105) + + [debootstrap] Document --resolve-deps in usage info. (Closes: #328161) + + [etch] Replace libsigc++-1.2-5c102 with libsigc++-1.2-5c2. (Closes: #334506) + + [etch] Remove pppoe from base, and only install + ipchains on m68k. Patch from Sven Luther. (Closes: #239390) + + [sarge] Remove duplicate entries for m68k and amd64. Patch from + Frans Pop. (Workaround for bug #319777) + + [etch] Add support for ppc64. The patch for 'sid' did no longer + apply. Patch from Andreas Jochens. (Closes: #313353) + + [sarge,etch,sid] Set DEBCONF_NONINTERACTIVE_SEEN=true during build, to + avoid questions during upgrade. (Closes: #238301) + + Add script for breezy. Patch from Colin Watson. (Closes: #315940) + + * Changes from 0.3.1.9 NMU, thanks to Joey Hess: + + Replace the etch script with a copy of the sid script, which pulls in + gnupg, so the installed etch system has a usable apt. Closes: #334521 + + * Create /dev/ptmx in minimal devices tarball. (Closes: Bug#317072) + + * Don't create empty available files, since old dpkg and new kernels can't + deal with them. (Closes: Bug#308169, Bug#329468) + + * Bump Standards-Version. Bump debhelper compatability level to 4. + * Cleanup debian/rules, thanks to Joey Hess. (Closes: Bug#314863) + + * Emit error message if no pkgdetails is available. (Closes: Bug#326831) + + * Turn on --resolve-deps by default. Add --no-resolve-deps as an option. + Combined with the previous changes to make the etch script dynamically + determine base, this should resolve all the "can't install " + bugs. (Closes: Bug#280210, Bug#308361, Bug#318281, Bug#323362, + Bug#318254, Bug#313292, Bug#334683, Bug#248578, Bug#289635) + + * md5sum doesn't exist when coreutils is unpacked but not configured; + cp it across so it's available for --second-stage. (Closes: Bug#329394) + + * Catch failures in "dpkg --status-fd" (Closes: Bug#317447, Bug#323661) + + * Make "without" work right for duplicates (Closes: Bug#316884, + Bug#319777) + + * Simplify and correct file descriptor handling and debootstrap.log + behaviour. + + * Delete $TARGET with --print-debs and --make-tarball. (Closes: Bug#328369) + + * Add a --make-tarball option. (Closes: Bug#152845) + + * Create a default sources.list for apt. (Closes: Bug#283234, Bug#315225) + + * Update manpage to talk about woody instead of sarge. (Closes: Bug#315862) + + * Use partial/ directory when downloading. (Closes: Bug#109176) + + -- Anthony Towns Sun, 23 Oct 2005 14:49:08 +1000 + +debootstrap (0.3.1) unstable; urgency=low + + * sid script updated: + - Determine base dynamically (Priority: required for required packages, + Priority: important for base packages, Build-Essential: yes for buildd + variant base). (Closes: Bug#88984, Bug#193134) + - Use fine grained dpkg progress display, thanks again to Colin Watson. + (Closes: Bug#229314, Bug#231109, Bug#244563) + + * dpkg output (etc) goes to /var/log/bootstrap.log in the target, rather + than stdout. This is probably difficult for frontends to capture + at present. + + * Parsing of Packages file sped up. (Yay!) + + * debootstrap.deb now arch: all (Closes: Bug#122465, Bug#131552) + - perl implementation of pkgdetails used by preference + - devices.tar.gz reduced to minimal set of devices; frontends should + setup udev or supply their own devices or similar in future + - /usr/lib/debootstrap/arch not shipped + - none of the above applies to udebs yet; though the devices.tar.gz + change will eventually + + * Support for verifying based on Release.gpg files (--keyring). Thanks + to Colin Watson. (Closes: Bug#313383) + + -- Anthony Towns Tue, 14 Jun 2005 00:22:55 +1000 + +debootstrap (0.3.0) unstable; urgency=low + + * The Gernot Heiser release, dedicated to everyone who drinks enough to + lose their better judgement, and those of us who didn't have any in + the first place. + + * Major update. New features: + + Use $TARGET/debootstrap directory for state info + (--keep-debootstrap-dir) + + Support for cross-strapping (--foreign / --second-stage) + (Closes: Bug#202529) + + Support for resolving dependencies (--resolve-deps) + + Support for Debian etch, and Ubuntu warty and hoary (Closes: Bug#312417) + + Support for handling variants within the main suite script + + Support for other versions of base packages in /v/c/apt/archives + + Initial support for fine-grained dpkg progress display, thanks to + Colin Watson (currently only for warty and hoary) + + Initial support for determining base system dynamically. + + No longer display "debootstrap.invalid" when working with + Release/Packages files. (Closes: Bug#241795, Bug#256255) + + Ignores failures for on_exit cleanup commands. (Closes: Bug#253387, + Bug#253468, Bug#308774) + + Early reporting of unavailable packages. + + More efficient parsing of Packages files. + + Generalised additions and exclusions. (Closes: Bug#191793) + + Handles symlinked configuration files in /etc a little better. + (Closes: Bug#161987, Bug#252907, Bug#272257) + + * Dropped support for slink. + + * Use ln -fs for mawk/awk link. (Closes: Bug#248398, Bug#258524) + + * Dropped mail-transport-agent, and hence mailx and at from sid/etch base. + (Closes: Bug#168473) + * Dropped ipchains for i386 (Closes: Bug#266119) + * Other minor changes to meet dependencies, also. (Closes: Bug#312701) + + * Minor manpage fixes. (Closes: Bug#285777) + * Add check for specifying no components (CloseS: Bug#283810) + + * Include 0.2.45 NMUs, thanks to Steve Langasek. + (Closes: Bug#295571, Bug#283752, Bug#278158) + + -- Anthony Towns Sun, 12 Jun 2005 23:49:58 +1000 + +debootstrap (0.2.45-0.2) unstable; urgency=low + + * Non-maintainer upload. + * [sarge, sid] Replace libparted1.6-0 with libparted1.6-12 for ia64, + to keep up with the ABI changes for that package. (Closes: #295571) + * [sarge, sid] include pciutils on hppa as well, per request of the + hppa folks. (Closes: #283752) + + -- Steve Langasek Fri, 25 Feb 2005 22:23:30 -0800 + +debootstrap (0.2.45-0.1) unstable; urgency=low + + * Non-maintainer upload. + * [sarge, sid] Drop libgnutls10 and libgcrypt7, since they are no + longer needed by exim4. (Closes: #278158). + + -- Steve Langasek Thu, 20 Jan 2005 21:20:22 -0800 + +debootstrap (0.2.45) unstable; urgency=high + + * Acknowledge NMUs. (Closes: #270135) + * [woody.buildd] Corrected ia64 special cases. Patch by Brett Johnson + . (Closes: #271894) + + -- J.H.M. Dassen (Ray) Sat, 18 Sep 2004 13:49:23 +0200 + +debootstrap (0.2.44.2) unstable; urgency=low + + * NMU again, this time using the makedev in unstable instead of the + experimental so devices.tar.gz isn't empty on ia64... oops... /o\ + + -- Bdale Garbee Tue, 14 Sep 2004 20:03:56 -0600 + +debootstrap (0.2.44.1) unstable; urgency=low + + * NMU to resolve d-i inability to install sid on ia64 + * add pciutils to the base package list for ia64, to avoid having to regress + efibootmgr in unstable, closes: #270315, #268490 + + -- Bdale Garbee Mon, 13 Sep 2004 15:11:11 -0500 + +debootstrap (0.2.44) unstable; urgency=high + + * [sarge] Removed "gcc-3.0-base" and "libstdc++3" for HPPA as they have been + removed from sarge as well on that arch. (Closes: #268917) + + -- J.H.M. Dassen (Ray) Mon, 30 Aug 2004 08:53:30 +0200 + +debootstrap (0.2.43) unstable; urgency=high + + * [sarge] Added back libgnutls10 in order not to break d-i testing. + (Closes: #268578, #268663). + + -- J.H.M. Dassen (Ray) Sun, 29 Aug 2004 09:08:48 +0200 + +debootstrap (0.2.42) unstable; urgency=high + + * Acknowledge NMUs. (Closes: #262137, #262165, #262178, #262375) + * [sarge] Switch to libgnutls11 so exim4 can switch. (Closes: #268325) + * [sid] Removed "gcc-3.0-base" and "libstdc++3" for HPPA as they have been + removed from sid. (Closes: #268049) + * [Makefile] Make the regular video devices on all archs. (Closes: #265081) + * [Makefile,debootstrap] Switched away from deprecated chown syntax; + switched away from XSIisms '-a' and '-o'. (Closes: #256098) + * [debootstrap.8] Use '\-' rather than '-' in options. (Closes: #263955) + Confirmed that the "exlude" typo has already been fixed. (Closes: #254108) + Applied patch by Javier Fernández-Sanguino Peña + for "file" URL documentation and a more complete example. (Closes: #226662) + + -- J.H.M. Dassen (Ray) Fri, 27 Aug 2004 15:40:02 +0200 + +debootstrap (0.2.41-0.2) unstable; urgency=low + + * Non-maintainer upload + * [sarge, sid] Add missing libgcrypt11 to base, needed by libgnutls11 + in sid and needed in sarge for opencdk8 to be rebuilt against it + (closes: #262375, #262178). + + -- Steve Langasek Fri, 30 Jul 2004 20:26:57 -0700 + +debootstrap (0.2.41-0.1) unstable; urgency=low + + * Non-maintainer upload with consent of JHM. + * Pull libfribidi0 back out of base, it's opportunistically installed + by d-i now for the locales that need it (closes: #262137). + * Re-add bootloaders on ia64, sparc, mips, hppa, and m68k to base, + because debian-installer isn't ready for this change (closes: #262165). + + -- Steve Langasek Thu, 29 Jul 2004 14:14:33 -0700 + +debootstrap (0.2.41) unstable; urgency=high + + * High urgency upload as per tbm's request. + * [sarge, sid] No longer install setserial, as it causes problems on some + systems (e.g. #212646) and there is a consensus it is no longer needed in + a base environment. + * [sarge, sid] Removed aboot, aboot-base, elilo, efibootmgr, silo, dvhtool, + delo, palo, vmelilo. As per the consensus reached in the thread starting + with http://lists.debian.org/debian-boot/2004/04/msg00634.html, the + installation of boot loaders is now debian-installer's responsibility. + (Closes: #247906) + * [sarge, sid] Added libfribidi0 to base to make debconf localisation into + right to left languages possible. (Closes: #253229) + * [sarge.buildd] Drop libdb4.0 for libdb4.2 as needed by perl. + * [sid] Added libgnutls11 as libgnutls10 is being phased out. + * [Makefile] Include /dev/ida on ia64. (Closes: #258055) + + -- J.H.M. Dassen (Ray) Thu, 29 Jul 2004 20:37:37 +0200 + +debootstrap (0.2.40) unstable; urgency=medium + + * [woody.buildd] Ensure the on_exit umounting of /dev/pts doesn't mess up + an otherwise OK exit status. (Closes: #260699) + * Acknowledge NMUs. (Closes: #258350, #260253) + + -- J.H.M. Dassen (Ray) Thu, 22 Jul 2004 21:53:20 +0200 + +debootstrap (0.2.39.2) unstable; urgency=low + + * Non-maintainer upload. + * [sarge, sid] Drop quik from powerpc, as debian-installer handles this + now (closes: #260253). + + -- Colin Watson Thu, 22 Jul 2004 16:56:19 +0100 + +debootstrap (0.2.39.1) unstable; urgency=low + + * NMU + * add passwd to sid.buildd,sarge.buildd as bash depends on them + + -- Junichi Uekawa Fri, 9 Jul 2004 09:07:28 +0900 + +debootstrap (0.2.39) unstable; urgency=medium + + * [sarge,sid] Dropped libdb2. Thanks Matt Zimmerman. (Closes: #250813) + * [sarge,sid] Dropped libident. Thanks LaMont Jones. (Closes: #251320) + * [sarge,sid] Dropped slang1. Thanks LaMont Jones. (Closes: #251328) + * [woody.buildd] Install libperl5.6. Thanks Rene Engelhard. (Closes: #251702) + * [sarge.buildd] Install libc6.1 rather than libc6 on alpha. Thanks Rene + Engelhard. (Closes: #251703) + + Goswin von Brederlow + * Copy script for sarge to sid + * Add handling for amd64 to sarge/sid scripts + * Dropped gcc-3.2-base. (Closes: #250836) + + -- J.H.M. Dassen (Ray) Sat, 5 Jun 2004 10:02:50 +0200 + +debootstrap (0.2.38.1) unstable; urgency=low + + * NMU. + * [sarge] Add libdb4.2 since apt-utils (0.5.25) depends on this. + + -- Otavio Salvador Thu, 20 May 2004 22:18:41 -0300 + +debootstrap (0.2.38) unstable; urgency=medium + + * [woody.buildd] Readd libgdbmg1 (for perl-modules). + + -- J.H.M. Dassen (Ray) Fri, 7 May 2004 10:55:13 +0200 + +debootstrap (0.2.37) unstable; urgency=medium + + * [debian/control] Bumped makedev build dependency so as not to get pty + permissions problems. (Closes: #246709) + * [sid, sid.buildd] Add/switch to libdb4.2 for the new perl packages. + * Acknowledge NMU 0.2.36.1. (Closes: #246368) + + -- J.H.M. Dassen (Ray) Tue, 4 May 2004 07:58:02 +0200 + +debootstrap (0.2.36.1) unstable; urgency=low + + * Non-maintainer upload with maintainer permission. + * [sarge, sid] Drop yaboot from powerpc, as debian-installer handles this + now (closes: #246368). + + -- Colin Watson Fri, 30 Apr 2004 00:05:02 +0100 + +debootstrap (0.2.36) unstable; urgency=high + + Joey Hess : + * [sid, sarge] Add a subst_package function, and use it to replace libc6 + with libc6.1 on alpha and ia64, to avoid reordering libc in the required + list and work around bug #238963. (Closes: #245680) + + -- J.H.M. Dassen (Ray) Sun, 25 Apr 2004 18:37:42 +0200 + +debootstrap (0.2.35) unstable; urgency=high + + * [sarge, sid] Dropped syslinux. (Closes: #205379) + * [woody, woody.buildd] Removed libgdbmg1. (Closes: #244447) + * [debootstrap, functions] Sync at the end of debootstrap. (Closes: #225742) + + -- J.H.M. Dassen (Ray) Thu, 22 Apr 2004 16:51:49 +0200 + +debootstrap (0.2.34) unstable; urgency=high + + * [sid] Dropped libpci1 and libpci2 as the pciutils dependency change has + been reverted. (Closes: #244344) + + -- J.H.M. Dassen (Ray) Thu, 22 Apr 2004 08:14:28 +0200 + +debootstrap (0.2.33) unstable; urgency=high + + * [sid] Added libpci1 and libpci2 for all archs where pciutils is installed, + as pciutils now depends on them. (Closes: #244344) + + -- J.H.M. Dassen (Ray) Sun, 18 Apr 2004 09:41:23 +0200 + +debootstrap (0.2.32) unstable; urgency=high + + * [sarge, sid] No longer try to filter out console-tools on s390. While + console-tools is basically useless on s390, base-config depends on it. + (Closes: #241727) + + -- J.H.M. Dassen (Ray) Fri, 9 Apr 2004 16:26:23 +0200 + +debootstrap (0.2.31) unstable; urgency=medium + + * [sarge] Exim has changed GnuTLS dependencies. Added libgnutls10, + libgcrypt7, libgpg-error0, libopencdk8, libtasn1-2; dropped libgnutls7, + libgcrypt1, libtasn1-0. + * [sarge] Removed libgnutls7, libgcrypt1, libtasn1-0. + + -- J.H.M. Dassen (Ray) Tue, 23 Mar 2004 22:47:28 +0100 + +debootstrap (0.2.30) unstable; urgency=medium + + * [sarge, sid] aboot needs aboot-base. (Closes: #236368, #239302) + + -- J.H.M. Dassen (Ray) Mon, 22 Mar 2004 21:10:31 +0100 + +debootstrap (0.2.29) unstable; urgency=low + + * NMU with permission of maintainer. + * Added {woody,sarge,sid}.buildd scripts to create build chroots. + Closes: #236418. + * Added --variant=buildd option for convenient access to these scripts. + + -- Daniel Schepler Wed, 10 Mar 2004 02:29:27 -0800 + +debootstrap (0.2.28) unstable; urgency=medium + + * [sid] Exim has changed GnuTLS dependencies. Added libgnutls10, libgcrypt7, + libgpg-error0, libopencdk8, libtasn1-2; dropped libgnutls7, libgcrypt1, + libtasn1-0. + * [sarge,sid] Dropped lilo, mbr, modconf, libdevmapper1.00 as + debian-installer handles the bootloader installation and modules + configuration. (Closes: #232667, #232672, #232673) + + -- J.H.M. Dassen (Ray) Tue, 24 Feb 2004 09:57:35 +0100 + +debootstrap (0.2.27) unstable; urgency=medium + + * [sarge] Lilo now needs libdevmapper1.00; Removed libopencdk8, libgcrypt7, + libgpg-error0. + + -- J.H.M. Dassen (Ray) Sat, 14 Feb 2004 01:19:48 +0100 + +debootstrap (0.2.26) unstable; urgency=medium + + * [sarge] Removed gcc-3.2-base. (Closes: #230697) + * [sid] Lilo now needs libdevmapper1.00 . + + -- J.H.M. Dassen (Ray) Tue, 3 Feb 2004 08:27:54 +0100 + +debootstrap (0.2.25) unstable; urgency=high + + * [functions] Unmount proc/bus/usb, not proc/usb. (Closes: #229122) + + -- J.H.M. Dassen (Ray) Fri, 30 Jan 2004 18:01:29 +0100 + +debootstrap (0.2.24) unstable; urgency=high + + * [functions, sarge, sid] Try to unmount proc/usb, dev/shm, dev/pts on exit; + don't fail when there's nothing to unmount. + (Closes: #229122, #229901, #229907) + * [woody] Don't fail when there's no dev/pts to unmount. + * [sarge, sid] Don't install pcmcia-cs as debian-installer takes care of + that where needed. (Closes: #221907) + * [sid] Removed libopencdk8, libgcrypt7, libgpg-error0. + * [sarge] libopencdk8 (needed for exim4-daemon-light via libgnutls7) + Depends: libgcrypt7, libgpg-error0. (Closes: #229989) + + -- J.H.M. Dassen (Ray) Wed, 28 Jan 2004 18:48:02 +0100 + +debootstrap (0.2.23) unstable; urgency=high + + * [sarge] Dropped libopencdk4 in favour of libopencdk8 as gnutls has switched. + + -- J.H.M. Dassen (Ray) Thu, 1 Jan 2004 01:30:02 +0100 + +debootstrap (0.2.22) unstable; urgency=high + + * [sid] libopencdk8 Depends: libgcrypt7, libgpg-error0. + + -- J.H.M. Dassen (Ray) Wed, 31 Dec 2003 12:35:03 +0100 + +debootstrap (0.2.21) unstable; urgency=high + + * [sarge] Added coreutils' new predependencies libacl1 and libattr1; removed + libsasl2 as it is no longer needed. + + -- J.H.M. Dassen (Ray) Sun, 28 Dec 2003 22:54:08 +0100 + +debootstrap (0.2.20) unstable; urgency=high + + * [sarge] base-config now Depends: aptitude; aptitude Depends: + libsigc++-1.2-5c102. + + -- J.H.M. Dassen (Ray) Sun, 28 Dec 2003 15:11:31 +0100 + +debootstrap (0.2.19) unstable; urgency=high + + * [sid] base-config now Depends: aptitude; aptitude Depends: + libsigc++-1.2-5c102. + + -- J.H.M. Dassen (Ray) Wed, 24 Dec 2003 09:03:44 +0100 + +debootstrap (0.2.18) unstable; urgency=low + + * Thanks to Steinar Gunderson and Matt Kraii for the NMU fixing some + d-i related problems. (Closes: Bug#220150) + * Acknowledge that the problems really are fixed now. (Closes: + Bug#213669, Bug#209273, Bug#210912) + + * Fix downloading of Packages files to retry if bz2 or gz isn't available + on the mirror. (Closes: Bug#194592) + + -- Anthony Towns Sat, 15 Nov 2003 00:13:13 +1000 + +debootstrap (0.2.17.1) unstable; urgency=high + + * NMU + * [sarge,sid] Display only the package name when retrieving packages. + (Closes: #213669, #209273) + * [sarge,sid] Added progress information for downloading package + details. (Closes: #210912) + + -- Steinar H. Gunderson Mon, 10 Nov 2003 15:11:09 +0100 + +debootstrap (0.2.17) unstable; urgency=high + + * [sarge] Fixed typo: libreadlin4 -> libreadline4. (Closes: #219655) + + -- J.H.M. Dassen (Ray) Sat, 8 Nov 2003 23:23:37 +0100 + +debootstrap (0.2.16) unstable; urgency=high + + * [sarge,sid] libreadline4 is required for amiga-fdisk on powerpc. + (Closes: #218533) + * [sarge,sid] Put libreadline4 in required rather than base for ia64. + + -- J.H.M. Dassen (Ray) Wed, 5 Nov 2003 08:09:41 +0100 + +debootstrap (0.2.15) unstable; urgency=high + + * ia64 fixes by Richard Hirst : (Closes: #218533) + * [sarge, sid] Add libreadline4 to base for ia64 as parted needs it. + * [sarge, sid] Remove gcc-2.96-base from required for ia64. + + -- J.H.M. Dassen (Ray) Sat, 1 Nov 2003 12:58:34 +0100 + +debootstrap (0.2.14) unstable; urgency=high + + * [sarge] Made exim4 the default MTA. (Closes: #217657) + * [sarge] Removed libstdc++2.10-glibc2.2, libldap2 . + * [sid] Dropped libopencdk4 in favour of libopencdk8 as gnutls has switched. + + -- J.H.M. Dassen (Ray) Tue, 28 Oct 2003 09:56:27 +0100 + +debootstrap (0.2.13) unstable; urgency=high + + * [sarge] Added libtextwrap1 for tasksel. + + -- J.H.M. Dassen (Ray) Wed, 22 Oct 2003 08:10:37 +0200 + +debootstrap (0.2.12) unstable; urgency=high + + * [sarge, sid] Add libreadline4 to required for m68k as amiga-fdisk needs + it. (Closes: #216617) + + -- J.H.M. Dassen (Ray) Mon, 20 Oct 2003 10:05:09 +0200 + +debootstrap (0.2.11) unstable; urgency=high + + * [sid] Added libc6-sparc64 lib64gcc1 lib64ncurses5 to base for sparc. + (Closes: #215590) + * [sarge, sid] Dropped libreadline as bash no longer depends on it. + * [sid] Dropped libstdc++2.10-glibc2.2 and its associated special cases as + it is no longer needed. + + -- J.H.M. Dassen (Ray) Wed, 15 Oct 2003 19:42:58 +0200 + +debootstrap (0.2.10) unstable; urgency=high + + * [sid] Fixed /usr/sbin/sendmail symlink to point to exim4. (Closes: #213734) + + -- J.H.M. Dassen (Ray) Sat, 4 Oct 2003 15:47:31 +0200 + +debootstrap (0.2.9) unstable; urgency=high + + * [sarge] Added libgdbm3 for man-db. + + -- J.H.M. Dassen (Ray) Thu, 2 Oct 2003 23:57:09 +0200 + +debootstrap (0.2.8) unstable; urgency=high + + * [sid] Added libtextwrap1 for tasksel; removed libsasl2 as it is no longer + needed. + + -- J.H.M. Dassen (Ray) Thu, 2 Oct 2003 07:57:16 +0200 + +debootstrap (0.2.7) unstable; urgency=high (fixes RC d-i bug) + + * [sarge] Reinstated special-case for libperl5.8; it is still needed for + non-i386 until sarge has perl >= 5.8.0-20. (Closes: #213280) + * [debian/control] Updated Standards-Version; fixed removal of slink and + potato scripts from udeb. + * [debian/control] Updated priorities; debootstrap-udeb is required (for + debian-installer). + * [debian/rules] Fixed dpkg-distaddfile accordingly. + + -- J.H.M. Dassen (Ray) Tue, 30 Sep 2003 14:31:57 +0200 + +debootstrap (0.2.6) unstable; urgency=low + + * [sarge] Added e2fslibs, libcomerr2, libss2, libuuid1 for e2fsprogs. + + -- J.H.M. Dassen (Ray) Fri, 26 Sep 2003 13:50:58 +0200 + +debootstrap (0.2.5) unstable; urgency=low + + * [sid] Added libgdbm3 for man-db. + * [sarge, sid] Dropped special-case for libperl5.8 (Closes: #210425). + * [sid] Make exim4 the default MTA as it is configured through debconf. + (Closes: #208047) + * [sid] Removed libldap2 which is no longer needed. + + -- J.H.M. Dassen (Ray) Sun, 21 Sep 2003 13:30:49 +0200 + +debootstrap (0.2.4) unstable; urgency=low + + * [sid] Added coreutils' new predependencies libacl1 and libattr1. + * [debian/README.Debian] Corrected example invocation. (Closes: #206142) + * [debian/README.Debian] Fixed a typo. + + -- J.H.M. Dassen (Ray) Wed, 20 Aug 2003 10:28:49 +0200 + +debootstrap (0.2.3) unstable; urgency=low + + * [sarge] Add new dependencies of debconf: debconf-i18n + liblocale-gettext-perl libtext-wrapi18n-perl libtext-charwidth-perl. + * Acknowledge NMU. (Closes: #203370) + + -- J.H.M. Dassen (Ray) Sat, 16 Aug 2003 20:15:40 +0200 + +debootstrap (0.2.2-0.1) unstable; urgency=low + + * NMU. + * Fix typo in woody script. (Closes: #203370) + + -- Petter Reinholdtsen Tue, 29 Jul 2003 20:29:01 +0200 + +debootstrap (0.2.2) unstable; urgency=low + + * [debian/changelog] Included entries for NMUs 0.1.17.31 through .34 whose + changes were incorporated by aj already. + * [Makefile] Invoke MAKEDEV through its FHS location (noted by Matt + Zimmerman). (Closes: #190239) + * Acknowledge older NMUs whose changes have been incoporated. + (Closes: #135675, #161695, #191849) + + -- J.H.M. Dassen (Ray) Tue, 29 Jul 2003 18:31:49 +0200 + +debootstrap (0.2.1) unstable; urgency=low + + * The Day of the Daffodils release. + + * Accept NMUs up to 0.1.17.30. Thanks guys! (Closes: Bug#148377, + Bug#150161, Bug#150492, Bug#153962, Bug#154463, Bug#155906, + Bug#160879, Bug#161469, Bug#161469, Bug#161722, Bug#163860, + Bug#172118, Bug#176221, Bug#179504, Bug#179725, Bug#185397, + Bug#187893, Bug#188053, Bug#189472, Bug#189551, Bug#190108, + Bug#191288, Bug#193794, Bug#193806, Bug#195012, Bug#195742, + Bug#199333, Bug#201066) + * JHM added to Uploaders. + + * Change the info/error/warning/progress calls to include a unique word + for each string, a printf format string, and any arguments to the + printf string. + * Add support for debian-installer interaction + + * Add some support for l10n. Gettext is used if it's available; no + translations are included as of yet. This support doesn't + affect debian-installer, which has its own stuff for i18n, nor + boot-floppies. (Closes: Bug#125647) + + * Some initial support for cross-bootstrapping in the sid script. + + * Use dpkg --print-installation-architecture instead of + --print-architecture. (Closes: Bug#138526, Bug#159720) + + * Add new dependencies of debconf: debconf-i18n liblocale-gettext-perl + libtext-wrapi18n-perl libtext-charwidth-perl. (Closes: Bug#201066) + * Add new dependencies of libldap2: libgnutls7 libgcrypt1 liblzo1 + libopencdk4 libtasn1-0 zlib1g. (Closes: Bug#201663) + * Remove libgdbmg1. (Closes: Bug#202304) + * Add new dependecies of e2fsprogs: e2fslibs libcomerr2 libss2 libuuid1. + (Closes: Bug#203033) + * Add wget to base. (Closes: Bug#145635) + * Switch from netkit-ping to iputils-ping. + + * Changed the manpage a little. (Closes: Bug#126864) + * Updated README.Debian. + + -- Anthony Towns Tue, 29 Jul 2003 18:15:24 +1000 + +debootstrap (0.1.17.34) unstable; urgency=medium + + * [sid] Added e2fsprogs' new predependencies (e2fslibs, libcomerr2, libss2, + libuuid1). + * [sarge] Removed libgdbmg1 as it is no longer needed. + + -- J.H.M. Dassen (Ray) Sun, 27 Jul 2003 09:20:49 +0200 + +debootstrap (0.1.17.33) unstable; urgency=medium + + * [sid] Removed libgdbmg1 as it is no longer needed. + * [sarge] libldap2 now Depends: libgnutls7, libsasl2; added those and their + dependencies (libgcrypt1 liblzo1 libopencdk4 libtasn1-0 zlib1g). Dropped + libsasl7 in favour of libsasl2. + + -- J.H.M. Dassen (Ray) Mon, 21 Jul 2003 19:00:28 +0200 + +debootstrap (0.1.17.32) unstable; urgency=medium + + * [sid] libldap2 now Depends: libgnutls7; added that and its dependencies + (libgcrypt1 liblzo1 libopencdk4 libtasn1-0 zlib1g); dropped libssl0.9.7 . + + -- J.H.M. Dassen (Ray) Thu, 17 Jul 2003 07:05:09 +0200 + +debootstrap (0.1.17.31) unstable; urgency=medium + + * [sid] Follow debconf changes. debconf now Depends: debconf-i18n | + debconf-english; debconf-i18n having Priority: important and + debconf-english having Priority: extra, so we satisfy the dependency + through debconf-i18n. debconf-i18n in turn pulls in three additional + packages: liblocale-gettext-perl, libtext-wrapi18n-perl, + libtext-charwidth-perl . + + -- J.H.M. Dassen (Ray) Sun, 13 Jul 2003 08:52:55 +0200 + +debootstrap (0.1.17.30) unstable; urgency=medium + + * [sarge] + * Added sysv-rc for /usr/sbin/update-rc.d . + * Added initscripts to satisfy sysvinit's predependency. + * libparted1.6-0 has replaced libparted1.4 on ia64. (Closes: #197957) + + -- J.H.M. Dassen (Ray) Mon, 30 Jun 2003 07:05:22 +0200 + +debootstrap (0.1.17.29) unstable; urgency=medium + + * [sid] libconsole has replaced console-tools-libs. (Closes: #195722) + * [sarge] libperl5.6 has been replaced by libperl5.8 . (Closes: #195588) + + -- J.H.M. Dassen (Ray) Mon, 2 Jun 2003 00:40:54 +0200 + +debootstrap (0.1.17.28) unstable; urgency=medium + + * [sarge] libnewt0.51 has replaced libnewt0; it requires slang1a-utf8. + + -- J.H.M. Dassen (Ray) Wed, 28 May 2003 07:42:14 +0200 + +debootstrap (0.1.17.27) unstable; urgency=medium + + * urgency medium to not hold up .26 with that longer as necessary + * [sarge] added libtext-iconv-perl (this is the second part + from .22) (closes: #184539) + + -- Rene Engelhard Mon, 19 May 2003 00:08:48 +0200 + +debootstrap (0.1.17.26) unstable; urgency=medium + + * [sarge] libpcap0.7 has replaced libpcap0. + + -- J.H.M. Dassen (Ray) Sun, 18 May 2003 23:23:46 +0200 + +debootstrap (0.1.17.25) unstable; urgency=medium + + * [sarge] Added libblkid1 (for e2fsprogs). + + -- J.H.M. Dassen (Ray) Sun, 4 May 2003 12:44:00 +0200 + +debootstrap (0.1.17.24) unstable; urgency=medium + + * [sid] Updates for new whiptail: + * Replaced libnewt0 by libnewt0.51. + * Added slang1a-utf8. + + -- J.H.M. Dassen (Ray) Tue, 29 Apr 2003 19:04:51 +0200 + +debootstrap (0.1.17.23) unstable; urgency=medium + + * [sid] + * Added sysv-rc for /usr/sbin/update-rc.d . + * Added initscripts to satisfy sysvinit's predependency. + * For exim, dropped libsasl7 in favour of libsasl2. + * Added libssl0.9.7 for libsasl2. + + -- J.H.M. Dassen (Ray) Tue, 22 Apr 2003 06:56:25 +0200 + +debootstrap (0.1.17.22) unstable; urgency=low + + * [sid] added libtext-iconv-perl which is needed to display + localized po-debconf templates actually localized. + This needs a second step later for sarge but that only is possible + after libtext-iconv-perl 1.2-2 went into sarge. + + -- Rene Engelhard Fri, 18 Apr 2003 16:25:17 +0200 + +debootstrap (0.1.17.21) unstable; urgency=medium + + * [sarge, sid] Added gcc-3.3-base (as it is needed for current libstdc++5). + + -- J.H.M. Dassen (Ray) Fri, 18 Apr 2003 08:11:55 +0200 + +debootstrap (0.1.17.20) unstable; urgency=medium + + * [woody, sarge, sid] Add devfsd on s390 as that architecture uses devfs by + default. (Closes: #180252) + * [sarge] Removed the dummy fileutils package. + + -- J.H.M. Dassen (Ray) Mon, 7 Apr 2003 19:59:42 +0200 + +debootstrap (0.1.17.19) unstable; urgency=medium + + * [sid] Added libblkid1 (for e2fsprogs). + + -- J.H.M. Dassen (Ray) Sun, 6 Apr 2003 21:43:29 +0200 + +debootstrap (0.1.17.18) unstable; urgency=medium + + * [sarge] Added libgcc1, libstdc++5, gcc-3.2-base; dropped aptitude, + libsigc++0 . + * Debootstrap has depended on binutils since 0.1.17.3. (Closes: #184304) + + -- J.H.M. Dassen (Ray) Wed, 19 Mar 2003 06:55:56 +0100 + +debootstrap (0.1.17.17) unstable; urgency=medium + + * NMU + * Really drop aptitude from the sid script, not just libsigc++0. + + -- J.H.M. Dassen (Ray) Tue, 4 Feb 2003 06:49:36 +0100 + +debootstrap (0.1.17.16) unstable; urgency=medium + + * NMU + * Drop aptitude from the sid script (base-config 1.51 dropped its dependency + on it) and libsigc++0 (which was only needed for aptitude). This makes + "pbuilder create --distribution sid" work again. (Closes: #177221, #177998). + + -- J.H.M. Dassen (Ray) Sun, 2 Feb 2003 20:41:35 +0100 + +debootstrap (0.1.17.15) unstable; urgency=low + + * NMU + * For gcc-transition, libgcc1 and libstdc++5 and gcc-3.2-base + required by groff-base, and potentially other packages compiled with + gcc-3.2. + + -- Junichi Uekawa Mon, 13 Jan 2003 15:39:55 +0900 + +debootstrap (0.1.17.14) unstable; urgency=low + + * NMU + * Remove debootstrap-udeb's dependency on retriever. + + -- Tollef Fog Heen Sat, 7 Dec 2002 14:53:52 +0100 + +debootstrap (0.1.17.13) unstable; urgency=low + + * NMU + * sarge: Removed shellutils, textutils and added coreutils instead. + Verified that the result works for "pbuilder create --distribution sarge" + (Closes: #163789) + Fileutils is still in there for now, due to sarge's debconf versioned + dependency on it. + + -- J.H.M. Dassen (Ray) Tue, 8 Oct 2002 23:17:47 +0200 + +debootstrap (0.1.17.12) unstable; urgency=low + + * NMU + * Fix shell variable quoting problem, to change $10 -> ${10} + (closes: #161468) + + -- Junichi Uekawa Sat, 21 Sep 2002 13:39:47 +0900 + +debootstrap (0.1.17.11) unstable; urgency=low + + * NMU + * sarge: added libdb1-compat. + + -- J.H.M. Dassen (Ray) Sat, 21 Sep 2002 00:37:36 +0200 + +debootstrap (0.1.17.10) unstable; urgency=low + + * NMU + * sid: Removed shellutils, fileutils, and added coreutils for required + target (closes: #161332) + * sid: change libperl5.6 to libperl5.8 (closes: #158606) + + -- Junichi Uekawa Wed, 18 Sep 2002 21:41:36 +0900 + +debootstrap (0.1.17.9) unstable; urgency=low + + * NMU + * Added "libdb1-compat" to sid and verified that the resulting package is + usable for "pbuilder create --distribution sid". + + -- J.H.M. Dassen (Ray) Sat, 14 Sep 2002 15:09:10 +0200 + +debootstrap (0.1.17.8) unstable; urgency=low + + * NMU + * The "it didn't change the way the installer worked" release. + * Makefile: create $(DESTDIR)/usr/share/man/man8 before attempting to + install a file to it (Closes: #139543) + * functions: fix race condition in smallyes() implementation; thanks to Matt + Zimmerman for the analysis. "Sometimes, dpkg finishes executing before + smallyes runs, and it loops forever while echo fails repeatedly due to the + broken pipe." To fix this race, we simply swap the loop condition and + body, so that if the echo fails, smallyes() exits cleanly. I further + changed "true" to ":" to save the expense of an extra process for shells + where "true" is not a built-in. + (Closes: #139529) + + -- Branden Robinson Thu, 29 Aug 2002 12:50:08 -0500 + +debootstrap (0.1.17.7) unstable; urgency=low + + * NMU + * Forked "sid" target from "sarge" target, changed "libcap0" to the now + current "libpcap0.7" and verified that the result works with pbuilder. + (Closes: #156574) + + -- J.H.M. Dassen (Ray) Wed, 21 Aug 2002 11:01:52 +0200 + +debootstrap (0.1.17.6) unstable; urgency=low + + * NMU + * add dselect to required (I found out that it is actually required + for pbuilder create to work) (closes: #154527) + * change DEBIAN_FRONTEND=Noninteractive to "noninteractive" (closes: #154794) + * add sh* patch from Yaegashi (closes: #155142) + + -- Junichi Uekawa Thu, 8 Aug 2002 19:23:04 +0900 + +debootstrap (0.1.17.5) unstable; urgency=low + + * NMU + * mistake in the last upload, sorry aj. + sid points to sarge, not woody. (closes: #149971) + + -- Junichi Uekawa Sat, 27 Jul 2002 17:22:05 +0900 + +debootstrap (0.1.17.4) unstable; urgency=low + + * NMU + * add "sarge" target (closes: #153957) + + -- Junichi Uekawa Tue, 23 Jul 2002 18:03:01 +0900 + +debootstrap (0.1.17.3) unstable; urgency=low + + * NMU + * Depend on binutils (closes: #138489) + * Sleep is optional (closes: #150468) + * POSIXify a bit more (closes: #150487) + * Add support for --components (closes: #116801) + + -- Tollef Fog Heen Thu, 20 Jun 2002 00:13:06 +0200 + +debootstrap (0.1.17.2) unstable; urgency=low + + * NMU + * Make sid script not a symlink from woody script + * add aptitude and libsigc++0 to base for sid. (closes: #149971) + + -- Junichi Uekawa Sat, 15 Jun 2002 12:46:11 +0900 + +debootstrap (0.1.17.1) unstable; urgency=low + + * NMU + * Add udeb support (closes: #143874) + + -- Tollef Fog Heen Tue, 28 May 2002 14:15:41 +0200 + +debootstrap (0.1.17) unstable; urgency=high + + * Includes changes from NMUs. Thanks to Stefan Gybas and Eduard Bloch. + (Closes: Bug#130764, Bug#135676, Bug#134306, Bug#133882, Bug#131768, + Bug#117980, Bug#133298, Bug#130668, Bug#111175, Bug#131147, Bug#95143, + Bug#130482) + + * Don't use PIPESTATUS to work out if wget succeeded, since that's a + bashism and we're seriously not allowed bashisms. Duh. This should + help with all those "Malformed release" problems. Thanks to Phil + Blundell and Chris Tillman for spotting this. (Closes: Bug#136729) + + * Apply patch from Matt Zimmerman to get rid of some irritating warnings + that can show up sometimes due to sed getting it's output stream closed + on it. (Closes: Bug#131478) + + * Don't use "export foo=bar" on a single line since it's a bashism. + (Closes: Bug#138187) + + * Made the "smallyes" usage independent of --boot-floppies. Too much + code duplication otherwise. + + * Install ipchains on arches that have 2.2.x kernels by default, and + iptables on arches that have 2.4.x kernels by default. Some arches + have both. (Closes: Bug#134478) + + * Don't rm malformed Release files, rename them to something obvious + instead so people can have a hope at seeing what's going on. (Closes: + Bug#131756) + + * Error out on missing entries in Release files. (Closes: Bug#136886) + + * Fix basedeb creation to not bother building devices tarball. (Closes: + Bug#137243) + + * Workaround for ldconfig no longer needed, so removed. (Closes: Bug#135819) + * Workaround for /dev/initctl was never needed and stupid, so removed. + + * Make sure devices.tar.gz is gzip -9'ed. (Closes: Bug#136687) + + * Use any "main" components found in Release file, eg "main", + "non-US/main", "local/main". (Closes: Bug#116801) + + * Add parted to base for ia64. (Closes: Bug#138246) + + * Moved the "successful!" message and sleep hack for boot-floppies from + the woody script to the debootstrap script itself. + + -- Anthony Towns Thu, 14 Mar 2002 18:28:24 +1000 + +debootstrap (0.1.16.4) unstable; urgency=low + + * NMU, needed for boot-floppies 3.0.20 + * Added cciss and ataraid device files, closes: #135675 + * Applied the patch from Matt Zimmermann to fix --include, closes: #134306 + * Mail suppression fixed in previous release, closes: #133882 + + -- Eduard Bloch Sun, 3 Mar 2002 12:21:19 +0100 + +debootstrap (0.1.16.3) unstable; urgency=low + + * non-maintainer-upload + * require newer makedev, fixes build problems on m86k and arm + * unsets $TMP, $TEMP and $TMPDIR in the beginning, closes: #131768, #117980 + * added gcc-2.96-base to ia64's required packages list, closes: #133298 + + -- Eduard Bloch Tue, 12 Feb 2002 19:30:47 +0100 + +debootstrap (0.1.16.2) unstable; urgency=low + + * non-maintainer-upload + * added modification suggested by Branden Robinson and Matt Kraai terminate + cat (now tail) better, closes: #130668 + * provides options to install additional packages, or exclude some from the + list. May be needed in boot-floppies soon. Closes: #111175, #131147 + * --verbose option, closes: #95143 + * added additional devices to the device list, especially input and usb + needed for modern device drivers (Joysticks, USB, Scanners) + * added pppoeconf to the packages list, better choice for DSL users + * forced remove of dev/initctl, prevents breaking on re-installation + + -- Eduard Bloch Mon, 28 Jan 2002 19:14:41 +0100 + +debootstrap (0.1.16.1) unstable; urgency=high + + * non-maintainer upload for boot-floppies 3.0.19 + * Fixed list of base and required packages for s390 + * setup_devices(): don't fail if devices.tar.gz is not present and we + are using devfs + * disable handling of /dev/initctl for boot-floppies, closes: #130482 + + -- Stefan Gybas Thu, 24 Jan 2002 15:17:42 +0100 + +debootstrap (0.1.16) unstable; urgency=low + + * Include NMUs 0.1.15.1 - .9, thanks to Adam di Carlo, Ethan Benson and + Bdale Garbee. (Closes: Bug#113265, Bug#119314, Bug#119251) + * Many bugs were fixed in the NMUs. Closes them properly. (Closes: + Bug#89673, Bug#97174, Bug#99229, Bug#105980, Bug#106062, Bug#106102, + Bug#106106, Bug#106134, Bug#106711, Bug#106877, Bug#107262, + Bug#107404, Bug#107447, Bug#109670, Bug#110312, Bug#111001, + Bug#111065, Bug#112778, Bug#112795, Bug#112842, Bug#113444, + Bug#114056, Bug#114653, Bug#115467, Bug#115481, Bug#115557, + Bug#115581, Bug#115699, Bug#116061, Bug#116424, Bug#119769, + Bug#119947, Bug#121724, Bug#123958, Bug#125954, Bug#126018, + Bug#126630, Bug#126799) + + * Informative error for people who type `--boot-floppies' when running + by hand. (Closes: Bug#107548) + * Create dev/initctl in target, and setup a cat process to dump anything + sent to it to /dev/null so that if init is run in the chroot, + it doesn't try doing anything too clever to talk to the real + init. (Closes: Bug#120597) + * Create awk symlink since base-files insists on having it available. + (Closes: Bug#127934) + + * Use DEBOOTSTRAP_DIR to work out where /usr/lib/debootstrap is. + * So, in theory, to create basedeb tarballs, you should be able to unpack + the source and say: + . + fakeroot debian/rules binary-basedebs SUITE=woody VERSION=3.0 \ + MIRROR="http://ftp.debian.org/debian" ARCHES="i386 powerpc" + (Closes: Bug#127546) + + -- Anthony Towns Sun, 20 Jan 2002 21:04:37 +1000 + +debootstrap (0.1.15.9) unstable; urgency=high + + * non-maintainer upload + * debian/rules: new 'basedebs' target that makes basedebs.tgz and 1.44 + split images for base per arch + * functions: better return value handling during wget (wgetprogress) + * repeat() had a useless eval, removed, which simplifies some silly + quoting + * incorrect error message in in_target_msg(), closes: #119769 + * debian/changelog: remove obsolete "local variables" + * additional progress message when validating the release file after + download + * when the downloaded release file is invalid, make sure to delete it + closes: #119947 + * debian/rules: minor fixes and cosmetics + * upgrade wget from Recommends to Depends, closes: #126799 + * depend on binutils, for 'ar', closes: #123958 + + -- Adam Di Carlo Fri, 4 Jan 2002 20:01:58 -0500 + +debootstrap (0.1.15.8) unstable; urgency=high + + * non-maintainer upload + * Fix progress bar hooks to enable proper progress on basedebs.tgz + installation as well as actual base installation and extraction. + * trap signals so cleanup is still performed. + * When in --boot-floppies mode echo a Success info message to stdout, so + it will show up on /dev/tty4, this is so users watching tty4 stop + being confused when things just stop at completion. + * Replace $TARGET/sbin/start-stop-daemon with a shell script instead of + /bin/true, this shell script announces that its a fake noop version so + users will know whats wrong if debootstrap aborts before completion. + + -- Ethan Benson Sat, 3 Nov 2001 23:14:08 -0900 + +debootstrap (0.1.15.7) unstable; urgency=high + + * non-maintainer upload + * when reporting errors in 'in_target', don't chop down to the first + 50 characters + * woody: when in boot-floppies mode, provide more user-friendly warning + messages, using new 'in_target_msg' function + * woody: more info messages for the core/required/base package + installation part + * instead of 'ln -s' we should be using 'ln -sf'; this would prevent + running debootstrap twice in the same target dir; closes: #111065 + * before mounting proc, umount it just in case; normally this shouldn't + be needed if on_exit is working all the time, but I find without this, + sometimes problems are caused + * woody/i386 needs psmisc for pcmcia-cs (critical bug!) + * --download-only mode can be run as non-root; closes: #116424 + * tested some problems which I couldn't reproduce + closes: #115699 + + -- Adam Di Carlo Wed, 24 Oct 2001 16:05:39 -0400 + +debootstrap (0.1.15.6) unstable; urgency=medium + + * non-maintainer upload + * smaller and wiser version of smallyes(), thanks to Herbert Xu + * woody base includes pcmcia-cs for i386 and powerpc (closes: #114653) + * wget progress bar support (closes: #116061) + + -- Adam Di Carlo Thu, 18 Oct 2001 15:14:02 -0400 + +debootstrap (0.1.15.5) unstable; urgency=high + + * From Ethan Benson: + * pipe yes output into dpkg runs inside install_debs() this way on_exit + works in --boot-floppies mode. (Closes: #112842, #115481) + * Add libpcap0 to base, ppp depends on it now. (Closes: #114056) + + * From Adam Di Carlo: + * Potato installation on non-i386 was broken, need libc6 + (closes: #112778); however, there are other ways the Potato base + install doesn't represent quite what Potato boot-floppies would + consider base + * apply patch from Tommi Virtanen which improves the 'smallyes' + function; apparently this fixes a console-tools postinst loop, + although I haven't seen that (closes: #115581) + * get rid of some line continuators in potato and woody scripts, they + were obscuring some problems + + -- Adam Di Carlo Mon, 15 Oct 2001 01:56:16 -0400 + +debootstrap (0.1.15.4) unstable; urgency=high + + * more fixed for the benefits of boot-floppies + * add telnetd on s390; yes, it's gross, but it's needed for + installation, to connect from the line mode console + closes: #112795 + + -- Adam Di Carlo Sun, 23 Sep 2001 16:11:03 -0400 + +debootstrap (0.1.15.3) unstable; urgency=high + + * Fix deficient command line option parsing, optional arguments no + longer have to be declared in a specific order, for example before you + could not put --arch before --download-only, now you can. + * Add --help option and useful help output. + * Stop using dirname, basename, and yes, they are being removed from + busybox. + * Fix many many quoting bugs. + * Fix debootstrap man page (Closes: #107404, #109670) + * Add ftp support (Closes: #110312) + * Don't waste time downloading useless non-free/contrib (Closes: #89673) + * Path cleanup (Closes: #97174) + * Add pppconfig to woody base (Closes: #111001) + * Remove syslinux from base (Closes: #107447) + * Eliminate useless warning about creating exim.conf (Closes: #99229) + * Don't use "here documents" (they create tmp files in /tmp which could + be very well be full on boot-floppies). + * Don't use echo -n it is not portable. + * Set umask to 022. + * All patches from Ethan Benson, I am just the builder! + These have been tested with boot-floppies and work properly. + + -- Adam Di Carlo Sat, 22 Sep 2001 12:30:02 -0400 + +debootstrap (0.1.15.2) unstable; urgency=low + + * quoting required in one place for the new ash (Closes: Bug#106062) + * s390 support (Closes: Bug#107262) + * remove some packages from Woody's base that aren't needed: + - update (not needed with modern kernels, Closes: Bug#106877) + - syslinux (Closes: Bug#107477) + - ldso (should be pulled in by libc6, Closes: Bug#106102) + * kinks in mipsel base worked themselves out (Closes: Bug#106711) + + -- Adam Di Carlo Wed, 8 Aug 2001 12:04:40 -0400 + +debootstrap (0.1.15.1) unstable; urgency=low + + * add efibootmgr on ia64, as per bug 105980. + + -- Bdale Garbee Fri, 3 Aug 2001 14:13:23 -0600 + +debootstrap (0.1.15) unstable; urgency=low + + * Do progress indications (by bytes) for Packages downloads and .deb + downloads. (Closes: Bug#101886) + * Don't use seq. Silly busybox. + * Add pppoe to base. (Closes: Bug#102378) + * No point keeping around the "sid.is-broken" file. + + -- Anthony Towns Wed, 27 Jun 2001 21:29:29 +1000 + +debootstrap (0.1.14) unstable; urgency=low + + * Make in_target_nofail kill stderr. No more "/dev/pts: not mounted" error. + Yay. :) + + * Refactor woody, potato and slink scripts; do away with + woody.debs. Change the way the scripts work. (Now they define + functions which debootstrap calls. Much nicer) + * Support --download-only option. + * Support resuming downloads of Release and Packages files, even gzipped + ones. + * Support null: (Packages files assumed to be named for a debootstrap.invalid + host) + * Always use the deboostrap.invalid name, and use that in + /etc/apt/sources.list. Remove /etc/apt/sources.list after the base + system is build. + * All this should be enough to support basedeb.tgz installs on + debootstrap's behalf. Some more stuff would be useful, but isn't + immediately necessary. (Closes: Bug#102217) + + * Add ia64 support and fix libc6 == libc6.1 problem. (Closes: Bug#101829) + + * Be a little more careful with permissions on devs tarball. Hopefully. + (Closes: Bug#102308) + + * Don't worry if md5sum from stdin adds a " -" after the md5sum. Should + make debootstrap more usable on non-Debian Linuxes. + + -- Anthony Towns Mon, 25 Jun 2001 18:38:35 +1000 + +debootstrap (0.1.13) unstable; urgency=low + + * Add symlink for sid.debs. + * Fix the special casing for hppa. (Closes: Bug#101604) + * Remove groff from base. (Closes: Bug#101173) + * Retry partially successful downloads a couple of times. + (Closes: Bug#101476) + * Minor wording changes wrt downloading Release file (Closes: Bug#101705) + + -- Anthony Towns Thu, 21 Jun 2001 12:08:10 +1000 + +debootstrap (0.1.12) unstable; urgency=high + + * Split determination of base into a separate script to enable further + innovation! Come on, tell me that doesn't excite you! + + * Add groff-base to base. (Closes: Bug#100112, Bug#100123) + * Remove libstdc++2.10 and some other hopefully unnecessary debs + (Closes: Bug#99708) + + * Remove lilo.conf special casing. Change some warnings to info messages. + + -- Anthony Towns Sun, 10 Jun 2001 01:22:12 +1000 + +debootstrap (0.1.11) unstable; urgency=low + + * Add dhcp-client to base. (Closes: Bug#100083) + + -- Anthony Towns Sat, 9 Jun 2001 00:11:26 +1000 + +debootstrap (0.1.10) unstable; urgency=low + + * Don't abort build on devfs systems: the makedev we build-dep on should + be recent enough. (Closes: Bug#97713) + * Check for malformed release files. Thanks to Martin Michlmayr for the + patch. (Closes: Bug#97707) + * Use --force-confold when installing base. That is: if you want the + conffile from the package to be there at the end, don't create a + file in the first place. I'm not convinced this is right. + (Closes: Bug#99025) + + -- Anthony Towns Mon, 28 May 2001 14:43:07 +1000 + +debootstrap (0.1.9) unstable; urgency=low + + * Abort build on devfs systems (MAKEDEV fails for no good reason) + (Closes: Bug#97713) + + * Add support for mips and mipsel (Closes: Bug#97711) + * Add some support for hppa (install palo in base) + + * Don't install ldso (Closes: Bug#97708) + * Don't install libopenldap1 or libopenldap-runtime (replaced by libldap2) + (Closes: Bug#98050) + * Do install libdb3 and libcap1. + * Install klogd too. (But only as part of base. Move sysklogd to base too) + + * Setup a dummy lilo.conf on i386 only. (Closes: Bug#97710, Bug#98052) + + * Trim a trailing / for target and url. + + -- Anthony Towns Sun, 20 May 2001 13:33:34 +1000 + +debootstrap (0.1.8) unstable; urgency=low + + * Add adduser and base-config into base. base-config unfortunately depends + on perl instead of perl-base. (Closes: Bug#96439) + * Force LANG=C. Need to work out how i18n should be handled. + * Kludge potato install so it's noninteractive. Thanks to Colin Watson + for the patch. (Closes: Bug#94441) + * Get rid of dh_testversion. + * Make a sid script (just a symlink to the woody script). + + -- Anthony Towns Wed, 9 May 2001 20:33:00 +1000 + +debootstrap (0.1.7) unstable; urgency=low + + * Don't worry if umounting /dev/pts fails. + * Add debootstrap(8) manpage, thanks to Matt Kraai. (Closes: Bug#86238) + * Add a blank line to the end of the faked /var/lib/dpkg/status. Spotted + by Richard Hirst. + * Added console-tools and console-data into the base system. + * Move /etc/exim.conf to /etc/exim/exim.conf so that sendmail doesn't + give errors, even if debconf tries to use it before exim is + configured. Gack. + * Add fdutils back into base. + + -- Anthony Towns Mon, 30 Apr 2001 15:49:27 +1000 + +debootstrap (0.1.6) unstable; urgency=low + + * Only create stuff in /etc if it hasn't already been created. + + -- Anthony Towns Mon, 23 Apr 2001 18:02:55 +1000 + +debootstrap (0.1.5) unstable; urgency=low + + * Use "head -n X" instead of "head -X" to work with busybox. + (Closes: Bug#94575) + * Use s///I instead of s///i for case insensitivity, again for busybox. + (Closes: Bug#94579) + * Fixed typo that would have stopped debootstrap from falling back to an + uncompressed Packages file. + * Added libsasl7 and libldap2 to woody base, since woody exim now depends + on them. + + -- Anthony Towns Sun, 22 Apr 2001 01:47:00 +1000 + +debootstrap (0.1.4) unstable; urgency=low + + * If we've got a Release file, check that the Packages files we download + have the right md5sums. + * Build-Depend on new makedev, and don't hax0r powerpc devices as much. + (Closes: Bug#93836) + * Hopefully support arm chroots. (Closes: Bug#92592) Declare it to be + Arch: any, and see what dies. There's a chance that nothing will. Not + a *big* chance, but a chance. + * Fiddled with the base system some more. Added apt-utils so + preconfiguration will work. + * Added permission to NMU to the README.Debian. + * Mention file:/ URLs in README.Debian. (Closes: Bug#87099) + * Add a --boot-floppies option that changes the way the I/O happens, in + a way that's hopefully useful for boot-floppies. See README.Debian for + details. + * Also added a bit more output. + + -- Anthony Towns Mon, 26 Mar 2001 22:30:12 +1000 + +debootstrap (0.1.3) unstable; urgency=high + + * Switch from debconf-tiny to debconf, since that's what's now in + woody. (Using debconf-tiny probably makes the package unusable, hence + the urgency) Fixup perl, lilo and console-apt to cope with changes in + the base system in woody. Added ae, left nano and nvi. + * Add support for m68k, sparc and powerpc, based on Christian Steigies + patches and Adam Di Carlo's NMU (Closes: Bug#89883, Bug#91221) + + -- Anthony Towns Sun, 25 Mar 2001 14:29:02 +1000 + +debootstrap (0.1.2) unstable; urgency=low + + * Add support for slink. + * Fix support for woody (no lilo, console-*, different perl) + * Re-download Packages files every time (Closes: Bug#88438) + (Should this be changed to re-download things where the md5 doesn't match?) + + -- Anthony Towns Sun, 4 Mar 2001 19:42:29 +1000 + +debootstrap (0.1.1) unstable; urgency=low + + * Initial Release. (Closes: Bug#82245) + + * Called it debootstrap instead of debchroot, because it's more about + bootstrapping a Debian environment, whether that will end up being + in a chroot, or as a standalone system. Blame Adam di Carlo. :) + + -- Anthony Towns Tue, 30 Jan 2001 10:54:45 +1000 diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/compat b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/compat @@ -0,0 +1 @@ +9 diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/control b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/control new file mode 100644 index 00000000..6925a63c --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/control @@ -0,0 +1,26 @@ +Source: debootstrap +Section: admin +Priority: extra +Maintainer: Franco (nextime) Lanza +Uploaders: Franco (nextime) Lanza , Daniel Reurich +Build-Depends: debhelper (>= 9), makedev (>= 2.3.1-69) [linux-any], git +Standards-Version: 3.9.8 +Vcs-Browser: https://git.devuan.org/devuan-packages/debootstrap +Vcs-Git: https://git.devuan.org/devuan-packages/debootstrap.git + +Package: debootstrap +Architecture: all +Depends: ${misc:Depends}, wget +Recommends: gnupg, ${keyring}, devuan-keyring +Description: Bootstrap a basic Devuan system + debootstrap is used to create a Devuan base system from scratch, + without requiring the availability of dpkg or apt. It does this by + downloading .deb files from a mirror site, and carefully unpacking them + into a directory which can eventually be chrooted into. + +Package: debootstrap-udeb +Section: debian-installer +Package-Type: udeb +Architecture: all +Depends: ${misc:Depends}, mounted-partitions +Description: Bootstrap the Devuan system diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/copyright b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/copyright new file mode 100644 index 00000000..b34963b1 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/copyright @@ -0,0 +1,30 @@ +This package was debianized by Anthony Towns on +Tue, 30 Jan 2001 10:54:45 +1000. + +It was written from scratch for Debian by Anthony Towns +based loosely on the code for constructing base tarballs as part of the +boot-floppies package. + +Copyright: + +Copyright (c) 2001-2005 Anthony Towns + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.docs b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.docs new file mode 100644 index 00000000..e845566c --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.docs @@ -0,0 +1 @@ +README diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.manpages b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.manpages new file mode 100644 index 00000000..d6a5e4ac --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/debootstrap.manpages @@ -0,0 +1 @@ +debootstrap.8 diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/gbp.conf b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/gbp.conf new file mode 100644 index 00000000..ac8e799c --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/gbp.conf @@ -0,0 +1,9 @@ +[DEFAULT] +compression = xz +pristine-tar = false +upstream-tag = devuan/1.0.85 + +[git-buildpackage] +upstream-tree = tag +tarball-dir = ../tarballs/ +export-dir = ../build-area/ diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/rules b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/rules new file mode 100755 index 00000000..23bc4a61 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/rules @@ -0,0 +1,47 @@ +#! /usr/bin/make -f + +ifeq (0,$(shell dpkg-vendor --derives-from Ubuntu; echo $$?)) + KEYRING := ubuntu-keyring +else ifeq (0,$(shell dpkg-vendor --derives-from Devuan; echo $$?)) + KEYRING := devuan-keyring +else ifeq (0,$(shell dpkg-vendor --derives-from Tanglu; echo $$?)) + KEYRING := tanglu-archive-keyring +else + KEYRING := debian-archive-keyring +endif + +%: + dh $@ + +# need to be root to make devices, so build is done in install target +override_dh_auto_build: + +override_dh_auto_install: + dh_auto_build + + $(MAKE) install DESTDIR=$(CURDIR)/debian/debootstrap + $(MAKE) install DESTDIR=$(CURDIR)/debian/debootstrap-udeb + + # remove scripts not needed by d-i + -rm -f debian/debootstrap-udeb/usr/share/debootstrap/scripts/potato \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/woody \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/sarge \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/warty \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/hoary \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/breezy \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/dapper \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/edgy \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/feisty \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/*.buildd \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/*.fakechroot \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/stable \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/testing \ + debian/debootstrap-udeb/usr/share/debootstrap/scripts/unstable + +override_dh_gencontrol: + dh_gencontrol -- -Vkeyring=$(KEYRING) + +# Specify gzip to mitigate #770217: +override_dh_builddeb: + dh_builddeb -pdebootstrap -- -Zgzip + dh_builddeb -pdebootstrap-udeb -- -Zxz diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debian/source/format b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/source/format new file mode 100644 index 00000000..af745b31 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debian/source/format @@ -0,0 +1 @@ +3.0 (git) diff --git a/cdist/preos/debootstrap/files/devuan-debootstrap/debootstrap b/cdist/preos/debootstrap/files/devuan-debootstrap/debootstrap new file mode 100755 index 00000000..71c70540 --- /dev/null +++ b/cdist/preos/debootstrap/files/devuan-debootstrap/debootstrap @@ -0,0 +1,703 @@ +#!/bin/sh +set -e + +VERSION='@VERSION@' + +unset TMP TEMP TMPDIR || true + +# might not be exported if we're running from init=/bin/sh or similar +export PATH + +########################################################################### + +if [ -z "$DEBOOTSTRAP_DIR" ]; then + if [ -x /debootstrap/debootstrap ]; then + DEBOOTSTRAP_DIR=/debootstrap + else + DEBOOTSTRAP_DIR=/usr/share/debootstrap + fi +fi + +. $DEBOOTSTRAP_DIR/functions +exec 4>&1 + +LANG=C +USE_COMPONENTS=main +KEYRING="" +DISABLE_KEYRING="" +FORCE_KEYRING="" +VARIANT="" +MERGED_USR="no" +ARCH="" +HOST_ARCH="" +HOST_OS="" +KEEP_DEBOOTSTRAP_DIR="" +USE_DEBIANINSTALLER_INTERACTION="" +SECOND_STAGE_ONLY="" +PRINT_DEBS="" +CHROOTDIR="" +MAKE_TARBALL="" +EXTRACTOR_OVERRIDE="" +UNPACK_TARBALL="" +ADDITIONAL="" +EXCLUDE="" +VERBOSE="" +CERTIFICATE="" +CHECKCERTIF="" +PRIVATEKEY="" + + +DEF_MIRROR="http://packages.devuan.org/merged" +DEF_HTTPS_MIRROR="https://packages.devuan.org/merged" + +export LANG USE_COMPONENTS EXCLUDE +umask 022 + +########################################################################### + +## phases: +## finddebs dldebs printdebs first_stage second_stage + +RESOLVE_DEPS=true + +WHAT_TO_DO="finddebs dldebs first_stage second_stage" +am_doing_phase () { + # usage: if am_doing_phase finddebs; then ...; fi + local x; + for x in "$@"; do + if echo " $WHAT_TO_DO " | grep -q " $x "; then return 0; fi + done + return 1 +} + +########################################################################### + +usage_err() +{ + info USAGE1 "usage: [OPTION]... [ [