Hello community, here is the log from the commit of package zypper for openSUSE:Factory checked in at Sun Nov 1 10:12:15 CET 2009. -------- --- zypper/zypper.changes 2009-10-23 16:35:50.000000000 +0200 +++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2009-10-30 12:50:09.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Oct 30 11:36:57 CET 2009 - ma@suse.de + +- Fix 'zypper in --from' selecting the wrong packages. (bnc #548392) +- 1.2.8 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- zypper-1.2.7.tar.bz2 New: ---- zypper-1.2.8.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zypper.spec ++++++ --- /var/tmp/diff_new_pack.wYxqef/_old 2009-11-01 10:12:13.000000000 +0100 +++ /var/tmp/diff_new_pack.wYxqef/_new 2009-11-01 10:12:13.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package zypper (Version 1.2.7) +# spec file for package zypper (Version 1.2.8) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,7 +19,7 @@ Name: zypper -BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel >= 6.17.1 +BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel >= 6.21.0 BuildRequires: augeas-devel >= 0.5.0 readline-devel >= 5.1 BuildRequires: cmake >= 2.4.6 gcc-c++ >= 4.1 Requires: procps @@ -31,7 +31,7 @@ AutoReqProv: on PreReq: permissions Summary: Command line software manager using libzypp -Version: 1.2.7 +Version: 1.2.8 Release: 1 Source: %{name}-%{version}.tar.bz2 Source1: %{name}-rpmlintrc @@ -118,5 +118,4 @@ # declare ownership of the log file but prevent # it from being erased by rpm -e %ghost %config(noreplace) %{_var}/log/zypper.log - %changelog ++++++ zypper-1.2.7.tar.bz2 -> zypper-1.2.8.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.7/VERSION.cmake new/zypper-1.2.8/VERSION.cmake --- old/zypper-1.2.7/VERSION.cmake 2009-10-27 13:30:40.000000000 +0100 +++ new/zypper-1.2.8/VERSION.cmake 2009-10-30 12:10:41.000000000 +0100 @@ -31,7 +31,7 @@ # SET(VERSION_MAJOR "1") SET(VERSION_MINOR "2") -SET(VERSION_PATCH "7") +SET(VERSION_PATCH "8") -# LAST RELEASED: 1.2.7 +# LAST RELEASED: 1.2.8 #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.7/package/zypper.changes new/zypper-1.2.8/package/zypper.changes --- old/zypper-1.2.7/package/zypper.changes 2009-10-27 13:30:40.000000000 +0100 +++ new/zypper-1.2.8/package/zypper.changes 2009-10-30 12:10:41.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Oct 30 11:36:57 CET 2009 - ma@suse.de + +- Fix 'zypper in --from' selecting the wrong packages. (bnc #548392) +- 1.2.8 + +------------------------------------------------------------------- Fri Oct 23 15:09:58 CEST 2009 - ma@suse.de - Fix 'dup --from' not to perform a complete distupgrade. (bnc #549490) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.7/src/install.cc new/zypper-1.2.8/src/install.cc --- old/zypper-1.2.7/src/install.cc 2009-10-27 13:30:40.000000000 +0100 +++ new/zypper-1.2.8/src/install.cc 2009-10-30 12:10:41.000000000 +0100 @@ -1,11 +1,12 @@ #include <boost/format.hpp> //#include <iostream> #include "zypp/ZYppFactory.h" -#include "zypp/base/Logger.h" +#include "zypp/base/LogTools.h" #include "zypp/base/Algorithm.h" #include "zypp/base/Functional.h" #include "zypp/Filter.h" #include "zypp/PoolQuery.h" +#include "zypp/PoolItemBest.h" #include "utils/misc.h" @@ -202,6 +203,20 @@ // don't try NAME-EDITION yet, could be confused by // dbus-1-x11, java-1_4_2-gcj-compat, ... /* + +ma@: Look at the Capability::guessPackageSpec implementaion. This might be +what you want unless you also want to support globbing like 'libz*-12.3-14'. +In this case you need PoolQuery instead of WhatProvides lookups. + +There is no rule that an edition starts with a number, so your regex approach +won't work. If your string is correctly parsed as a name-capability, you can +check whether it matches a package name. If not, replace the last '-' by a '=', +and check whether the namepart now matches a package (-versionwithoutrelease). +If not, replace the one but last '-' and try again (-version-release). + +That's basically what guessPackageSpec does, but it also supports embeded +arch specs: "libzypp-1.2.3-4.5.arch" or "libzypp.arch-1.2.3-4.5". + bool mark_by_name_edition (...) static const regex rx_name_edition("(.*?)-([0-9].*)"); @@ -497,23 +512,26 @@ // for each argument search (glob) & mark for_(strit, argsnew.begin(), argsnew.end()) { - bool found = false; - for_(it, repos.begin(), repos.end()) + PoolQuery q; + q.addKind(kind); + q.addAttribute(sat::SolvAttr::name, *strit); + for_( it, repos.begin(), repos.end() ) { - PoolQuery q; - q.addAttribute(sat::SolvAttr::name, *strit); - q.setMatchGlob(); q.addRepo(it->alias()); - q.addKind(kind); + } + q.setMatchGlob(); - for_(sit, q.selectableBegin(), q.selectableEnd()) + // Get the best matching items and tag them for + // installation. + PoolItemBest bestMatches( q.begin(), q.end() ); + if ( ! bestMatches.empty() ) + { + for_( sit, bestMatches.begin(), bestMatches.end() ) { - mark_by_name(zypper, true, kind, (*sit)->name(), it->alias(), "", false); - found = true; + ui::asSelectable()( *sit )->setOnSystem( *sit, ResStatus::USER ); } } - - if (!found) + else { // translators: meaning a package %s or provider of capability %s zypper.out().error(str::form(_("'%s' not found."), strit->c_str())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.7/src/repos.cc new/zypper-1.2.8/src/repos.cc --- old/zypper-1.2.7/src/repos.cc 2009-10-27 13:30:40.000000000 +0100 +++ new/zypper-1.2.8/src/repos.cc 2009-10-30 12:10:41.000000000 +0100 @@ -281,45 +281,58 @@ bool match_repo(Zypper & zypper, string str, RepoInfo *repo) { RepoManager & manager = zypper.repoManager(); - bool found = false; - unsigned int number = 1; // repo number - for (RepoManager::RepoConstIterator known_it = manager.repoBegin(); - known_it != manager.repoEnd(); ++known_it, number++) + // Quick check for alias/reponumber first: { - unsigned int tmp = 0; + unsigned int number = 1; // repo number + unsigned int tmp = 0; safe_lexical_cast (str, tmp); // try to make an int out of the string + for (RepoManager::RepoConstIterator known_it = manager.repoBegin(); + known_it != manager.repoEnd(); ++known_it, ++number) + { + if ( known_it->alias() == str || tmp == number ) + { + if (repo) + *repo = *known_it; + + return true; + } + } + } + + // Expensive URL analysis only if needed: + bool found = false; + for (RepoManager::RepoConstIterator known_it = manager.repoBegin(); + known_it != manager.repoEnd(); ++known_it) + { try { - found = known_it->alias() == str || tmp == number; - if (!found) + url::ViewOption urlview = url::ViewOption::DEFAULTS + url::ViewOption::WITH_PASSWORD; + if (zypper.cOpts().count("loose-auth")) { - url::ViewOption urlview = url::ViewOption::DEFAULTS + url::ViewOption::WITH_PASSWORD; - if (zypper.cOpts().count("loose-auth")) - { - urlview = urlview + urlview = urlview - url::ViewOptions::WITH_PASSWORD - url::ViewOptions::WITH_USERNAME; - } - if (zypper.cOpts().count("loose-query")) - urlview = urlview - url::ViewOptions::WITH_QUERY_STR; + } + if (zypper.cOpts().count("loose-query")) + urlview = urlview - url::ViewOptions::WITH_QUERY_STR; - if (!(urlview.has(url::ViewOptions::WITH_PASSWORD) + 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)) { - for_(urlit, known_it->baseUrlsBegin(), known_it->baseUrlsEnd()) - if (urlit->asString(urlview) == Url(str).asString(urlview)) - { - found = true; - break; - } + found = true; + break; } - else - found = - find(known_it->baseUrlsBegin(),known_it->baseUrlsEnd(),Url(str)) - != known_it->baseUrlsEnd(); } + else + found = + find(known_it->baseUrlsBegin(),known_it->baseUrlsEnd(),Url(str)) + != known_it->baseUrlsEnd(); + if (found) { if (repo) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zypper-1.2.7/zypper.spec.cmake new/zypper-1.2.8/zypper.spec.cmake --- old/zypper-1.2.7/zypper.spec.cmake 2009-10-27 13:30:40.000000000 +0100 +++ new/zypper-1.2.8/zypper.spec.cmake 2009-10-30 12:10:41.000000000 +0100 @@ -11,7 +11,7 @@ # norootforbuild Name: @PACKAGE@ -BuildRequires: libzypp-devel >= 6.17.1 boost-devel >= 1.33.1 gettext-devel >= 0.15 +BuildRequires: libzypp-devel >= 6.21.0 boost-devel >= 1.33.1 gettext-devel >= 0.15 BuildRequires: readline-devel >= 5.1 augeas-devel >= 0.5.0 BuildRequires: gcc-c++ >= 4.1 cmake >= 2.4.6 Requires: procps ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org