Merge pull request 'master' (#2) from ungleich-public/cdist:master into master

Reviewed-on: stephan/cdist#2
This commit is contained in:
stephan 2022-07-13 11:58:31 +00:00
commit ff6b2d0abf
5 changed files with 23 additions and 6 deletions

View File

@ -2,13 +2,14 @@
set -u set -u
entry="$uri $distribution $component" entry="$uri $distribution $component"
cat << DONE cat << DONE
# Created by cdist ${__type##*/} # Created by cdist ${__type##*/}
# Do not change. Changes will be overwritten. # Do not change. Changes will be overwritten.
# #
# $name # $name
deb ${forcedarch} $entry deb ${options} $entry
DONE DONE
if [ -f "$__object/parameter/include-src" ]; then if [ -f "$__object/parameter/include-src" ]; then
echo "deb-src $entry" echo "deb-src $entry"

View File

@ -23,6 +23,9 @@ OPTIONAL PARAMETERS
arch arch
set this if you need to force and specific arch (ubuntu specific) set this if you need to force and specific arch (ubuntu specific)
signed-by
provide a GPG key fingerprint or keyring path for signature checks
state state
'present' or 'absent', defaults to 'present' 'present' or 'absent', defaults to 'present'
@ -56,6 +59,11 @@ EXAMPLES
--uri http://archive.canonical.com/ \ --uri http://archive.canonical.com/ \
--component partner --state present --component partner --state present
__apt_source goaccess \
--uri http://deb.goaccess.io/ \
--component main \
--signed-by C03B48887D5E56B046715D3297BD1A0133449C3D
AUTHORS AUTHORS
------- -------

View File

@ -31,9 +31,15 @@ fi
component="$(cat "$__object/parameter/component")" component="$(cat "$__object/parameter/component")"
if [ -f "$__object/parameter/arch" ]; then if [ -f "$__object/parameter/arch" ]; then
forcedarch="[arch=$(cat "$__object/parameter/arch")]" options="arch=$(cat "$__object/parameter/arch")"
else fi
forcedarch=""
if [ -f "$__object/parameter/signed-by" ]; then
options="$options signed-by=$(cat "$__object/parameter/signed-by")"
fi
if [ "$options" ]; then
options="[$options]"
fi fi
# export variables for use in template # export variables for use in template
@ -41,7 +47,7 @@ export name
export uri export uri
export distribution export distribution
export component export component
export forcedarch export options
# generate file from template # generate file from template
mkdir "$__object/files" mkdir "$__object/files"

View File

@ -1,4 +1,5 @@
state state
distribution distribution
component component
arch arch
signed-by

View File

@ -17,6 +17,7 @@ next:
* Type __file: make file uploading and attribute changes more atomic (Steven Armstrong) * Type __file: make file uploading and attribute changes more atomic (Steven Armstrong)
* Type __dot_file: Add support for using --file parameter (Stephan Leemburg) * Type __dot_file: Add support for using --file parameter (Stephan Leemburg)
* Type __apt_ppa: Replace custom "remove-apt-repository" with add-apt-repository -r (Romain Dartigues) * Type __apt_ppa: Replace custom "remove-apt-repository" with add-apt-repository -r (Romain Dartigues)
* Type __apt_source: Add signed-by parameter (Daniel Fancsali)
6.9.8: 2021-08-24 6.9.8: 2021-08-24
* Type __rsync: Rewrite (Ander Punnar) * Type __rsync: Rewrite (Ander Punnar)