Hello community,

here is the log from the commit of package libyui-ncurses-pkg for 
openSUSE:Factory checked in at 2013-06-28 16:05:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libyui-ncurses-pkg (Old)
 and      /work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libyui-ncurses-pkg"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libyui-ncurses-pkg/libyui-ncurses-pkg.changes    
2013-05-13 20:23:02.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.libyui-ncurses-pkg.new/libyui-ncurses-pkg.changes   
    2013-06-28 16:05:16.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Jun 27 12:13:36 CEST 2013 - [email protected]
+
+- Show and handle multiple versions of packages correctly 
+  (bnc #822962)
+- Version 2.44.0
+
+-------------------------------------------------------------------

Old:
----
  libyui-ncurses-pkg-2.43.6.tar.bz2

New:
----
  libyui-ncurses-pkg-2.44.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libyui-ncurses-pkg-doc.spec ++++++
--- /var/tmp/diff_new_pack.IKBMBb/_old  2013-06-28 16:05:17.000000000 +0200
+++ /var/tmp/diff_new_pack.IKBMBb/_new  2013-06-28 16:05:17.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package libyui-ncurses-pkg (Version 2.43.6)
+# spec file for package libyui-ncurses-pkg (Version 2.44.0)
 #
 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
@@ -16,7 +16,7 @@
 #
 
 Name:          libyui-ncurses-pkg-doc
-Version:       2.43.6
+Version:       2.44.0
 Release:       0
 License:       LGPL-2.1 or LGPL-3.0
 Source:                libyui-ncurses-pkg-%{version}.tar.bz2

++++++ libyui-ncurses-pkg.spec ++++++
--- /var/tmp/diff_new_pack.IKBMBb/_old  2013-06-28 16:05:17.000000000 +0200
+++ /var/tmp/diff_new_pack.IKBMBb/_new  2013-06-28 16:05:17.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package libyui-ncurses-pkg (Version 2.43.6)
+# spec file for package libyui-ncurses-pkg (Version 2.44.0)
 #
 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
@@ -18,7 +18,7 @@
 # norootforbuild
 
 Name:          libyui-ncurses-pkg
-Version:       2.43.6
+Version:       2.44.0
 Release:       0
 License:       LGPL-2.1 or LGPL-3.0
 Source:                libyui-ncurses-pkg-%{version}.tar.bz2

++++++ libyui-ncurses-pkg-2.43.6.tar.bz2 -> libyui-ncurses-pkg-2.44.0.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/ChangeLog 
new/libyui-ncurses-pkg-2.44.0/ChangeLog
--- old/libyui-ncurses-pkg-2.43.6/ChangeLog     2013-05-10 15:43:08.000000000 
+0200
+++ new/libyui-ncurses-pkg-2.44.0/ChangeLog     2013-06-27 12:48:11.000000000 
+0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Jun 27 12:13:36 CEST 2013 - [email protected]
+
+- Show and handle multiple versions of packages correctly 
+  (bnc #822962)
+- Version 2.44.0
+
+-------------------------------------------------------------------
 Fri May 10 10:40:00 UTC 2013 - [email protected]
 
 - use a common toplevel CMakeLists.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/VERSION.cmake 
new/libyui-ncurses-pkg-2.44.0/VERSION.cmake
--- old/libyui-ncurses-pkg-2.43.6/VERSION.cmake 2013-05-10 15:43:08.000000000 
+0200
+++ new/libyui-ncurses-pkg-2.44.0/VERSION.cmake 2013-06-27 12:48:11.000000000 
+0200
@@ -1,6 +1,6 @@
 SET( VERSION_MAJOR "2" )
-SET( VERSION_MINOR "43" )
-SET( VERSION_PATCH "6" )
+SET( VERSION_MINOR "44" )
+SET( VERSION_PATCH "0" )
 SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
 
 ##### This is need for the libyui core, ONLY.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/src/NCPackageSelector.cc 
new/libyui-ncurses-pkg-2.44.0/src/NCPackageSelector.cc
--- old/libyui-ncurses-pkg-2.43.6/src/NCPackageSelector.cc      2013-05-10 
15:43:08.000000000 +0200
+++ new/libyui-ncurses-pkg-2.44.0/src/NCPackageSelector.cc      2013-06-27 
12:48:11.000000000 +0200
@@ -914,13 +914,10 @@
 
     if ( versionsList && packageList )
     {
-
        // set the connection to the NCPackageSelector !!!!
        versionsList->setPackager( this );
-       // set status strategy
-       NCPkgStatusStrategy * strategy = new AvailableStatStrategy();
-       versionsList->setTableType( NCPkgTable::T_Availables, strategy );
-       versionsList->fillHeader( );
+        // fill default header, set correct header in 
NCPkgTable::fillAvailableList()
+        versionsList->fillHeader();
        versionsList->setSize( oldSize.Sze.W, oldSize.Sze.H );
 
        versionsList->fillAvailableList(  packageList->getSelPointer( 
packageList->getCurrentItem() ) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/src/NCPkgStatusStrategy.cc 
new/libyui-ncurses-pkg-2.44.0/src/NCPkgStatusStrategy.cc
--- old/libyui-ncurses-pkg-2.43.6/src/NCPkgStatusStrategy.cc    2013-05-10 
15:43:08.000000000 +0200
+++ new/libyui-ncurses-pkg-2.44.0/src/NCPkgStatusStrategy.cc    2013-06-27 
12:48:11.000000000 +0200
@@ -240,7 +240,6 @@
     ZyppStatus newStatus = oldStatus;
     ZyppPattern patPtr = tryCastToZyppPattern (objPtr);
 
-
     switch ( oldStatus )
     {
        case S_Del:
@@ -294,6 +293,7 @@
            break;
     }
 
+    yuiMilestone() << "Status toogled: old " << oldStatus << ", new " << 
newStatus << endl;
     newStat = newStatus;
 
     return ok;
@@ -562,7 +562,31 @@
 {
 }
 
+///////////////////////////////////////////////////////////////////
+//
+// AvailableStatStrategy::getPackageStatus()
+//
+// Gets status from package manager
+//
+ZyppStatus AvailableStatStrategy::getPackageStatus( ZyppSel slbPtr,
+                                                    ZyppObj objPtr )
+{
+    if ( !slbPtr || !objPtr )
+    {
+        yuiError() << "Selectable pointer not valid" << endl;
+        return S_NoInst;
+    }
 
+    if ( !slbPtr->multiversionInstall() )
+    {
+        return slbPtr->status();
+    }
+    else
+    {
+        zypp::PoolItem itemPtr ( objPtr->satSolvable() );
+        return slbPtr->pickStatus( itemPtr );
+    }
+}
 
 ///////////////////////////////////////////////////////////////////
 //
@@ -579,61 +603,75 @@
        return false;
     }
 
-    ZyppObj newCandidate = objPtr;
-
-    if ( newCandidate != slbPtr->candidateObj() )
+    if ( !slbPtr->multiversionInstall() )
     {
-       yuiMilestone() << "CANDIDATE changed" << endl;
-
-       // Change status of selectable
-       ZyppStatus status = slbPtr->status();
-
-       if ( slbPtr->installedObj() &&
-            slbPtr->installedObj()->edition() == newCandidate->edition() )
-       {
-           // Switch back to the original instance -
-           // the version that was previously installed
-           status = S_KeepInstalled;
-       }
-       else
-       {
-           switch ( status )
-           {
-               case S_KeepInstalled:
-               case S_Protected:
-               case S_AutoDel:
-               case S_AutoUpdate:
-               case S_Del:
-               case S_Update:
-
-                   status = S_Update;
-                   break;
-
-               case S_NoInst:
-               case S_Taboo:
-               case S_Install:
-               case S_AutoInstall:
-                   status = S_Install;
-                   break;
-           }
-       }
+        ZyppObj newCandidate = objPtr;
 
-       // Set candidate
-       ok = bool( slbPtr->setCandidate( newCandidate ) );
-       yuiMilestone() << "Set user candidate returns: " <<  
(ok?"true":"false") << endl;
-
-        // Set status
-       ok = slbPtr->setStatus( status );
-       yuiMilestone() << "Set status of: " << slbPtr->name() << " to: "
-         << status << " returns: " << (ok?"true":"false") << endl;
+        if ( newCandidate != slbPtr->candidateObj() )
+        {
+            yuiMilestone() << "CANDIDATE changed" << endl;
+
+            // Change status of selectable
+            ZyppStatus status = slbPtr->status();
+
+            if ( slbPtr->installedObj() &&
+                 slbPtr->installedObj()->edition() == newCandidate->edition() 
&&
+                 slbPtr->installedObj()->vendor() == newCandidate->vendor()
+                 )
+            {
+                yuiMilestone() << "Identical package installed" << endl;
+                // Switch back to the original instance -
+                // the version that was previously installed
+                status = S_KeepInstalled;
+            }
+            else
+            {
+                switch ( status )
+                {
+                    case S_KeepInstalled:
+                    case S_Protected:
+                    case S_AutoDel:
+                    case S_AutoUpdate:
+                    case S_Del:
+                    case S_Update:
+
+                        status = S_Update;
+                        break;
+
+                    case S_NoInst:
+                    case S_Taboo:
+                    case S_Install:
+                    case S_AutoInstall:
+                        status = S_Install;
+                        break;
+                }
+            }
 
+            // Set candidate
+            ok = bool( slbPtr->setCandidate( newCandidate ) );
+            yuiMilestone() << "Set user candidate returns: " <<  
(ok?"true":"false") << endl;
+            if ( ok )
+            {
+                // Set status
+                ok = slbPtr->setStatus( status );
+                yuiMilestone() << "Set status of: " << slbPtr->name() << " to: 
"
+                               << status << " returns: " << 
(ok?"true":"false") << endl;
+            }
+        }
+    }
+    else
+    {
+        zypp::PoolItem itemPtr ( objPtr->satSolvable() );
+        ok = slbPtr->setPickStatus( itemPtr, newstatus );
+        yuiMilestone() << "Set new status of: "<< slbPtr->name() << ", " << 
objPtr->edition()
+                       << " to: " << newstatus << " returns: " <<  
(ok?"true":"false") << endl;
     }
 
     return ok;
 }
 
 //------------------------------------------------------------
-// Class for strategies to get status for available packages
+// Class for strategies to get status for update packages
 //------------------------------------------------------------
 
 //
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/src/NCPkgStatusStrategy.h 
new/libyui-ncurses-pkg-2.44.0/src/NCPkgStatusStrategy.h
--- old/libyui-ncurses-pkg-2.43.6/src/NCPkgStatusStrategy.h     2013-05-10 
15:43:08.000000000 +0200
+++ new/libyui-ncurses-pkg-2.44.0/src/NCPkgStatusStrategy.h     2013-06-27 
12:48:11.000000000 +0200
@@ -261,6 +261,8 @@
      */ 
     virtual bool setObjectStatus( ZyppStatus newstatus,
                                   ZyppSel slbPtr, ZyppObj objPtr );
+
+    virtual ZyppStatus getPackageStatus( ZyppSel slbPtr, ZyppObj objPtr );
 };
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/src/NCPkgTable.cc 
new/libyui-ncurses-pkg-2.44.0/src/NCPkgTable.cc
--- old/libyui-ncurses-pkg-2.43.6/src/NCPkgTable.cc     2013-05-10 
15:43:08.000000000 +0200
+++ new/libyui-ncurses-pkg-2.44.0/src/NCPkgTable.cc     2013-06-27 
12:48:11.000000000 +0200
@@ -348,7 +348,7 @@
         // update this list to show the status changes
        updateTable();
 
-       if ( tableType == T_Availables )
+       if ( tableType == T_Availables || tableType == T_MultiVersion )
        {
            // additionally update the package list
            packager->updatePackageList();
@@ -399,7 +399,7 @@
        ZyppStatus newstatus = S_NoInst;
        if ( slbPtr && objPtr)
        {
-           if ( tableType == T_Availables )
+           if ( tableType == T_Availables && !slbPtr->multiversionInstall() )
            {
                std::string isCandidate = "   ";
                if ( objPtr == slbPtr->candidateObj() )
@@ -521,6 +521,16 @@
            header.push_back( "L" + NCPkgStrings::PkgArch() );
            break;
        }
+        case T_MultiVersion: {
+           header.reserve(5);
+           header.push_back( "L" + NCPkgStrings::PkgStatus() );
+           header.push_back( "L" + NCPkgStrings::PkgName() );
+           header.push_back( "L" + NCPkgStrings::PkgVersion() );
+           header.push_back( "L" + NCPkgStrings::PkgInstSource() );
+           header.push_back( "L" + NCPkgStrings::PkgSize() );
+           header.push_back( "L" + NCPkgStrings::PkgArch() );
+            break;
+        }
        default: {
            header.reserve(4);
            header.push_back( "L" + NCPkgStrings::PkgStatus() );
@@ -588,27 +598,30 @@
            break;
        }
        case T_Availables: {
-           std::string isCandidate = "   ";
-           if ( pkgPtr == slbPtr->candidateObj() )
-               isCandidate = " x ";
-           pkgLine.push_back( isCandidate );
-
-           version = pkgPtr->edition().asString();
-           pkgLine.push_back( version );
-
-           // show the repository (the installation source)
-           pkgLine.push_back( pkgPtr->repository().info().alias() );
-
-           // set package status either to S_NoInst or S_KeepInstalled
-           status = S_NoInst;
-           if ( ! slbPtr->installedEmpty() )
-           {
-               if ( pkgPtr->edition() == slbPtr->installedObj()->edition()     
&&
-                    pkgPtr->arch() == slbPtr->installedObj()->arch()   )
-               {
-                   status = S_KeepInstalled;
-               }
-           }
+            std::string isCandidate = "   ";
+            if ( pkgPtr == slbPtr->candidateObj() )
+                isCandidate = " x ";
+            pkgLine.push_back( isCandidate );
+
+            version = pkgPtr->edition().asString();
+            pkgLine.push_back( version );
+            // show the name of the repository (the installation source)
+            pkgLine.push_back( pkgPtr->repository().info().name() );
+
+            // set package status either to S_NoInst or S_KeepInstalled
+            status = S_NoInst;
+            zypp::ui::Selectable::installed_iterator it = 
slbPtr->installedBegin();
+
+            while ( it != slbPtr->installedEnd() )
+            {
+                if ( pkgPtr->edition() == (*it)->edition() &&
+                     pkgPtr->arch() == (*it)->arch()      &&
+                     pkgPtr->vendor() == (*it)->vendor() )
+                {
+                    status = S_KeepInstalled;
+                }
+                ++it;
+            }
 
            zypp::ByteCount size = pkgPtr->installSize();       // installed 
size
            pkgLine.push_back( size.asString( 8 ) );  // format size
@@ -616,9 +629,22 @@
 
            break;
        }
-       default: {
-           // version() was edition.version. but what about edition.release?
+        case T_MultiVersion: {
+            version = pkgPtr->edition().asString();
+            pkgLine.push_back( version );
+            // show the name of the repository (the installation source)
+            pkgLine.push_back( pkgPtr->repository().info().name() );
+
+            zypp::PoolItem itemPtr( pkgPtr->satSolvable() );
+            status = slbPtr->pickStatus( itemPtr );
+            yuiMilestone() << "Multi version: status of " << version << ": " 
<< status << endl;
 
+            zypp::ByteCount size = pkgPtr->installSize();      // installed 
size
+           pkgLine.push_back( size.asString( 8 ) );  // format size
+           pkgLine.push_back( pkgPtr->arch().asString()); // architecture
+            break;
+        }
+       default: {
            // if the package is installed, get the installed version
            pkgLine.push_back( pkgPtr->summary() );     // short description
            if ( ! slbPtr->installedEmpty() )
@@ -1061,7 +1087,6 @@
 
 bool NCPkgTable::fillAvailableList ( ZyppSel slb )
 {
-    bool addInstalled = true;
     if ( !slb )
     {
        yuiError() << "Package pointer not valid" << endl;
@@ -1071,30 +1096,51 @@
     // clear the package table
     itemsCleared ();
 
-    yuiDebug() << "Number of available packages: " << slb->availableSize() << 
endl;
-
-    // show all availables
-    zypp::ui::Selectable::available_iterator
-       b = slb->availableBegin (),
-       e = slb->availableEnd (),
-       it;
-    for (it = b; it != e; ++it)
+    NCPkgStatusStrategy * strategy = new AvailableStatStrategy();
+    NCPkgTableType type;
+    
+    if ( slb->multiversionInstall() )
     {
-
-       if ( slb->installedObj() &&
-            slb->installedObj()->edition() == (*it)->edition() &&
-            slb->installedObj()->arch()    == (*it)->arch()      )
-           // FIXME: In future releases, also the vendor will make a difference
-       {
-           addInstalled = false;
-       }
-       createListEntry( tryCastToZyppPkg (*it), slb );
+        type = T_MultiVersion;
+        yuiMilestone() << "Multi version package " << slb->name() << endl;
     }
-    if ( (! slb->installedEmpty()) && addInstalled )
+    else
     {
-       createListEntry( tryCastToZyppPkg (slb->installedObj()), slb );
+        type = T_Availables;
     }
 
+    setTableType( type, strategy );
+    this->fillHeader();
+    
+    // pick list contains installed and available packages (valid for single 
and multi version)
+    zypp::ui::Selectable::picklist_iterator it = slb->picklistBegin();
+    while ( it != slb->picklistEnd() )
+    {
+        createListEntry( tryCastToZyppPkg(*it), slb );
+        ++it;
+    }
+
+#if 0
+    // show installed packages
+    {
+        zypp::ui::Selectable::installed_iterator it = slb->installedBegin();
+        while ( it != slb->installedEnd() )
+        {
+            createListEntry( tryCastToZyppPkg(*it), slb );
+            ++it;
+        }
+    }
+    // and all availables
+    {
+        zypp::ui::Selectable::available_iterator it = slb->availableBegin();
+        while ( it != slb->availableEnd() )
+        {
+            createListEntry( tryCastToZyppPkg(*it), slb );
+            ++it;
+        }
+    }
+#endif
+
     // show the package list
     drawList();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libyui-ncurses-pkg-2.43.6/src/NCPkgTable.h 
new/libyui-ncurses-pkg-2.44.0/src/NCPkgTable.h
--- old/libyui-ncurses-pkg-2.43.6/src/NCPkgTable.h      2013-05-10 
15:43:08.000000000 +0200
+++ new/libyui-ncurses-pkg-2.44.0/src/NCPkgTable.h      2013-06-27 
12:48:11.000000000 +0200
@@ -183,6 +183,7 @@
        T_PatchPkgs,
        T_Selections,
        T_Languages,
+        T_MultiVersion,
        T_Unknown
     };
 

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to