ref: refs/heads/SuSE-SLE-10-SP3-Branch
commit 798fdd5360cbd5582e829b084fc7dac1a212817f
Author: Jan Kupec
Date: Mon Jul 7 13:29:32 2008 +0000
- exit in non-interactive mode if given package cannot be found
(bnc #403216)
---
src/zmart-misc.cc | 10 +++++++++-
src/zmart.h | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/zmart-misc.cc b/src/zmart-misc.cc
index 43097ea..2b8201e 100644
--- a/src/zmart-misc.cc
+++ b/src/zmart-misc.cc
@@ -137,6 +137,10 @@ void mark_for_install( const ResObject::Kind &kind,
cerr_vv << "... done" << endl;
if (!installer.item) {
cerr << kind << " '" << name << "' " << _("not found") << endl;
+ if (gSettings.non_interactive)
+ exit(ZYPPER_EXIT_INF_CAP_NOT_FOUND); // bnc #403216
+ else
+ WAR << kind << " '" << name << "' " << _("not found") << endl;
return; //error?
}
@@ -190,7 +194,11 @@ void mark_for_uninstall( const ResObject::Kind &kind,
);
cerr_vv << "... done" << endl;
if (!deleter.found) {
- cerr << _("Not found") << endl;
+ cerr << kind << " '" << name << "' " << _("not found") << endl;
+ if (gSettings.non_interactive)
+ exit(ZYPPER_EXIT_INF_CAP_NOT_FOUND); // bnc #403216
+ else
+ WAR << kind << " '" << name << "' " << _("not found") << endl;
return; //error?
}
}
diff --git a/src/zmart.h b/src/zmart.h
index 4107923..ed83279 100644
--- a/src/zmart.h
+++ b/src/zmart.h
@@ -42,6 +42,7 @@
#define ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED 101 // security update needed
#define ZYPPER_EXIT_INF_REBOOT_NEEDED 102 // reboot needed after install/upgrade
#define ZYPPER_EXIT_INF_RESTART_NEEDED 103 // restart of package manager itself needed
+#define ZYPPER_EXIT_INF_CAP_NOT_FOUND 104 // given capability not found (for install/remove)
struct Settings
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org