Author: jkupec
Date: Thu Apr 26 11:18:53 2007
New Revision: 5451
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5451&view=rev
Log:
merged zypp-checkpatches.cc from SP1 branch
Modified:
trunk/zypper/src/zypp-checkpatches.cc
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypp-checkpatches.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypp-checkpatches.cc?rev=5451&r1=5450&r2=5451&view=diff
==============================================================================
--- trunk/zypper/src/zypp-checkpatches.cc (original)
+++ trunk/zypper/src/zypp-checkpatches.cc Thu Apr 26 11:18:53 2007
@@ -14,6 +14,7 @@
#include <fstream>
#include <sstream>
+#include
#include
#include "checkpatches-keyring-callbacks.h"
@@ -89,6 +90,23 @@
using zypp::source::SourceInfo;
#endif
+int exit_with_error( const std::string &error_str )
+{
+ gData.errors.push_back(Error(error_str));
+
+ std::ofstream os(RESULT_FILE);
+ if ( os.good() )
+ {
+ render_error( Edition(XML_FORMAT_VERSION), os );
+ render_error( Edition(XML_FORMAT_VERSION), cout );
+ os.close();
+ }
+ // save a random token so we try again next time
+ save_token(utils::randomString(48));
+ save_version(Edition(XML_FORMAT_VERSION));
+ return -1;
+}
+
int main(int argc, char **argv)
{
const char *logfile = getenv("ZYPP_LOGFILE");
@@ -103,23 +121,16 @@
{
God = zypp::getZYpp();
}
- catch (Exception & excpt_r)
+ catch ( const ZYppFactoryException & excpt_r )
{
ZYPP_CAUGHT (excpt_r);
-
- gData.errors.push_back(Error(excpt_r.msg()));
-
- std::ofstream os(RESULT_FILE);
- if ( os.good() )
- {
- render_error( Edition(XML_FORMAT_VERSION), os );
- render_error( Edition(XML_FORMAT_VERSION), cout );
- os.close();
- }
- // save a random token so we try again next time
- save_token(utils::randomString(48));
- save_version(Edition(XML_FORMAT_VERSION));
- return -1;
+ string error_str( _("The updater could not access the package manager engine. This usually happens when you have another application (like YaST) using it at the same time. Please close other applications and check again for updates." ) );
+ return exit_with_error( error_str );
+ }
+ catch ( const Exception & excpt_r)
+ {
+ ZYPP_CAUGHT (excpt_r);
+ return exit_with_error(excpt_r.msg());
}
SourceManager_Ptr manager;
@@ -197,7 +208,9 @@
}
catch (const Exception &excpt_r )
{
- gData.errors.push_back("Couldn't restore source" + ( excpt_r.msg().empty() ? "\n" : (":\n" + excpt_r.msg())));
+ // TranslatorExplanation %s = detailed low level (unstranslated) error message
+ string error = excpt_r.msg();
+ gData.errors.push_back(str::form(_("Couldn't restore source.\nDetail: %s"), error.c_str()));
}
}
@@ -244,6 +257,11 @@
God->addResolvables(it->resolvables());
}
+ if ( gData.sources.size() == 0 )
+ {
+ gData.errors.push_back( str::form( _( "There are no update sources defined. Please add one or more update sources in order to be notified of updates.") ) );
+ }
+
God->addResolvables( God->target()->resolvables(), true);
God->resolver()->establishPool();
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=5451&r1=5450&r2=5451&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Thu Apr 26 11:18:53 2007
@@ -130,7 +130,6 @@
"\t--terse, -t\t\tTerse output for machine consumption\n"
"\t--table-style, -s\tTable style (integer)\n"
"\t--rug-compatible, -r\tTurn on rug compatibility\n"
- "\t--rug-compatible, -r\tTurn on rug compatibility\n"
"\t--non-interactive\tDon't ask anything, use default answers automatically. (under development)\n"
"\t--root, -R <dir>\tOperate on a different root directory\n");
;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org