Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7239 - in /trunk/libzypp: VERSION.cmake devel/devel.ma/Parse.cc package/libzypp.changes zypp/solver/detail/ResolverUpgrade.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 13 Sep 2007 16:01:55 -0000
  • Message-id: <20070913160155.5132C35F81@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Sep 13 18:01:54 2007
New Revision: 7239

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7239&view=rev
Log:
- On update do not delete unmaintained non-SuSE packages.

Modified:
    trunk/libzypp/VERSION.cmake
    trunk/libzypp/devel/devel.ma/Parse.cc
    trunk/libzypp/package/libzypp.changes
    trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc

Modified: trunk/libzypp/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=7239&r1=7238&r2=7239&view=diff
==============================================================================
--- trunk/libzypp/VERSION.cmake (original)
+++ trunk/libzypp/VERSION.cmake Thu Sep 13 18:01:54 2007
@@ -47,4 +47,4 @@
 SET(LIBZYPP_MAJOR "3")
 SET(LIBZYPP_MINOR "23")
 SET(LIBZYPP_COMPATMINOR "23")
-SET(LIBZYPP_PATCH "1")
+SET(LIBZYPP_PATCH "2")

Modified: trunk/libzypp/devel/devel.ma/Parse.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Parse.cc?rev=7239&r1=7238&r2=7239&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Parse.cc (original)
+++ trunk/libzypp/devel/devel.ma/Parse.cc Thu Sep 13 18:01:54 2007
@@ -48,6 +48,35 @@
 static const Pathname sysRoot( "/Local/ROOT" );
 
 ///////////////////////////////////////////////////////////////////
+bool queryInstalledEditionHelper( const std::string & name_r,
+                                  const Edition &     ed_r,
+                                  const Arch &        arch_r ) const
+{
+  INT << name_r << "-" << ed_r <<< "." < arch_r << endl;
+  return false;
+}
+
+ManagedFile repoProvidePackage( const PoolItem & pi )
+{
+  ResPool _pool( getZYpp()->pool() );
+  repo::RepoMediaAccess _access;
+
+  // Redirect PackageProvider queries for installed editions
+  // (in case of patch/delta rpm processing) to rpmDb.
+  repo::PackageProviderPolicy packageProviderPolicy;
+  packageProviderPolicy.queryInstalledCB( queryInstalledEditionHelper );
+
+  Package::constPtr p = asKind<Package>(pi.resolvable());
+
+  // Build a repository list for repos
+  // contributing to the pool
+  std::list<Repository> repos( _pool.knownRepositoriesBegin(), _pool.knownRepositoriesEnd() );
+  repo::DeltaCandidates deltas(repos);
+  repo::PackageProvider pkgProvider( _access, p, deltas, packageProviderPolicy );
+  return pkgProvider.providePackage();
+}
+
+///////////////////////////////////////////////////////////////////
 
 template<class _Res>
 Selectable::Ptr getSel( const std::string & name_r )
@@ -61,6 +90,36 @@
   return 0;
 }
 
+template<class _Res>
+Selectable::Ptr getPi( const std::string & name_r, const Edition & ed_r, const Arch & arch_r )
+{
+  ResPoolProxy uipool( getZYpp()->poolProxy() );
+  for_(it, uipool.byKindBegin<_Res>(), uipool.byKindEnd<_Res>() )
+  {
+    if ( (*it)->name() == name_r )
+      return (*it);
+  }
+  return 0;
+}
+template<class _Res>
+Selectable::Ptr getPi( const std::string & name_r, const Edition & ed_r )
+{
+  return getPi<_Res>( name_r, Edition(), Arch() );
+}
+template<class _Res>
+Selectable::Ptr getPi( const std::string & name_r, const Edition & ed_r )
+{
+  return getPi<_Res>( name_r, ed_r, Arch() );
+}
+template<class _Res>
+Selectable::Ptr getPi( const std::string & name_r, const Arch & arch_r )
+{
+  return getPi<_Res>( name_r, Edition(), arch_r );
+}
+
+
+
+
 void dbgDu( Selectable::Ptr sel )
 {
   if ( sel->installedPoolItem() )
@@ -78,12 +137,12 @@
 }
 
 ///////////////////////////////////////////////////////////////////
