Hello community, here is the log from the commit of package zypper for openSUSE:Factory checked in at Mon Mar 8 18:28:49 CET 2010. -------- --- zypper/zypper.changes 2010-02-26 15:06:10.000000000 +0100 +++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2010-03-03 16:55:26.000000000 +0100 @@ -1,0 +2,18 @@ +Wed Mar 3 16:50:07 CET 2010 - jkupec@suse.cz + +- Ignoring trailing slash when matching repos by URL (bnc #585082) + +------------------------------------------------------------------- +Tue Mar 2 11:46:40 CET 2010 - jkupec@suse.cz + +- Checking for running PackageKit. If it's running zypper offers + to suggest to it to quit (bnc#580513). + +------------------------------------------------------------------- +Mon Mar 1 15:11:40 CET 2010 - jkupec@suse.cz + +- Show installed packages only from specified repos when + 'zypper [-i|-u] -r repo' is used (bnc#467106) +- 1.2.21 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- zypper-1.2.21.tar.bz2 New: ---- zypper-1.4.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zypper.spec ++++++ --- /var/tmp/diff_new_pack.WxFZn0/_old 2010-03-08 18:28:00.000000000 +0100 +++ /var/tmp/diff_new_pack.WxFZn0/_new 2010-03-08 18:28:00.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package zypper (Version 1.2.21) +# spec file for package zypper (Version 1.4.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -33,7 +33,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build AutoReqProv: on Summary: Command line software manager using libzypp -Version: 1.2.21 +Version: 1.4.0 Release: 1 Source: %{name}-%{version}.tar.bz2 Source1: %{name}-rpmlintrc ++++++ zypper-1.2.21.tar.bz2 -> zypper-1.4.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/VERSION.cmake new/zypper-1.4.0/VERSION.cmake --- old/zypper-1.2.21/VERSION.cmake 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/VERSION.cmake 2010-03-03 16:51:09.000000000 +0100 @@ -30,8 +30,8 @@ # note in the changes file. # SET(VERSION_MAJOR "1") -SET(VERSION_MINOR "2") -SET(VERSION_PATCH "21") +SET(VERSION_MINOR "4") +SET(VERSION_PATCH "0") -# LAST RELEASED: 1.2.20 +# LAST RELEASED: 1.2.21 #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/doc/zypper.8 new/zypper-1.4.0/doc/zypper.8 --- old/zypper-1.2.21/doc/zypper.8 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/doc/zypper.8 2010-03-03 16:51:09.000000000 +0100 @@ -1,4 +1,4 @@ -.TH "zypper" "8" "1.2.19" "zypper" "System Tools" +.TH "zypper" "8" "1.4.0" "zypper" "System Tools" .SH "SYNTAX" .LP zypper [\fI\-\-global\-opts\fR] <\fBcommand\fR> [\fI\-\-command\-opts\fR] [\fBcommand-arguments\fR] @@ -747,8 +747,18 @@ .TP \fBsearch\fR (\fBse\fR) [\fIoptions\fR] [\fBquerystring\fR] ... Search for packages matching given strings. * (any substring) and ? (any character) wildcards can also be used within search strings. -.IP -Results of search are printed in a table with following columns: S (status), Catalog, Type (type of package), Name, Version, Arch (architecture). Status column can contain following values: i - installed, v - another version installed, or an empty space for neither of the former cases. + +Results of search are printed in a table with following columns: +S (status), Catalog, Type (type of package), Name, Version, +Arch (architecture). The status column can contain the following +values: i - installed, v - another version installed, +or an empty space for neither of the former cases. + +The 'v' status is only shown if the version or the repository +matters (\fI\-\-details\fR or \fI\-\-repo\fR is used), and the installed +version differs from the one listed or is from a repository other +than specified. + .IP This command accepts the following options: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/package/zypper.changes new/zypper-1.4.0/package/zypper.changes --- old/zypper-1.2.21/package/zypper.changes 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/package/zypper.changes 2010-03-03 16:51:09.000000000 +0100 @@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Wed Mar 3 16:50:07 CET 2010 - jkupec@suse.cz + +- Ignoring trailing slash when matching repos by URL (bnc #585082) + +------------------------------------------------------------------- +Tue Mar 2 11:46:40 CET 2010 - jkupec@suse.cz + +- Checking for running PackageKit. If it's running zypper offers + to suggest to it to quit (bnc#580513). + +------------------------------------------------------------------- +Mon Mar 1 15:11:40 CET 2010 - jkupec@suse.cz + +- Show installed packages only from specified repos when + 'zypper [-i|-u] -r repo' is used (bnc#467106) +- 1.2.21 + +------------------------------------------------------------------- Thu Feb 25 22:18:48 CET 2010 - jkupec@suse.cz - Added a few forgotten strings for translation (bnc #581332) Files old/zypper-1.2.21/po/sle-zypper-po.tar.bz2 and new/zypper-1.4.0/po/sle-zypper-po.tar.bz2 differ Files old/zypper-1.2.21/po/zypper-po.tar.bz2 and new/zypper-1.4.0/po/zypper-po.tar.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/Zypper.cc new/zypper-1.4.0/src/Zypper.cc --- old/zypper-1.2.21/src/Zypper.cc 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/src/Zypper.cc 2010-03-03 16:51:09.000000000 +0100 @@ -2440,13 +2440,44 @@ try { const char *roh = getenv("ZYPP_READONLY_HACK"); + if (roh != NULL && roh[0] == '1') zypp_readonly_hack::IWantIt (); + else if ( command() == ZypperCommand::LIST_REPOS || command() == ZypperCommand::LIST_SERVICES || command() == ZypperCommand::TARGET_OS ) zypp_readonly_hack::IWantIt (); // #247001, #302152 + // check for packagekit (bnc #580513) + else if (packagekit_running()) + { + // ask user wheter to tell it to quit + out().info(_( + "PackageKit is blocking zypper. This happens if you have an" + " updater applet or other software management application using" + " PackageKit running." + )); + + bool reply = read_bool_answer( + PROMPT_PACKAGEKIT_QUIT, _("Tell PackageKit to quit?"), false); + + // tell it to quit + while (reply) + { + packagekit_suggest_quit(); + ::sleep(1); + if (packagekit_running()) + { + out().info(_("PackageKit is still running (probably busy).")); + reply = read_bool_answer( + PROMPT_PACKAGEKIT_QUIT, _("Try again?"), false); + } + else + reply = false; + } + } + God = zypp::getZYpp(); } catch (ZYppFactoryException & excpt_r) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/install.cc new/zypper-1.4.0/src/install.cc --- old/zypper-1.2.21/src/install.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/install.cc 2010-03-03 16:51:09.000000000 +0100 @@ -87,7 +87,7 @@ candidate = s->installedObj(); if (s->installedObj() && - equalNVRA(*s->installedObj().resolvable(), *candidate.resolvable()) && + identical(s->installedObj(), candidate) && !force) { // if it is broken install anyway, even if it is installed @@ -316,7 +316,7 @@ bool theoneinstalled; // is the One installed ? if (!traits::isPseudoInstalled(s.kind())) theoneinstalled = !s.installedEmpty() && - equalNVRA(*s.installedObj().resolvable(), *theone.resolvable()); + identical(s.installedObj(), theone); else if (s.kind() == ResKind::patch) theoneinstalled = theone.isRelevant() && theone.isSatisfied(); else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/misc.cc new/zypper-1.4.0/src/misc.cc --- old/zypper-1.2.21/src/misc.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/misc.cc 2010-03-03 16:51:09.000000000 +0100 @@ -277,7 +277,7 @@ for_(it, s->availableBegin(), s->availableEnd()) { - if (equalNVRA(*it->resolvable(), *inst.resolvable())) + if (identical(*it, inst)) { inst_with_repo = *it; ++count_installed_repo; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/output/prompt.h new/zypper-1.4.0/src/output/prompt.h --- old/zypper-1.2.21/src/output/prompt.h 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/output/prompt.h 2010-03-03 16:51:09.000000000 +0100 @@ -46,7 +46,8 @@ PROMPT_YN_REMOVE_LOCK = 19, PROMPT_PATCH_MESSAGE_CONTINUE = 20, PROMPT_ARI_PATCH_SCRIPT_PROBLEM = 21, - PROMPT_MEDIA_EJECT = 22 + PROMPT_MEDIA_EJECT = 22, + PROMPT_PACKAGEKIT_QUIT = 23 } PromptId; #endif /*PROMPT_H_*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/repos.cc new/zypper-1.4.0/src/repos.cc --- old/zypper-1.2.21/src/repos.cc 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/src/repos.cc 2010-03-03 16:51:09.000000000 +0100 @@ -321,7 +321,16 @@ { try { - url::ViewOption urlview = url::ViewOption::DEFAULTS + url::ViewOption::WITH_PASSWORD; + // first strip any trailing slash from the path in URLs before comparing + // (bnc #585082) + // we can afford this because we expect that the repo urls are directories + // and it is common practice in servers and operating systems to accept + // directory paths both with and without trailing slashes. + Url uurl(str); + uurl.setPathName(Pathname(uurl.getPathName()).asString()); + + url::ViewOption urlview = + url::ViewOption::DEFAULTS + url::ViewOption::WITH_PASSWORD; if (zypper.cOpts().count("loose-auth")) { urlview = urlview @@ -331,20 +340,36 @@ if (zypper.cOpts().count("loose-query")) urlview = urlview - url::ViewOptions::WITH_QUERY_STR; + // need to do asString(withurlview) comparison here because the user-given + // string is expected to have no credentials or query if (!(urlview.has(url::ViewOptions::WITH_PASSWORD) && urlview.has(url::ViewOptions::WITH_QUERY_STR))) { for_(urlit, known_it->baseUrlsBegin(), known_it->baseUrlsEnd()) - if (urlit->asString(urlview) == Url(str).asString(urlview)) { - found = true; - break; + Url newrl(*urlit); + newrl.setPathName(Pathname(newrl.getPathName()).asString()); + if (newrl.asString(urlview) == uurl.asString(urlview)) + { + found = true; + break; + } } } + // ordinary == comparison suffices here (quicker) else - found = - find(known_it->baseUrlsBegin(),known_it->baseUrlsEnd(),Url(str)) - != known_it->baseUrlsEnd(); + { + for_(urlit, known_it->baseUrlsBegin(), known_it->baseUrlsEnd()) + { + Url newrl(*urlit); + newrl.setPathName(Pathname(newrl.getPathName()).asString()); + if (newrl == uurl) + { + found = true; + break; + } + } + } if (found) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/search.cc new/zypper-1.4.0/src/search.cc --- old/zypper-1.2.21/src/search.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/search.cc 2010-03-03 16:51:09.000000000 +0100 @@ -30,6 +30,14 @@ , _inst_notinst(inst_notinst) , _show_alias(Zypper::instance()->config().show_alias) { + Zypper & zypper = *Zypper::instance(); + if (zypper.cOpts().find("repo") != zypper.cOpts().end()) + { + list<RepoInfo> & repos = zypper.runtimeData().repos; + for_(it, repos.begin(), repos.end()) + _repos.insert(it->alias()); + } + TableHeader header; if (_gopts.is_rug_compatible) @@ -120,7 +128,9 @@ installed = false; for_(instit, s->installedBegin(), s->installedEnd()) { - if (equalNVRA(*instit->resolvable(), *pi.resolvable())) + if (identical(*instit, pi) && + (_repos.empty() || + _repos.find(pi.resolvable()->repoInfo().alias())!=_repos.end())) { installed = true; break; @@ -168,8 +178,12 @@ *_table << row; } + // --uninstalled if (_inst_notinst == false) return true; + // --repo => we only want the repo resolvables, not @System (bnc #467106) + if (!_repos.empty()) + return true; // now list the system packages for_(it, s->installedBegin(), s->installedEnd()) @@ -177,7 +191,7 @@ // show installed objects only if there is no counterpart in repos bool has_counterpart = false; for_(ait, s->availableBegin(), s->availableEnd()) - if (equalNVRA(*it->resolvable(), *ait->resolvable())) + if (identical(*it, *ait)) { has_counterpart = true; break; @@ -224,6 +238,14 @@ , _gopts(Zypper::instance()->globalOpts()) , inst_notinst(installed_only) { + Zypper & zypper = *Zypper::instance(); + if (zypper.cOpts().find("repo") != zypper.cOpts().end()) + { + list<RepoInfo> & repos = zypper.runtimeData().repos; + for_(it, repos.begin(), repos.end()) + _repos.insert(it->alias()); + } + TableHeader header; // translators: S for installed Status header << _("S"); @@ -246,18 +268,54 @@ TableRow row; - bool installed; + // whether to show the solvable as 'installed' + bool installed = false; + if (zypp::traits::isPseudoInstalled(s->kind())) installed = s->theObj().isSatisfied(); + // check for installed counterpart in one of specified repos (bnc #467106) + else if (!_repos.empty()) + { + for_(ait, s->availableBegin(), s->availableEnd()) + for_(iit, s->installedBegin(), s->installedEnd()) + if (identical(*ait, *iit) && + _repos.find(ait->resolvable()->repoInfo().alias()) != _repos.end()) + { + installed = true; + break; + } + } + // if no --repo is specified, we don't care where does the installed package + // come from else installed = !s->installedEmpty(); - if (s->kind() != zypp::ResKind::srcpackage && installed) + + if (s->kind() != zypp::ResKind::srcpackage) { - // not-installed only - if (inst_notinst == false) - return true; - row << "i"; + if (installed) + { + // not-installed only + if (inst_notinst == false) + return true; + row << "i"; + } + // this happens if the solvable has installed objects, but no counterpart + // of them in specified repos + else if (s->hasInstalledObj()) + { + // not-installed only + if (inst_notinst == true) + return true; + row << "v"; + } + else + { + // installed only + if (inst_notinst == true) + return true; + row << ""; + } } else { @@ -266,6 +324,7 @@ return true; row << ""; } + row << s->name(); row << s->theObj()->summary(); row << kind_to_string_localized(s->kind(), 1); @@ -501,7 +560,7 @@ { if (notinst_only) continue; - row << (equalNVRA(*installed.resolvable(), *pi.resolvable()) ? "i" : "v"); + row << (identical(installed, pi) ? "i" : "v"); } else { @@ -620,7 +679,7 @@ if (installed) { - if (equalNVRA(*installed.resolvable(), *pi.resolvable())) + if (identical(installed, pi)) { if (notinst_only) continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/search.h new/zypper-1.4.0/src/search.h --- old/zypper-1.2.21/src/search.h 2010-02-26 15:05:20.000000000 +0100 +++ new/zypper-1.4.0/src/search.h 2010-03-03 16:51:09.000000000 +0100 @@ -23,6 +23,8 @@ // the table used for output Table * _table; const GlobalOptions & _gopts; + /** Aliases of repos specified as --repo */ + std::setstd::string _repos; zypp::TriBool _inst_notinst; bool _show_alias; @@ -38,6 +40,8 @@ // the table used for output Table * _table; const GlobalOptions & _gopts; + /** Aliases of repos specified as --repo */ + std::setstd::string _repos; zypp::TriBool inst_notinst; FillSearchTableSelectable( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/update.cc new/zypper-1.4.0/src/update.cc --- old/zypper-1.2.21/src/update.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/update.cc 2010-03-03 16:51:09.000000000 +0100 @@ -752,7 +752,7 @@ if (!theone) theone = s->installedObj(); - if (equalNVRA(*s->installedObj().resolvable(), *theone.resolvable())) + if (identical(s->installedObj(), theone)) { DBG << "the One (" << theone << ") is installed, skipping." << endl; zypper.out().info(str::form( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/utils/misc.cc new/zypper-1.4.0/src/utils/misc.cc --- old/zypper-1.2.21/src/utils/misc.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/utils/misc.cc 2010-03-03 16:51:09.000000000 +0100 @@ -17,6 +17,7 @@ #include "zypp/media/MediaManager.h" #include "zypp/parser/xml/XmlEscape.h" #include "zypp/misc/CheckAccessDeleted.h" +#include "zypp/ExternalProgram.h" #include "zypp/PoolItem.h" #include "zypp/Product.h" @@ -149,21 +150,6 @@ // ---------------------------------------------------------------------------- -bool equalNVRA(const Resolvable & lhs, const Resolvable & rhs) -{ - if (lhs.name() != rhs.name()) - return false; - if (lhs.kind() != rhs.kind()) - return false; - if (lhs.edition() != rhs.edition()) - return false; - if (lhs.arch() != rhs.arch()) - return false; - return true; -} - -// ---------------------------------------------------------------------------- - bool looks_like_url (const string& s) { /* @@ -434,6 +420,8 @@ } } +// ---------------------------------------------------------------------------- + DownloadMode get_download_option(Zypper & zypper) { DownloadMode mode; @@ -495,3 +483,52 @@ return mode; } + +// ---------------------------------------------------------------------------- + +bool packagekit_running() +{ + bool result = false; + const char* argv[] = + { + "dbus-send", + "--system", + "--dest=org.freedesktop.DBus", + "--type=method_call", + "--print-reply", + "--reply-timeout=200", + "/", + "org.freedesktop.DBus.NameHasOwner", + "string:org.freedesktop.PackageKit", + NULL + }; + + ExternalProgram pkcheck(argv); + + string line; + for (line = pkcheck.receiveLine(); !line.empty(); line = pkcheck.receiveLine()) + if (line.find("boolean") != string::npos && line.find("true") != string::npos) + result = true; + + pkcheck.close(); + return result; +} + +// ---------------------------------------------------------------------------- + +void packagekit_suggest_quit() +{ + const char* argv[] = + { + "dbus-send", + "--system", + "--dest=org.freedesktop.PackageKit", + "--type=method_call", + "/org/freedesktop/PackageKit", + "org.freedesktop.PackageKit.SuggestDaemonQuit", + NULL + }; + + ExternalProgram pkcall(argv); + pkcall.close(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/utils/misc.h new/zypper-1.4.0/src/utils/misc.h --- old/zypper-1.2.21/src/utils/misc.h 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/utils/misc.h 2010-03-03 16:51:09.000000000 +0100 @@ -49,8 +49,6 @@ std::string string_patch_status(const zypp::PoolItem & pi); -bool equalNVRA(const zypp::Resolvable & lhs, const zypp::Resolvable & rhs); - /** * Creates a Url out of \a urls_s. If the url_s looks looks_like_url() * Url(url_s) is returned. Otherwise if \a url_s represends a valid path to @@ -130,4 +128,10 @@ */ zypp::DownloadMode get_download_option(Zypper & zypper); +/** Check whether packagekit is running using a DBus call */ +bool packagekit_running(); + +/** Send suggestion to quit to PackageKit via DBus */ +void packagekit_suggest_quit(); + #endif /*ZYPPER_UTILS_H*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.21/src/utils/pager.cc new/zypper-1.4.0/src/utils/pager.cc --- old/zypper-1.2.21/src/utils/pager.cc 2010-02-26 15:05:19.000000000 +0100 +++ new/zypper-1.4.0/src/utils/pager.cc 2010-03-03 16:51:09.000000000 +0100 @@ -17,7 +17,6 @@ #include "zypp/TmpPath.h" #include "zypp/Pathname.h" #include "zypp/PathInfo.h" -#include "zypp/ExternalProgram.h" #include "../main.h" #include "Zypper.h" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org