[yast-commit] r44540 - in /trunk/ncurses-pkg: ./ src/
Author: coolo
Date: Fri Feb 15 16:49:25 2008
New Revision: 44540
URL: http://svn.opensuse.org/viewcvs/yast?rev=44540&view=rev
Log:
compile against libzypp trunk - language support pending
(#ifed out - want to make sure it works before we spend
too much time into it)
Modified:
trunk/ncurses-pkg/src/NCPackageSelector.cc
trunk/ncurses-pkg/src/NCPackageSelector.h
trunk/ncurses-pkg/src/NCPkgPopupDeps.cc
trunk/ncurses-pkg/src/NCPkgPopupRepo.cc
trunk/ncurses-pkg/src/NCPkgPopupSelection.cc
trunk/ncurses-pkg/src/NCPkgPopupSelection.h
trunk/ncurses-pkg/src/NCZypp.h
trunk/ncurses-pkg/yast2-ncurses-pkg.spec.in
Modified: trunk/ncurses-pkg/src/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.cc?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPackageSelector.cc (original)
+++ trunk/ncurses-pkg/src/NCPackageSelector.cc Fri Feb 15 16:49:25 2008
@@ -277,9 +277,6 @@
{
if ( !youMode )
{
- // create the selections popup
- selectionPopup = new NCPkgPopupSelection( wpos( 1, 1 ), this, NCPkgPopupSelection::S_Selection );
-
// create the patterns popup
patternPopup = new NCPkgPopupSelection( wpos( 1, 1 ), this, NCPkgPopupSelection::S_Pattern );
@@ -322,7 +319,6 @@
void NCPackageSelector::createFilterMenu()
{
- bool selections;
bool patterns;
// create the pattern popup
@@ -335,18 +331,8 @@
{
patterns = false;
}
- // create the selections popup
- if ( ! zyppPool().emptyzypp::Selection() )
- {
- selections = true;
- }
- else
- {
- selections = false;
- }
-
- if ( selections && !patterns )
+ if ( !patterns )
{
// ReplaceWidget and show menu entry Selections instead of Patterns
char menu[4000];
@@ -377,7 +363,7 @@
}
}
- else if ( patterns && selections )
+ else if ( patterns )
{
// ReplaceWidget and show menu entries Patterns AND Selections
char menu[4000];
@@ -428,9 +414,7 @@
p.saveStatezypp::Message ();
p.saveStatezypp::Script ();
- p.saveStatezypp::Selection ();
p.saveStatezypp::Pattern ();
- p.saveStatezypp::Language ();
}
void NCPackageSelector::restoreState ()
@@ -445,9 +429,7 @@
p.restoreStatezypp::Message ();
p.restoreStatezypp::Script ();
- p.restoreStatezypp::Selection ();
p.restoreStatezypp::Pattern ();
- p.restoreStatezypp::Language ();
}
bool NCPackageSelector::diffState ()
@@ -471,12 +453,8 @@
diff = diff || p.diffStatezypp::Script ();
log << diff << endl;
- diff = diff || p.diffStatezypp::Selection ();
- log << diff << endl;
diff = diff || p.diffStatezypp::Pattern ();
log << diff << endl;
- diff = diff || p.diffStatezypp::Language ();
- log << diff << endl;
return diff;
}
@@ -769,12 +747,12 @@
}
if ( checkProvides )
{
- zypp::CapSet value = pkg->dep (zypp::Dep::PROVIDES);
+ zypp::Capabilities value = pkg->dep (zypp::Dep::PROVIDES);
provides = createRelLine( value );
}
if ( checkRequires )
{
- zypp::CapSet value = pkg->dep (zypp::Dep::REQUIRES);
+ zypp::Capabilities value = pkg->dep (zypp::Dep::REQUIRES);
requires = createRelLine( value );
}
if ( ( checkName && match( pkg->name(), expr, ignoreCase )) ||
@@ -937,9 +915,9 @@
// clear the package table
packageList->itemsCleared ();
- listzypp::PoolItem_Ref problemList = zypp::getZYpp()->resolver()->problematicUpdateItems();
+ listzypp::PoolItem problemList = zypp::getZYpp()->resolver()->problematicUpdateItems();
- for ( listzypp::PoolItem_Ref::const_iterator it = problemList.begin();
+ for ( listzypp::PoolItem::const_iterator it = problemList.begin();
it != problemList.end();
++it )
{
@@ -2863,7 +2841,7 @@
// show Provides:
text += NCPkgNames::Provides();
- zypp::CapSet provides = package->dep (zypp::Dep::PROVIDES);
+ zypp::Capabilities provides = package->dep (zypp::Dep::PROVIDES);
text += createRelLine(provides);
text += "<br>";
@@ -2912,7 +2890,7 @@
for (size_t i = 0; i < sizeof (deptypes)/sizeof(deptypes[0]); ++i)
{
zypp::Dep deptype = deptypes[i];
- zypp::CapSet relations = pkgPtr->dep (deptype);
+ zypp::Capabilities relations = pkgPtr->dep (deptype);
string relline = createRelLine (relations);
if (!relline.empty ())
{
@@ -3033,10 +3011,10 @@
//
// createProvides
//
-string NCPackageSelector::createRelLine( const zypp::CapSet & info )
+string NCPackageSelector::createRelLine( const zypp::Capabilities & info )
{
string text = "";
- zypp::CapSet::const_iterator
+ zypp::Capabilities::const_iterator
b = info.begin (),
e = info.end (),
it;
Modified: trunk/ncurses-pkg/src/NCPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPackageSelector.h?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPackageSelector.h (original)
+++ trunk/ncurses-pkg/src/NCPackageSelector.h Fri Feb 15 16:49:25 2008
@@ -176,7 +176,7 @@
YMenuItem * visibleInfo; // current visible package info (description, file list, ...)
// internal helper functions (format list of string)
- string createRelLine( const zypp::CapSet & info );
+ string createRelLine( const zypp::Capabilities & info );
// internal use (copies tree items got from YPkgRpmGroupTagsFilterView)
void cloneTree( YStringTreeItem * parentOrig, YTreeItem * parentClone );
Modified: trunk/ncurses-pkg/src/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPopupDeps.cc?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgPopupDeps.cc (original)
+++ trunk/ncurses-pkg/src/NCPkgPopupDeps.cc Fri Feb 15 16:49:25 2008
@@ -235,7 +235,7 @@
success = resolver->resolvePool();
break;
case S_Verify:
- success = resolver->verifySystem( true ); // check hardware
+ success = resolver->verifySystem(); // check hardware
break;
default:
NCERR << "Unknown action for resolve" << endl;
Modified: trunk/ncurses-pkg/src/NCPkgPopupRepo.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPopupRepo.cc?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgPopupRepo.cc (original)
+++ trunk/ncurses-pkg/src/NCPkgPopupRepo.cc Fri Feb 15 16:49:25 2008
@@ -285,21 +285,22 @@
ZyppProduct NCPkgPopupRepo::findProductForRepo( ZyppRepo repo)
{
-
ZyppProduct product;
- zypp::ResStore::iterator it = repo.resolvables().begin();
+ zypp::ResPool::byKind_iterator it = zypp::ResPool::instance().byKindBegin( zypp::ResKind::product );
+ zypp::ResPool::byKind_iterator end = zypp::ResPool::instance().byKindEnd( zypp::ResKind::product );
- while( it != repo.resolvables().end() && !product )
+ while( it != end && !product )
{
//Single product - most common case
- product = zypp::dynamic_pointer_castzypp::Product( *it );
+ if ( it->resolvable()->repoInfo().alias() == repo.info().alias() )
+ product = zypp::asKindzypp::Product( it->resolvable() );
it++;
}
- while ( it != repo.resolvables().end() )
+ while ( it != end )
{
- if ( zypp::dynamic_pointer_castzypp::Product( *it ) )
+ if ( it->resolvable()->repoInfo().alias() == repo.info().alias() )
{
//Aw, multiple product found, we don't want those
NCWAR << "Multiple products in repository " <<
Modified: trunk/ncurses-pkg/src/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPopupSelection.cc?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgPopupSelection.cc (original)
+++ trunk/ncurses-pkg/src/NCPkgPopupSelection.cc Fri Feb 15 16:49:25 2008
@@ -57,8 +57,7 @@
{
switch ( type )
{
- case S_Pattern:
- case S_Selection: {
+ case S_Pattern: {
createLayout( NCPkgNames::SelectionLabel() );
break;
}
@@ -111,8 +110,7 @@
NCPkgStatusStrategy * strat = new SelectionStatStrategy();
switch (type) {
- case S_Pattern:
- case S_Selection: {
+ case S_Pattern: {
sel->setTableType( NCPkgTable::T_Selections, strat );
break;
}
@@ -176,16 +174,15 @@
// show the package list
std::setstd::string packages;
- ZyppSelection selPtr = tryCastToZyppSelection (objPtr);
ZyppPattern patPtr = tryCastToZyppPattern (objPtr);
- ZyppLang langPtr = tryCastToZyppLang (objPtr);
- if (selPtr)
- packages = selPtr->install_packages ();
- else if (patPtr)
+ // FIXME ZyppLang langPtr = tryCastToZyppLang (objPtr);
+ if (patPtr)
{
zypp::ui::PatternContents patternContents( patPtr );
packages = patternContents.install_packages();
}
+#warning Languages support
+#if FIXME
else if (langPtr)
{
string currentLang = langPtr->name();
@@ -220,6 +217,7 @@
}
}
+#endif
packager->showSelPackages( getCurrentLine(), packages );
// showDiskSpace() moved to NCPkgTable.cc (show/check diskspace
@@ -322,20 +320,6 @@
///////////////////////////////////////////////////////////////////
//
-// OrderFunc
-//
-bool order( ZyppSel slb1, ZyppSel slb2 )
-{
- ZyppSelection ptr1 = tryCastToZyppSelection (slb1->theObj());
- ZyppSelection ptr2 = tryCastToZyppSelection (slb2->theObj());
- if ( !ptr1 || !ptr2 )
- return false;
- else
- return ptr1->order() < ptr2->order();
-}
-
-///////////////////////////////////////////////////////////////////
-//
// OrderFuncPattern
//
bool orderPattern( ZyppSel slb1, ZyppSel slb2 )
@@ -354,12 +338,16 @@
//
bool orderLang( ZyppSel slb1, ZyppSel slb2 )
{
+#warning Language support
+#if FIXME
ZyppLang ptr1 = tryCastToZyppLang (slb1->theObj());
ZyppLang ptr2 = tryCastToZyppLang (slb2->theObj());
if ( !ptr1 || !ptr2 )
return false;
else
return ptr1->name() < ptr2->name();
+#endif
+ return false;
}
///////////////////////////////////////////////////////////////////
@@ -380,27 +368,6 @@
switch ( type )
{
- case S_Selection:
- {
- for ( i = zyppSelectionsBegin () ; i != zyppSelectionsEnd (); ++i )
- {
- ZyppObj resPtr = (*i)->theObj();
- bool show;
-
- ZyppSelection selPtr = tryCastToZyppSelection (resPtr);
- show = selPtr && selPtr->visible() && !selPtr->isBase();
- if (show)
- {
- NCMIL << resPtr->kind () <<": " << resPtr->name()
- << ", initial status: " << (*i)->status() << endl;
-
- slbList.push_back (*i);
- }
- }
- slbList.sort( order );
-
- break;
- }
case S_Pattern:
{
for ( i = zyppPatternsBegin () ; i != zyppPatternsEnd (); ++i )
@@ -422,6 +389,8 @@
slbList.sort( orderPattern );
break;
}
+#warning Languages support
+#if FIXME
case S_Language:
{
for (i = zyppLangBegin (); i != zyppLangEnd (); ++i )
@@ -438,7 +407,7 @@
slbList.sort( orderLang );
break;
}
-
+#endif
default:
NCERR << "Selecion type not handled: " << type << endl;
}
@@ -451,8 +420,7 @@
pkgLine.clear();
switch (type) {
- case S_Pattern:
- case S_Selection: {
+ case S_Pattern: {
pkgLine.push_back( resPtr->summary(LOCALE) ); // the description
break;
}
Modified: trunk/ncurses-pkg/src/NCPkgPopupSelection.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCPkgPopupSelection.h?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCPkgPopupSelection.h (original)
+++ trunk/ncurses-pkg/src/NCPkgPopupSelection.h Fri Feb 15 16:49:25 2008
@@ -57,7 +57,6 @@
public:
enum SelType {
- S_Selection,
S_Pattern,
S_Language,
S_Unknown
Modified: trunk/ncurses-pkg/src/NCZypp.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses-pkg/src/NCZypp.h?rev=44540&r1=44539&r2=44540&view=diff
==============================================================================
--- trunk/ncurses-pkg/src/NCZypp.h (original)
+++ trunk/ncurses-pkg/src/NCZypp.h Fri Feb 15 16:49:25 2008
@@ -26,10 +26,8 @@
#include
participants (1)
-
coolo@svn.opensuse.org