Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9851 - in /trunk/libzypp: tests/zypp/RepoManager_test.cc zypp/RepoManager.cc zypp/RepoManager.h
  • From: matz@xxxxxxxxxxxxxxxx
  • Date: Sun, 27 Apr 2008 19:53:53 -0000
  • Message-id: <20080427195354.23CA325160@xxxxxxxxxxxxxxxx>
Author: matz
Date: Sun Apr 27 21:53:53 2008
New Revision: 9851

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9851&view=rev
Log:
Create the solv files in their own subdirs under $CACHE/solv/. Preparation
for split solv files. (The @System repo still is generated in the main
cache path)

Modified:
trunk/libzypp/tests/zypp/RepoManager_test.cc
trunk/libzypp/zypp/RepoManager.cc
trunk/libzypp/zypp/RepoManager.h

Modified: trunk/libzypp/tests/zypp/RepoManager_test.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/RepoManager_test.cc?rev=9851&r1=9850&r2=9851&view=diff
==============================================================================
--- trunk/libzypp/tests/zypp/RepoManager_test.cc (original)
+++ trunk/libzypp/tests/zypp/RepoManager_test.cc Sun Apr 27 21:53:53 2008
@@ -117,9 +117,9 @@
BOOST_CHECK_MESSAGE( ref_stat== RepoManager::REPO_UP_TO_DATE || ref_stat ==
RepoManager::REPO_CHECK_DELAYED, "Metadata should be up to date" );

// the solv file should exists now
- Pathname base = (opts.repoCachePath + repo.alias());
- Pathname solvfile = base.extend(".solv");
- Pathname cookiefile = base.extend(".cookie");
+ Pathname base = (opts.repoCachePath / "solv" / repo.alias());
+ Pathname solvfile = base / "solv";
+ Pathname cookiefile = base / "cookie";
BOOST_CHECK_MESSAGE( PathInfo(solvfile).isExist(), "Solv file is created
after caching: " + solvfile.asString());
BOOST_CHECK_MESSAGE( PathInfo(cookiefile).isExist(), "Cookie file is created
after caching: " + cookiefile.asString());


Modified: trunk/libzypp/zypp/RepoManager.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=9851&r1=9850&r2=9851&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.cc (original)
+++ trunk/libzypp/zypp/RepoManager.cc Sun Apr 27 21:53:53 2008
@@ -203,6 +203,12 @@
return opt.repoPackagesCachePath / info.escaped_alias();
}

+ static Pathname solv_path_for_repoinfo( const RepoManagerOptions &opt, const
RepoInfo &info)
+ {
+ assert_alias(info);
+ return opt.repoCachePath / "solv" / info.escaped_alias();
+ }
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : RepoManager::Impl
@@ -678,9 +684,9 @@
Pathname rawpath = rawcache_path_for_repoinfo(_pimpl->options, info);

filesystem::assert_dir(_pimpl->options.repoCachePath);
- Pathname base = _pimpl->options.repoCachePath + info.escaped_alias();
- Pathname solvfile = base.extend(".solv");
-
+ Pathname base = solv_path_for_repoinfo( _pimpl->options, info);
+ filesystem::assert_dir(base);
+ Pathname solvfile = base / "solv";

RepoStatus raw_metadata_status = metadataStatus(info);
if ( raw_metadata_status.empty() )
@@ -810,7 +816,7 @@
#endif
// update timestamp and checksum
//store.updateRepositoryStatus(id, raw_metadata_status);
- setCacheStatus(info.escaped_alias(), raw_metadata_status);
+ setCacheStatus(info, raw_metadata_status);
MIL << "Commit cache.." << endl;
//store.commit();
//progress.toMax();
@@ -873,9 +879,7 @@
progress.sendTo(progressrcv);
progress.toMin();

- unlink (_pimpl->options.repoCachePath / (info.escaped_alias() + ".solv"));
- progress.set(99);
- unlink (_pimpl->options.repoCachePath / (info.escaped_alias() +
".cookie"));
+ filesystem::recursive_rmdir(solv_path_for_repoinfo(_pimpl->options, info));

progress.toMax();
}
@@ -890,24 +894,22 @@

bool RepoManager::isCached( const RepoInfo &info ) const
{
- Pathname name = _pimpl->options.repoCachePath;
- return PathInfo(name +
Pathname(info.escaped_alias()).extend(".solv")).isExist();
+ return PathInfo(solv_path_for_repoinfo( _pimpl->options, info ) /
"solv").isExist();
}

RepoStatus RepoManager::cacheStatus( const RepoInfo &info ) const
{

- Pathname base = _pimpl->options.repoCachePath + info.escaped_alias();
- Pathname cookiefile = base.extend(".cookie");
+ Pathname cookiefile = solv_path_for_repoinfo(_pimpl->options, info) /
"cookie";

return RepoStatus::fromCookieFile(cookiefile);
}

- void RepoManager::setCacheStatus( const string &alias, const RepoStatus
&status )
+ void RepoManager::setCacheStatus( const RepoInfo &info, const RepoStatus
&status )
{
- filesystem::assert_dir(_pimpl->options.repoCachePath);
- Pathname base = _pimpl->options.repoCachePath + alias;
- Pathname cookiefile = base.extend(".cookie");
+ Pathname base = solv_path_for_repoinfo(_pimpl->options, info);
+ filesystem::assert_dir(base);
+ Pathname cookiefile = base / "cookie";

status.saveToCookieFile(cookiefile);
}
@@ -916,8 +918,7 @@
const ProgressData::ReceiverFnc &
progressrcv )
{
assert_alias(info);
- string alias = info.escaped_alias();
- Pathname solvfile = (_pimpl->options.repoCachePath /
alias).extend(".solv");
+ Pathname solvfile = solv_path_for_repoinfo(_pimpl->options, info) / "solv";

if ( ! PathInfo(solvfile).isExist() )
ZYPP_THROW(RepoNotCachedException(info));

Modified: trunk/libzypp/zypp/RepoManager.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=9851&r1=9850&r2=9851&view=diff
==============================================================================
--- trunk/libzypp/zypp/RepoManager.h (original)
+++ trunk/libzypp/zypp/RepoManager.h Sun Apr 27 21:53:53 2008
@@ -391,7 +391,7 @@

protected:
RepoStatus rawMetadataStatus( const RepoInfo &info );
- void setCacheStatus( const std::string &alias, const RepoStatus &status );
+ void setCacheStatus( const RepoInfo &info, const RepoStatus &status );

/**
* Update timestamp of repository index file for the specified repository
\a info.

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages