ZYpp::Ptr God;
RuntimeData gData;
Settings gSettings;
+std::list<Error> errors;
ostream no_stream(NULL);
int exit_with_error( const std::string &error_str )
{
- gData.errors.push_back(Error(error_str));
+ errors.push_back(Error(error_str));
std::ofstream os(RESULT_FILE);
if ( os.good() )
{
// TranslatorExplanation %s = detailed low level (unstranslated) error message
string error = excpt_r.msg();
- gData.errors.push_back(str::form(_("Couldn't restore repository.\nDetail: %s"), error.c_str()));
+ errors.push_back(str::form(_("Couldn't restore repository.\nDetail: %s"), error.c_str()));
}
}
if ( gData.repos.size() == 0 )
{
- gData.errors.push_back( str::form( _( "There are no update repositories defined. Please add one or more update repositories in order to be notified of updates.") ) );
+ errors.push_back( str::form( _( "There are no update repositories defined. Please add one or more update repositories in order to be notified of updates.") ) );
}
God->addResolvables( God->target()->resolvables(), true);
extern ZYpp::Ptr God;
extern RuntimeData gData;
extern Settings gSettings;
+extern std::list<Error> errors;
Edition read_old_version()
{
out << "<?xml version='1.0'?>" << std::endl;
out << "<update-status version=\"" << version.asString() << "\">" << std::endl;
out << " <errors>" << std::endl;
- for ( std::list<Error>::const_iterator it = gData.errors.begin(); it != gData.errors.end(); ++it )
+ for ( std::list<Error>::const_iterator it = errors.begin(); it != errors.end(); ++it )
{
out << " <error>" << xml_escape(it->description) << "</error>" << endl;
}
//out << " <metadata token=\"" << token << "\"/>" << std::endl;
out << " <errors>" << std::endl;
- for ( std::list<Error>::const_iterator it = gData.errors.begin(); it != gData.errors.end(); ++it )
+ for ( std::list<Error>::const_iterator it = errors.begin(); it != errors.end(); ++it )
{
out << " <error>" << xml_escape(it->description) << "</error>" << endl;
}
#define XML_FILE_VERSION "/var/lib/zypp/cache/updates_xml_version"
#define RESULT_FILE "/var/lib/zypp/cache/updates_result.xml"
+struct Error
+{
+ Error( const std::string &desc )
+ : description(desc)
+ {}
+ std::string description;
+};
+
+extern std::list<Error> errors;
+
std::string read_old_token();
void save_token( const std::string &token );
zypp::Edition read_old_version();
#define ZYPP_CHECKPATCHES_LOG "/var/log/zypper.log"
#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "zypper"
-#define RANDOM_TOKEN "sad987432JJDJD948394DDDxxx22"
// ===== exit codes ======
struct Settings
{
Settings()
- : previous_token(RANDOM_TOKEN),
+ :
verbosity(0),
previous_code(-1),
disable_system_sources(false),
{}
std::list<zypp::Url> additional_sources;
- std::string previous_token;
/**
* Level of the amount of output.
zypp::RepoManagerOptions rm_options;
};
-struct Error
-{
- Error( const std::string &desc )
- : description(desc)
- {}
- std::string description;
-};
-
struct RuntimeData
{
RuntimeData()
: patches_count(0), security_patches_count(0), show_media_progress_hack(false)
{}
- std::list<Error> errors;
std::list<zypp::RepoInfo> repos;
int patches_count;
int security_patches_count;