[zypp-commit] r11922 - in /trunk/libzypp/zypp: RepoStatus.cc RepoStatus.h target/TargetImpl.cc
Author: mlandres Date: Wed Dec 10 16:08:47 2008 New Revision: 11922 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11922&view=rev Log: Monitor /etc/products.d to determine if @system.solv needs to be rebuilt. (bnc #457933) Modified: trunk/libzypp/zypp/RepoStatus.cc trunk/libzypp/zypp/RepoStatus.h trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/zypp/RepoStatus.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoStatus.cc?rev=11922&r1=11921&r2=11922&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoStatus.cc (original) +++ trunk/libzypp/zypp/RepoStatus.cc Wed Dec 10 16:08:47 2008 @@ -72,6 +72,20 @@ : _pimpl( new Impl() ) {} + RepoStatus::RepoStatus( const Pathname &path ) + : _pimpl( new Impl() ) + { + PathInfo info(path); + if ( info.isExist() ) + { + _pimpl->timestamp = Date(info.mtime()); + if ( info.isFile() ) + _pimpl->checksum = filesystem::sha1sum(path); + else // non files + _pimpl->checksum = str::numstring(info.mtime()); + } + } + /////////////////////////////////////////////////////////////////// // // METHOD NAME : RepoStatus::~RepoStatus @@ -107,17 +121,6 @@ file.close(); } - RepoStatus::RepoStatus( const Pathname &path ) - : _pimpl( new Impl() ) - { - PathInfo info(path); - if ( info.isExist() ) - { - _pimpl->checksum = filesystem::sha1sum(path); - _pimpl->timestamp = Date(info.mtime()); - } - } - bool RepoStatus::empty() const { return _pimpl->checksum.empty(); Modified: trunk/libzypp/zypp/RepoStatus.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoStatus.h?rev=11922&r1=11921&r2=11922&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoStatus.h (original) +++ trunk/libzypp/zypp/RepoStatus.h Wed Dec 10 16:08:47 2008 @@ -105,6 +105,14 @@ * * \note construct from a non existing * file will result in an empty status + * + * \note construct from a directory, the + * directories mtime will be also used as + * checksum. + * + * \todo Add recursive option for dirs so we finaly get + * the same as \ref parser::plaindir::dirStatus and can + * unify both. */ RepoStatus( const Pathname &file ); Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=11922&r1=11921&r2=11922&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Wed Dec 10 16:08:47 2008 @@ -455,7 +455,9 @@ bool build_rpm_solv = true; // lets see if the rpm solv cache exists - RepoStatus rpmstatus(_root + "/var/lib/rpm/Name"); + RepoStatus rpmstatus( RepoStatus( _root/"/var/lib/rpm/Name" ) + && (_root/"/etc/products.d") ); + bool solvexisted = PathInfo(rpmsolv).isExist(); if ( solvexisted ) { -- 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