WIP: Refinements on __apt_source & --signed-by #337
5 changed files with 14 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
|||
set -u
|
||||
|
||||
entry="$uri $distribution $component"
|
||||
options="$forcedarch $signed_by"
|
||||
options=${options## }; options=${options%% }
|
||||
|
||||
|
||||
cat << DONE
|
||||
# Created by cdist ${__type##*/}
|
||||
|
@ -9,8 +11,8 @@ cat << DONE
|
|||
#
|
||||
|
||||
# $name
|
||||
deb ${options} $entry
|
||||
deb ${options:+[${options}] }$entry
|
||||
DONE
|
||||
if [ -f "$__object/parameter/include-src" ]; then
|
||||
echo "deb-src $entry"
|
||||
echo "deb-src ${signed_by:+[${signed_by}] }$entry"
|
||||
fi
|
||||
|
|
|
@ -23,9 +23,6 @@ OPTIONAL PARAMETERS
|
|||
arch
|
||||
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
|
||||
'present' or 'absent', defaults to 'present'
|
||||
|
||||
|
@ -37,6 +34,12 @@ component
|
|||
space delimited list of components to enable. Defaults to an empty string.
|
||||
|
||||
|
||||
OPTIONAL MULTIPLE PARAMETERS
|
||||
----------------------------
|
||||
signed-by
|
||||
provide a GPG key fingerprint or keyring path for signature checks.
|
||||
nico
commented
Good, besides "may be repeated" is already implied by the optional multiple parameters and thus can be removed Good, besides "may be repeated" is already implied by the optional multiple parameters and thus can be removed
fancsali
commented
Fair point; should be fixed now. Fair point; should be fixed now.
|
||||
|
||||
|
||||
BOOLEAN PARAMETERS
|
||||
------------------
|
||||
include-src
|
||||
|
@ -68,6 +71,7 @@ EXAMPLES
|
|||
AUTHORS
|
||||
-------
|
||||
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
||||
Daniel Fancsali <fancsali--@--gmail.com>
|
||||
|
||||
|
||||
COPYING
|
||||
|
|
|
@ -31,11 +31,11 @@ fi
|
|||
component="$(cat "$__object/parameter/component")"
|
||||
|
||||
if [ -f "$__object/parameter/arch" ]; then
|
||||
options="arch=$(cat "$__object/parameter/arch")"
|
||||
forcedarch="arch=$(cat "$__object/parameter/arch")"
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
if [ "$options" ]; then
|
||||
|
|
|
@ -2,4 +2,3 @@ state
|
|||
distribution
|
||||
component
|
||||
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
Why is the front & back whitespace stripping necessary?
Because
$signed_by
and$forcedarch
can both be empty, so we might end up with something likesigned-by=ABCDEF
orarch=amd64
.Besides
$signed_by
itself is multi-valued and assembled by a for-loop.