[zypp-commit] r7085 - in /trunk/libzypp: devel/devel.ma/Parse.cc zypp/VendorAttr.cc zypp/VendorAttr.h
Author: mlandres Date: Mon Sep 3 13:57:23 2007 New Revision: 7085 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7085&view=rev Log: Added 'bool VendorAttr::equivalent( const Vendor & lhs, const Vendor & rhs ) const'. Test whether to vendor strings denote the same (or equivalent) vendors. Modified: trunk/libzypp/devel/devel.ma/Parse.cc trunk/libzypp/zypp/VendorAttr.cc trunk/libzypp/zypp/VendorAttr.h Modified: trunk/libzypp/devel/devel.ma/Parse.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Parse.cc?rev=7085&r1=7084&r2=7085&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/Parse.cc (original) +++ trunk/libzypp/devel/devel.ma/Parse.cc Mon Sep 3 13:57:23 2007 @@ -53,7 +53,7 @@ bool operator()( const PoolItem & obj_r ) { //handle( asKind<Package>( obj_r ) ); - handle( asKind<Patch>( obj_r ) ); + //handle( asKind<Patch>( obj_r ) ); //handle( asKind<Pattern>( obj_r ) ); //handle( asKind<Product>( obj_r ) ); return true; @@ -347,10 +347,11 @@ INT << "===[START]==========================================" << endl; setenv( "ZYPP_CONF", "/Local/ROOT/zypp.conf", 1 ); - - INT << ZConfig::instance().download_use_patchrpm() << endl; - INT << ZConfig::instance().download_use_deltarpm() << endl; - return 0; + std::string t( "ABCD" ); + MIL << str::toLower(t.substr(0,3)) << endl; + MIL << str::toLower(t.substr(0,4)) << endl; + MIL << str::toLower(t.substr(0,5)) << endl; + throw; DigestReceive foo; KeyRingSignalsReceive baa; @@ -414,7 +415,7 @@ USR << "pool: " << pool << endl; SEC << pool.knownRepositoriesSize() << endl; - if ( 0 ) + if ( 1 ) { { zypp::base::LogControl::TmpLineWriter shutUp; @@ -425,6 +426,13 @@ INT << getZYpp()->diskUsage() << endl; + { + Measure x("SHUTDOWN"); + getZYpp()->removeResolvables( getZYpp()->target()->resolvables() ); + getZYpp()->target()->reset(); + } + + std::for_each( pool.begin(), pool.end(), Xprint() ); /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/VendorAttr.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/VendorAttr.cc?rev=7085&r1=7084&r2=7085&view=diff ============================================================================== --- trunk/libzypp/zypp/VendorAttr.cc (original) +++ trunk/libzypp/zypp/VendorAttr.cc Mon Sep 3 13:57:23 2007 @@ -147,6 +147,20 @@ bool VendorAttr::autoProtect( const Vendor & vendor_r ) const { return( ZConfig::instance().autolock_untrustedvendor() && ! trusted( vendor_r ) ); } + bool VendorAttr::equivalent( const Vendor & lhs, const Vendor & rhs ) const + { + static const std::string defSUSE( "suse" ); + + if ( lhs == rhs ) + return true; + // By now handcrafted equivalence definition: + if ( str::toLower( lhs.substr( 0, 4 ) ) == defSUSE + && str::toLower( rhs.substr( 0, 4 ) ) == defSUSE ) + return true; + + return false; + } + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/VendorAttr.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/VendorAttr.h?rev=7085&r1=7084&r2=7085&view=diff ============================================================================== --- trunk/libzypp/zypp/VendorAttr.h (original) +++ trunk/libzypp/zypp/VendorAttr.h Mon Sep 3 13:57:23 2007 @@ -52,6 +52,13 @@ **/ bool autoProtect( const Vendor & vendor_r ) const; + /** Return whether two vendor strings shold be treated as the same vendor. + * Usually the solver is allowed to automatically select a package of an + * equivalent vendor when updating. Replacing a package with one of a + * different vendor usually must be confirmed by the user. + */ + bool equivalent( const Vendor & lhs, const Vendor & rhs ) const; + private: VendorAttr(); }; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org