forked from ungleich-public/cdist
finish __package_pacman
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
ddbcaf5152
commit
34fa8260f5
3 changed files with 11 additions and 8 deletions
|
@ -27,4 +27,4 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dpkg -l "$name" 2>/dev/null | awk '{ print $1 }'
|
pacman -Q "$name" 2>/dev/null | awk '{ print $2 }'
|
|
@ -18,9 +18,11 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Manage packages on Debian and co.
|
# Manage packages with Pacman (mostly archlinux)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
pacopts="--noconfirm --noprogressbar"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/name" ]; then
|
if [ -f "$__object/parameter/name" ]; then
|
||||||
name="$__object/parameter/name"
|
name="$__object/parameter/name"
|
||||||
else
|
else
|
||||||
|
@ -31,14 +33,16 @@ state="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
installed)
|
installed)
|
||||||
pkg_status="$(cat "$__object/explorer/pkg_status")"
|
pkg_version="$(cat "$__object/explorer/pkg_version")"
|
||||||
if [ "$pkg_status" != "ii" ]; then
|
|
||||||
echo apt-get --quiet --yes install \"$name\"
|
# Empty? Not installed.
|
||||||
|
if [ -z "$pkg_version" ]; then
|
||||||
|
echo pacman "$pacopts" -S \"$name\"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
deinstalled)
|
deinstalled)
|
||||||
if [ "$pkg_status" != "un" ]; then
|
if [ "$pkg_version" ]; then
|
||||||
echo apt-get --quiet --yes remove \"$name\"
|
echo pacman "$pacopts" -R \"$name\"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
name
|
name
|
||||||
version
|
|
||||||
|
|
Loading…
Reference in a new issue