forked from ungleich-public/cdist
Refinements on __apt_source & --signed-by
Allow multple GPG keys/keyrings to be specified, and also include them for the source repositories (deb-src lines). Also fix cases where we ended up with extra leading/trainling or double space character(s) between parts of the config line.
This commit is contained in:
parent
0ae37b3445
commit
b5c8294dc6
5 changed files with 9 additions and 6 deletions
|
@ -2,6 +2,8 @@
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
entry="$uri $distribution $component"
|
entry="$uri $distribution $component"
|
||||||
|
options="$forcedarch $signed_by"
|
||||||
|
options=${options## }; options=${options%% }
|
||||||
|
|
||||||
cat << DONE
|
cat << DONE
|
||||||
# Created by cdist ${__type##*/}
|
# Created by cdist ${__type##*/}
|
||||||
|
@ -9,8 +11,8 @@ cat << DONE
|
||||||
#
|
#
|
||||||
|
|
||||||
# $name
|
# $name
|
||||||
deb ${options} $entry
|
deb ${options:+[${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 ${signed_by:+[${signed_by}] }$entry"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -24,7 +24,7 @@ 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
|
signed-by
|
||||||
provide a GPG key fingerprint or keyring path for signature checks
|
provide a GPG key fingerprint or keyring path for signature checks. May be repeated.
|
||||||
|
|
||||||
state
|
state
|
||||||
'present' or 'absent', defaults to 'present'
|
'present' or 'absent', defaults to 'present'
|
||||||
|
@ -68,6 +68,7 @@ EXAMPLES
|
||||||
AUTHORS
|
AUTHORS
|
||||||
-------
|
-------
|
||||||
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
||||||
|
Daniel Fancsali <fancsali--@--gmail.com>
|
||||||
|
|
||||||
|
|
||||||
COPYING
|
COPYING
|
||||||
|
|
|
@ -31,11 +31,11 @@ fi
|
||||||
component="$(cat "$__object/parameter/component")"
|
component="$(cat "$__object/parameter/component")"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/arch" ]; then
|
if [ -f "$__object/parameter/arch" ]; then
|
||||||
options="arch=$(cat "$__object/parameter/arch")"
|
forcedarch="arch=$(cat "$__object/parameter/arch")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/signed-by" ]; then
|
if [ -f "$__object/parameter/signed-by" ]; then
|
||||||
options="$options signed-by=$(cat "$__object/parameter/signed-by")"
|
signed_by="${signed_by:${signed_by} }signed-by=$(cat "$__object/parameter/signed-by")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$options" ]; then
|
if [ "$options" ]; then
|
||||||
|
|
|
@ -2,4 +2,3 @@ state
|
||||||
distribution
|
distribution
|
||||||
component
|
component
|
||||||
arch
|
arch
|
||||||
signed-by
|
|
||||||
|
|
1
cdist/conf/type/__apt_source/parameter/optional_multiple
Normal file
1
cdist/conf/type/__apt_source/parameter/optional_multiple
Normal file
|
@ -0,0 +1 @@
|
||||||
|
signed-by
|
Loading…
Reference in a new issue