Compare commits
6 commits
master
...
mlo-01-fun
Author | SHA1 | Date | |
---|---|---|---|
a83bac3448 | |||
4f6d528137 | |||
e50ea3358a | |||
d23cef6a1d | |||
a441a89d97 | |||
5c96063725 |
8 changed files with 13 additions and 3 deletions
|
@ -23,7 +23,7 @@ package
|
||||||
Package name, glob or regular expression to match (multiple) packages. If not specified `__object_id` is used.
|
Package name, glob or regular expression to match (multiple) packages. If not specified `__object_id` is used.
|
||||||
|
|
||||||
priority
|
priority
|
||||||
The priority value to assign to matching packages. Deafults to 500. (To match the default target distro's priority)
|
The priority value to assign to matching packages. Defaults to 500. (To match the default target distro's priority)
|
||||||
|
|
||||||
state
|
state
|
||||||
Will be passed to underlying `__file` type; see there for valid values and defaults.
|
Will be passed to underlying `__file` type; see there for valid values and defaults.
|
||||||
|
|
|
@ -57,6 +57,11 @@ __file "/etc/apt/preferences.d/$name" \
|
||||||
--owner root --group root --mode 0644 \
|
--owner root --group root --mode 0644 \
|
||||||
--state "$state" \
|
--state "$state" \
|
||||||
--source - << EOF
|
--source - << EOF
|
||||||
|
# Created by cdist ${__type##*/}
|
||||||
|
# Do not change. Changes will be overwritten.
|
||||||
|
#
|
||||||
|
|
||||||
|
# $name
|
||||||
Package: $package
|
Package: $package
|
||||||
Pin: $pin
|
Pin: $pin
|
||||||
Pin-Priority: $priority
|
Pin-Priority: $priority
|
||||||
|
|
1
cdist/conf/type/__apt_pin/parameter/default/priority
Normal file
1
cdist/conf/type/__apt_pin/parameter/default/priority
Normal file
|
@ -0,0 +1 @@
|
||||||
|
500
|
|
@ -1,2 +1,3 @@
|
||||||
state
|
state
|
||||||
package
|
package
|
||||||
|
priority
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
distribution
|
distribution
|
||||||
priority
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ else
|
||||||
type="pkg_freebsd"
|
type="pkg_freebsd"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
gentoo) type="emerge" ;;
|
gentoo|funtoo) type="emerge" ;;
|
||||||
suse) type="zypper" ;;
|
suse) type="zypper" ;;
|
||||||
openwrt) type="opkg" ;;
|
openwrt) type="opkg" ;;
|
||||||
openbsd) type="pkg_openbsd" ;;
|
openbsd) type="pkg_openbsd" ;;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
# Assume systemd if systemctl is in PATH.
|
# Assume systemd if systemctl is in PATH.
|
||||||
if [ "$(command -v systemctl)" ]; then
|
if [ "$(command -v systemctl)" ]; then
|
||||||
printf "systemd"
|
printf "systemd"
|
||||||
|
elif [ "$(command -v rc)" ]; then
|
||||||
|
printf "openrc"
|
||||||
else
|
else
|
||||||
printf "unknown"
|
printf "unknown"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -6,4 +6,6 @@ action="$(cat "$__object/parameter/action")"
|
||||||
|
|
||||||
if [ "$manager" = "unknown" ]; then
|
if [ "$manager" = "unknown" ]; then
|
||||||
echo "service '$name' '$action'"
|
echo "service '$name' '$action'"
|
||||||
|
elif [ "$manager" = "openrc" ]; then
|
||||||
|
echo "rc-service $name $action"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue