__package_apt to accept .dpk file as --source

This commit is contained in:
fancsali 2022-07-09 11:27:04 +01:00
parent 77d9a757ec
commit 121a9c23bf
2 changed files with 20 additions and 3 deletions

View file

@ -101,10 +101,26 @@ if [ ! -f /var/cache/apt/pkgcache.bin ] || [ "\$( stat --format %Y /var/cache/ap
then echo apt-get $apt_opts update > /dev/null 2>&1 || true then echo apt-get $apt_opts update > /dev/null 2>&1 || true
fi fi
EOF EOF
if [ -n "$version" ]; then if [ -f "$__object/parameter/source" ]; then
name="${name}=${version}" source_path="$(cat "$__object/parameter/source")"
tempfile="$($__remote_exec $__target_host "mktemp -t cidst.XXXXX.${source_path##*/}")"
# IPv6 fix
if echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
then
my_target_host="[${__target_host}]"
else
my_target_host="${__target_host}"
fi
$__remote_copy "$source_path" "${my_target_host}:$tempfile"
echo "$aptget $recommendsparam install $tempfile"
else
if [ -n "$version" ]; then
name="${name}=${version}"
fi
echo "$aptget $recommendsparam install $target_release '$name'"
fi fi
echo "$aptget $recommendsparam install $target_release '$name'"
echo "installed" >> "$__messages_out" echo "installed" >> "$__messages_out"
;; ;;
absent) absent)

View file

@ -2,3 +2,4 @@ name
version version
state state
target-release target-release
source