Browse Source

First draft of __apt_pin

evilham-compatibility-fixes
fancsali 1 year ago
parent
commit
0734288483
  1. 53
      cdist/conf/type/__apt_pin/man.rst
  2. 63
      cdist/conf/type/__apt_pin/manifest
  3. 1
      cdist/conf/type/__apt_pin/parameter/default/package
  4. 1
      cdist/conf/type/__apt_pin/parameter/default/state
  5. 2
      cdist/conf/type/__apt_pin/parameter/optional
  6. 2
      cdist/conf/type/__apt_pin/parameter/required

53
cdist/conf/type/__apt_pin/man.rst vendored

@ -0,0 +1,53 @@
cdist-type__apt_pin(7)
======================
NAME
----
cdist-type__apt_pin - TODO
DESCRIPTION
-----------
This space intentionally left blank.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# TODO
__apt_pin
SEE ALSO
--------
:strong:`TODO`\ (7)
AUTHORS
-------
Daniel Fancsali <fancsali@gmail.com>
COPYING
-------
Copyright \(C) 2021 Daniel Fancsali. 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.

63
cdist/conf/type/__apt_pin/manifest vendored

@ -0,0 +1,63 @@
#!/bin/sh -e
#
# 2021 Daniel Fancsali (fancsali@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 <http://www.gnu.org/licenses/>.
#
os=$(cat "$__global/explorer/os")
state="$(cat "$__object/parameter/state")"
package="$(cat "$__object/parameter/package")"
distribution="$(cat "$__object/parameter/distribution")"
priority="$(cat "$__object/parameter/priority")"
case "$os" in
debian|ubuntu|devuan)
;;
*)
printf "This type is specific to Debian and it's derivatives" >&2
printf "If you feel there's an equivalent functionality in %s, please contribute..." "$os" >&2
exit 1
;;
esac
if [ "$package" = "*" ]; then
name="default"
else
name="$__object_id"
fi
case $distribution in
stabletesting|unsatbel|experimental)
pin="release a=$distribution"
;;
*)
pin="release n=$distribution"
;;
esac
__file /etc/apt/preferences.d/$name \
--owner root --group root --mode 0644 \
--state "$state" \
--source - << EOF
Package: $package
Pin: $pin
Pin-Priority: $priority
EOF

1
cdist/conf/type/__apt_pin/parameter/default/package vendored

@ -0,0 +1 @@
*

1
cdist/conf/type/__apt_pin/parameter/default/state vendored

@ -0,0 +1 @@
present

2
cdist/conf/type/__apt_pin/parameter/optional vendored

@ -0,0 +1,2 @@
state
package

2
cdist/conf/type/__apt_pin/parameter/required vendored

@ -0,0 +1,2 @@
distribution
priority
Loading…
Cancel
Save