Compare commits
1 commit
master
...
__dpkg_pac
Author | SHA1 | Date | |
---|---|---|---|
|
1c2a5d7ac6 |
3 changed files with 21 additions and 9 deletions
|
@ -28,7 +28,12 @@
|
||||||
# do any checks or --force'ing.
|
# do any checks or --force'ing.
|
||||||
#
|
#
|
||||||
state=$( cat "$__object/parameter/state" )
|
state=$( cat "$__object/parameter/state" )
|
||||||
package=$( basename "$__object_id" )
|
package_path=$( cat "$__object/parameter/source" )
|
||||||
|
if command -v dpkg-deb 2>&1 > /dev/null; then
|
||||||
|
package="$(dpkg-deb --show --showformat='${binary:Package}_${Version}_${Architecture}.deb\n' ${package_path})"
|
||||||
|
else
|
||||||
|
package="$( basename "$__object_id" )"
|
||||||
|
fi
|
||||||
state_is="$(cat "$__object/explorer/pkg_state")"
|
state_is="$(cat "$__object/explorer/pkg_state")"
|
||||||
state_should=""
|
state_should=""
|
||||||
|
|
||||||
|
@ -37,7 +42,7 @@ state_should=""
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
present)
|
present)
|
||||||
echo "dpkg --install /var/cache/apt/archives/$__object_id"
|
echo "dpkg --install /var/cache/apt/archives/${package}"
|
||||||
echo "installed" >> "$__messages_out"
|
echo "installed" >> "$__messages_out"
|
||||||
;;
|
;;
|
||||||
absent)
|
absent)
|
||||||
|
|
|
@ -11,7 +11,8 @@ DESCRIPTION
|
||||||
This type is used on Debian and variants (like Ubuntu) to
|
This type is used on Debian and variants (like Ubuntu) to
|
||||||
install packages that are provided locally as \*.deb files.
|
install packages that are provided locally as \*.deb files.
|
||||||
|
|
||||||
The object given to this type must be the name of the deb package.
|
If the command `dpkg-deb(1)` is not available locally,
|
||||||
|
the object given to this type must be the name of the deb package.
|
||||||
The filename of the deb package has to follow Debian naming conventions, i.e.
|
The filename of the deb package has to follow Debian naming conventions, i.e.
|
||||||
`${binary:Package}_${Version}_${Architecture}.deb` (see `dpkg-query(1)` for
|
`${binary:Package}_${Version}_${Architecture}.deb` (see `dpkg-query(1)` for
|
||||||
details).
|
details).
|
||||||
|
|
|
@ -27,14 +27,20 @@
|
||||||
|
|
||||||
state=$( cat "$__object/parameter/state" )
|
state=$( cat "$__object/parameter/state" )
|
||||||
package_path=$( cat "$__object/parameter/source" )
|
package_path=$( cat "$__object/parameter/source" )
|
||||||
package=$( basename "$__object_id" )
|
if command -v dpkg-deb 2>&1 > /dev/null; then
|
||||||
|
package="$(dpkg-deb --show --showformat='${binary:Package}_${Version}_${Architecture}.deb\n' ${package_path})"
|
||||||
|
else
|
||||||
|
package="$( basename "$__object_id" )"
|
||||||
|
fi
|
||||||
state_is="$(cat "$__object/explorer/pkg_state")"
|
state_is="$(cat "$__object/explorer/pkg_state")"
|
||||||
state_should=""
|
state_should=""
|
||||||
|
|
||||||
[ "$state" = "absent" ] || state_should="$package"
|
[ "$state" = "absent" ] || state_should="$package"
|
||||||
[ "$state_is" = "$state_should" ] && exit 0
|
|
||||||
|
|
||||||
__file "/var/cache/apt/archives/$package" \
|
if [ "$state_is" = "$state_should" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
__file "/var/cache/apt/archives/$package" \
|
||||||
--source "$package_path" \
|
--source "$package_path" \
|
||||||
--state "$state"
|
--state "$state"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue