[zypp-commit] r11485 - in /trunk/libzypp: VERSION.cmake libzypp.spec.cmake package/libzypp.changes zypp/Product.cc zypp/Product.h zypp/sat/SolvAttr.cc zypp/sat/SolvAttr.h zypp/target/TargetImpl.cc
Author: mlandres Date: Fri Oct 24 16:10:31 2008 New Revision: 11485 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11485&view=rev Log: - Provide the /etc/products.d enties filename as Product::referenceFilename. Use it to remove orphan products. (bnc #432932) - Fix media exception handling in commit (bnc #395704) Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/libzypp.spec.cmake trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/Product.cc trunk/libzypp/zypp/Product.h trunk/libzypp/zypp/sat/SolvAttr.cc trunk/libzypp/zypp/sat/SolvAttr.h trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Fri Oct 24 16:10:31 2008 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "5") SET(LIBZYPP_COMPATMINOR "17") -SET(LIBZYPP_MINOR "17") +SET(LIBZYPP_MINOR "18") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 5.17.0 (17) +# LAST RELEASED: 5.18.0 (17) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= Modified: trunk/libzypp/libzypp.spec.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/libzypp.spec.cmake?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/libzypp.spec.cmake (original) +++ trunk/libzypp/libzypp.spec.cmake Fri Oct 24 16:10:31 2008 @@ -25,7 +25,7 @@ Obsoletes: yast2-packagemanager Recommends: logrotate BuildRequires: cmake -BuildRequires: libsatsolver-devel >= 0.12.0 openssl-devel +BuildRequires: libsatsolver-devel >= 0.12.1 openssl-devel BuildRequires: boost-devel curl-devel dejagnu doxygen gcc-c++ gettext-devel graphviz hal-devel libxml2-devel %if 0%{?suse_version} Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Fri Oct 24 16:10:31 2008 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Fri Oct 24 16:07:45 CEST 2008 - ma@suse.de + +- Provide the /etc/products.d enties filename as Product::referenceFilename. + Use it to remove orphan products. (bnc #432932) +- Fix media exception handling in commit (bnc #395704) +- revision 11485 +- version 5.18.0 (17) + +------------------------------------------------------------------- Fri Oct 24 10:29:19 CEST 2008 - schubi@suse.de - Taking "unlock" instead of setTransact(false) in the solutions (bnc #436923) Modified: trunk/libzypp/zypp/Product.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.cc?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/zypp/Product.cc (original) +++ trunk/libzypp/zypp/Product.cc Fri Oct 24 16:10:31 2008 @@ -91,6 +91,9 @@ return sat::Solvable::noSolvable; } + std::string Product::referenceFilename() const + { return lookupStrAttribute( sat::SolvAttr::productReferenceFile ); } + Product::ReplacedProducts Product::replacedProducts() const { std::vector<constPtr> ret; Modified: trunk/libzypp/zypp/Product.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.h?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/zypp/Product.h (original) +++ trunk/libzypp/zypp/Product.h Fri Oct 24 16:10:31 2008 @@ -43,6 +43,11 @@ */ sat::Solvable referencePackage() const; + /** For installed products the name of the coddesponding + * \c /etc/products.d entry. + .*/ + std::string referenceFilename() const; + public: /***/ typedef std::vector<constPtr> ReplacedProducts; Modified: trunk/libzypp/zypp/sat/SolvAttr.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.cc?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SolvAttr.cc (original) +++ trunk/libzypp/zypp/sat/SolvAttr.cc Fri Oct 24 16:10:31 2008 @@ -98,6 +98,7 @@ const SolvAttr SolvAttr::extends ( SOLVABLE_EXTENDS ); // product + const SolvAttr SolvAttr::productReferenceFile ( PRODUCT_REFERENCEFILE ); const SolvAttr SolvAttr::productProductLine ( PRODUCT_PRODUCTLINE ); const SolvAttr SolvAttr::productShortlabel ( PRODUCT_SHORTLABEL ); const SolvAttr SolvAttr::productDistproduct ( PRODUCT_DISTPRODUCT ); Modified: trunk/libzypp/zypp/sat/SolvAttr.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.h?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SolvAttr.h (original) +++ trunk/libzypp/zypp/sat/SolvAttr.h Fri Oct 24 16:10:31 2008 @@ -127,6 +127,7 @@ /** \name product */ //@{ + static const SolvAttr productReferenceFile; static const SolvAttr productProductLine; static const SolvAttr productShortlabel; static const SolvAttr productDistproduct; Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=11485&r1=11484&r2=11485&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Fri Oct 24 16:10:31 2008 @@ -683,16 +683,16 @@ bool abort = false; std::vectorsat::Solvable successfullyInstalledPackages; - RepoProvidePackage repoProvidePackage( access, pool_r); // prepare the package cache. + RepoProvidePackage repoProvidePackage( access, pool_r ); CommitPackageCache packageCache( items_r.begin(), items_r.end(), root() / "tmp", repoProvidePackage ); - for (TargetImpl::PoolItemList::const_iterator it = items_r.begin(); it != items_r.end(); it++) + for ( TargetImpl::PoolItemList::const_iterator it = items_r.begin(); it != items_r.end(); it++ ) { - if (isKind<Package>(it->resolvable())) + if ( (*it)->isKind<Package>() ) { - Package::constPtr p = asKind<Package>(it->resolvable()); + Package::constPtr p = (*it)->asKind<Package>(); if (it->status().isToBeInstalled()) { ManagedFile localfile; @@ -706,15 +706,14 @@ WAR << "Skipping package " << p << " in commit" << endl; continue; } -#if 0 - // bnc #395704: missing catch causes abort. see if packageCache fails to handle - // errors correctly. catch ( const Exception &e ) { + // bnc #395704: missing catch causes abort. + // TODO see if packageCache fails to handle errors correctly. ZYPP_CAUGHT( e ); - SEC << e << endl; + INT << "Unexpected Error: Skipping package " << p << " in commit" << endl; + continue; } -#endif #warning Exception handling // create a installation progress report proxy @@ -813,15 +812,47 @@ progress.disconnect(); } } - else if (!policy_r.dryRun()) // other resolvables (non-Package) + else if ( ! policy_r.dryRun() ) // other resolvables (non-Package) { - if (it->buddy() == sat::Solvable()) - { - // Reset transaction only if this solvable has no buddy (Bug #417799) - // e.g. do not reset Products cause the concerning release package - // could not already be installed. - it->status().resetTransact( ResStatus::USER ); - } + // Status is changed as the buddy package buddy + // gets installed/deleted. Handle non-buddies only. + if ( ! it->buddy() ) + { + if ( (*it)->isKind<Product>() ) + { + Product::constPtr p = (*it)->asKind<Product>(); + if ( it->status().isToBeInstalled() ) + { + ERR << "Can't install orphan product without release-package! " << (*it) << endl; + } + else + { + // Deleting the corresponding product entry is all we con do. + // So the product will no longer be visible as installed. + std::string referenceFilename( p->referenceFilename() ); + if ( referenceFilename.empty() ) + { + ERR << "Can't remove orphan product without 'referenceFilename'! " << (*it) << endl; + } + else + { + PathInfo referenceFile( Pathname::assertprefix( _root, Pathname( "/etc/products.d" ) ) / referenceFilename ); + if ( ! referenceFile.isFile() || filesystem::unlink( referenceFile.path() ) != 0 ) + { + ERR << "Delete orphan product failed: " << referenceFile << endl; + } + } + } + } + else if ( (*it)->isKind<SrcPackage>() && it->status().isToBeInstalled() ) + { + // SrcPackage is install-only + SrcPackage::constPtr p = (*it)->asKind<SrcPackage>(); + installSrcPackage( p ); + } + + it->status().resetTransact( ResStatus::USER ); + } } // other resolvables } // for -- 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