Commit 69f74989 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm full-upgrade: implement --dry-run (--just-print) support

parent 8935fb71
......@@ -42,11 +42,11 @@ epm_clean()
case $PMTYPE in
apt-rpm)
sudocmd apt-get clean
sudocmd apt-get clean $dryrun
[ -n "$force" ] && __remove_alt_apt_cache_file
;;
apt-dpkg)
sudocmd apt-get clean
sudocmd apt-get clean $dryrun
[ -n "$force" ] && __remove_deb_apt_cache_file
;;
aptitude-dpkg)
......
......@@ -57,11 +57,11 @@ epm_full_upgrade()
docmd epm update || fatal "repository updating is failed."
[ -n "$quiet" ] || echo
docmd epm upgrade || fatal "upgrading of the system is failed."
docmd epm $dryrun upgrade || fatal "upgrading of the system is failed."
if [ -z "$full_upgrade_no_kernel_update" ] ; then
[ -n "$quiet" ] || echo
docmd epm update-kernel || fatal "updating of the kernel is failed."
docmd epm $dryrun update-kernel || fatal "updating of the kernel is failed."
fi
# disable epm play --update for non ALT Systems
......@@ -69,23 +69,23 @@ epm_full_upgrade()
if [ -z "$full_upgrade_no_epm_play" ] ; then
[ -n "$quiet" ] || echo
docmd epm play --update all || fatal "updating of applications installed via epm play is failed."
docmd epm $dryrun play --update all || fatal "updating of applications installed via epm play is failed."
fi
if [ -z "$full_upgrade_no_flatpack" ] ; then
if is_command flatpak ; then
[ -n "$quiet" ] || echo
docmd flatpak update
docmd flatpak update $(subst_option non_interactive --assume-yes) $(subst_option dryrun --no-deploy)
fi
fi
if [ -z "$full_upgrade_no_snap" ] ; then
if is_command snap && serv snapd exists && serv snapd status >/dev/null ; then
[ -n "$quiet" ] || echo
sudocmd snap refresh
sudocmd snap refresh $(subst_option dryrun --list)
fi
fi
[ -n "$quiet" ] || echo
docmd epm clean
docmd epm $dryrun clean
}
......@@ -151,6 +151,8 @@ __epm_play_run()
# keep EPM_AUTO for non epm code (epm uses EPM_OPTIONS now)
[ -n "$non_interactive" ] && export EPM_AUTO="--auto"
export EPM_OPTIONS="$EPM_OPTIONS $dryrun"
local bashopt=''
[ -n "$verbose" ] && bashopt='-x'
#info "Running $($script --description 2>/dev/null) ..."
......@@ -414,6 +416,7 @@ case "$1" in
local list
if [ "$1" = "all" ] ; then
shift
info "Retrieving list of installed apps ..."
list="$(__list_installed_app)"
else
list="$*"
......@@ -436,6 +439,7 @@ case "$1" in
local list
if [ "$1" = "all" ] ; then
shift
info "Retrieving list of installed apps ..."
list="$(__list_installed_app)"
else
list="$*"
......
......@@ -98,7 +98,7 @@ epm_upgrade()
case $PMTYPE in
apt-rpm|apt-dpkg)
local APTOPTIONS="$(subst_option non_interactive -y) $(subst_option verbose "-V -o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")"
local APTOPTIONS="$dryrun $(subst_option non_interactive -y) $(subst_option verbose "-V -o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1")"
CMD="apt-get $APTOPTIONS $noremove $force_yes dist-upgrade"
;;
aptitude-dpkg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment