Commit 1f554efb authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-simulate: skip simulate if zypper does not have --dry-run

parent 5e523df0
......@@ -109,6 +109,7 @@ epm_ni_install_names()
sudocmd urpmi --auto $URPMOPTIONS $@
return ;;
zypper-rpm)
# FIXME: returns true ever no package found, need check for "no found", "Nothing to do."
yes | sudocmd zypper --non-interactive $ZYPPEROPTIONS install $@
return ;;
pkg_add)
......@@ -141,6 +142,7 @@ epm_install_files()
case $PMTYPE in
apt-rpm)
sudocmd rpm -Uvh $force $nodeps $@ && return
# TODO: check for "is already installed"
# if run with --nodeps, do not fallback on hi level
[ -n "$nodeps" ] && return
......
#!/bin/sh
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2013 Etersoft
# Copyright (C) 2012-2013 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -20,6 +20,12 @@
load_helper epm-install
load_helper epm-search
# for zypper before SUSE/11.0
__use_zypper_dry_run()
{
a= zypper install --help 2>&1 | grep -q -- "--dry-run" && echo "--dry-run"
}
_epm_do_simulate()
{
local CMD
......@@ -38,7 +44,11 @@ _epm_do_simulate()
CMD="urpmi --test --auto"
;;
zypper-rpm)
CMD="zypper --non-interactive install --dry-run"
if ! __use_zypper_dry_run >/dev/null ; then
echo "zypper is too old: does not support --dry-run"
return
fi
CMD="zypper --non-interactive install"
;;
emerge)
echo "FIXME: Skip with emerge"
......
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