-
+RepoProvidePackage repoProvidePackage( access, pool_r);
 struct Xprint
 {
   bool operator()( const PoolItem & obj_r )
   {
-//      handle( asKind<Package>( obj_r ) );
+//     handle( asKind<Package>( obj_r ) );
 //     handle( asKind<Patch>( obj_r ) );
 //     handle( asKind<Pattern>( obj_r ) );
 //     handle( asKind<Product>( obj_r ) );
@@ -476,41 +535,11 @@
     MIL << "Added target: " << pool << endl;
   }
 
-  std::for_each( pool.begin(), pool.end(), Xprint() );
-
-  USR << getZYpp()->getPartitions() << endl;
-  INT << getZYpp()->diskUsage() << endl;
-
-  Selectable::Ptr sel( getSel<Package>( "rpm" ) );
-  dbgDu( sel );
-
-  MIL << sel->set_status( ui::S_Del ) << endl;
-  dbgDu( sel );
-
-  MIL << sel->set_status( ui::S_Update ) << endl;
-//   sel->installedPoolItem().status().setTransact( true, ResStatus::SOLVER );
-  dbgDu( sel );
-
-  MIL << sel->set_status( ui::S_KeepInstalled ) << endl;
-  dbgDu( sel );
-
-  sel = getSel<Package>( "balsa" );
-  dbgDu( sel );
-
-  MIL << sel->set_status( ui::S_Install ) << endl;
-  dbgDu( sel );
-
-  MIL << sel->set_status( ui::S_NoInst ) << endl;
-  dbgDu( sel );
-
-  sel = getSel<Package>( "libtunepimp" );
-  dbgDu( sel );
+  //std::for_each( pool.begin(), pool.end(), Xprint() );
 
-  MIL << sel->set_status( ui::S_Del ) << endl;
-  dbgDu( sel );
+  PoolItem pi(
 
-  MIL << sel->set_status( ui::S_KeepInstalled ) << endl;
-  dbgDu( sel );
+  ManagedFile
 
  ///////////////////////////////////////////////////////////////////
   INT << "===[END]============================================" << endl << endl;

Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=7239&r1=7238&r2=7239&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Thu Sep 13 18:01:54 2007
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Thu Sep 13 17:59:55 CEST 2007 - ma@xxxxxxx
+
+- On update do not delete unmaintained non-SuSE packages.
+- version 3.23.2
+
+-------------------------------------------------------------------
 Thu Sep 13 13:02:39 CEST 2007 - lslezak@xxxxxxx
 
 - ZYppImpl::getPartitions() - don't return the current partitioning

Modified: trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc?rev=7239&r1=7238&r2=7239&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc (original)
+++ trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc Thu Sep 13 18:01:54 2007
@@ -612,7 +612,7 @@
       if ( !toadd.size() ) {
        INT << "Empty SplitPkgMap entry for " << installed << endl;
       } else {
-       FindMap candidate;  
+       FindMap candidate;
        for ( PoolItemOrderSet::iterator ait = toadd.begin(); ait != toadd.end(); ++ait ) {
            PoolItem_Ref split_candidate = *ait;
            if ( probably_dropped
@@ -621,7 +621,7 @@
            {
                probably_dropped = false;
            }
-           
+
            FindMap::iterator itcandidate = candidate.find( split_candidate->name() );
 
            if (itcandidate != candidate.end()) {       // split canidate with the same name found
@@ -641,11 +641,11 @@
                    if (itcandidate->second->arch() != installed->arch()
                        && split_candidate->arch() == installed->arch() ) {
                        // prefer candidate which the same architecture as the installed item
-                       itcandidate->second = split_candidate;                       
+                       itcandidate->second = split_candidate;
                    } else {
                        int cmp = itcandidate->second->arch().compare( split_candidate->arch() );
                        if (cmp < 0) {                                               // new provider has better arch
-                           itcandidate->second = split_candidate;                                           
+                           itcandidate->second = split_candidate;
                        }
                        else if (cmp == 0) {                                    // new provider has equal arch
                            if (itcandidate->second->edition().compare( split_candidate->edition() ) < 0) {
@@ -659,13 +659,13 @@
                candidate[split_candidate->name()] = split_candidate;
            }
        }
-       
+
        PoolItemOrderSet addcandidate;
        for (FindMap::iterator itcandidate = candidate.begin() ; itcandidate != candidate.end(); itcandidate++) {
            addcandidate.insert(itcandidate->second);
            MIL << " ==> ADD (splitted): " << itcandidate->second << endl;
        }
-           
+
        addSplitted[installed] = addcandidate;
       }
       // count stats later
@@ -676,7 +676,8 @@
     ///////////////////////////////////////////////////////////////////
 
     if ( probably_dropped ) {
-      if ( opt_stats_r.delete_unmaintained ) {
+      if ( opt_stats_r.delete_unmaintained
+           && VendorAttr::instance().equivalent( installed->vendor(), "suse" ) ) {
        installed.status().setToBeUninstalled( ResStatus::APPL_HIGH );
       }
       ++opt_stats_r.chk_dropped;
@@ -776,7 +777,7 @@
        }
       }
     }
-    
+
     if ( guess ) {
        // Checking if the selected provider depends on language, if yes try to find out the
        // correct language package
@@ -794,7 +795,7 @@
        if (requested_locale_match) {
            // searching the best language
            PoolItemOrderSet & gset( it->second );
-           requested_locale_match = false;         
+           requested_locale_match = false;
 
            for ( PoolItemOrderSet::iterator git = gset.begin(); git != gset.end(); ++git ) {
                PoolItem_Ref item (*git);

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages