Mailinglist Archive: zypp-commit (233 mails)

< Previous Next >
[zypp-commit] <libzypp> SuSE-Code-11-Branch : Fix unneeded refresh of plaindir repositories in presence of productdir. (bnc #553712)
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Tue, 17 Nov 2009 12:15:28 +0100
  • Message-id: <E1NAM3p-0002sa-QA@xxxxxxxxxxxxxxxx>
ref: refs/heads/SuSE-Code-11-Branch
commit 2d5a1fc061d0aa8bb441011ef9ce09093ef7506e
Author: Michael Andres <ma@xxxxxxx>
Date: Tue Nov 17 12:14:13 2009 +0100

Fix unneeded refresh of plaindir repositories in presence of productdir.
(bnc #553712)
---
zypp/RepoManager.cc | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc
index 8cf2e1a..84bfcd5 100644
--- a/zypp/RepoManager.cc
+++ b/zypp/RepoManager.cc
@@ -650,7 +650,7 @@ namespace zypp
case RepoType::RPMPLAINDIR_e :
{
if ( PathInfo(Pathname(productdatapath + "/cookie")).isExist() )
- status = RepoStatus( /*productdatapath*/ + "/cookie");
+ status = RepoStatus( productdatapath + "/cookie");
}
break;

@@ -806,7 +806,7 @@ namespace zypp
else if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e )
{
MediaMounter media( url );
- RepoStatus newstatus =
parser::plaindir::dirStatus(media.getPathName());
+ RepoStatus newstatus = parser::plaindir::dirStatus( media.getPathName(
info.path() ) );
bool refresh = false;
if ( oldstatus.checksum() == newstatus.checksum() )
{
@@ -934,15 +934,20 @@ namespace zypp
else if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e )
{
MediaMounter media( url );
- RepoStatus newstatus =
parser::plaindir::dirStatus(media.getPathName());
+ RepoStatus newstatus = parser::plaindir::dirStatus(
media.getPathName( info.path() ) );

- std::ofstream file(( tmpdir.path() + "/cookie").c_str());
- if (!file)
+ Pathname productpath( tmpdir.path() / info.path() );
+ filesystem::assert_dir( productpath );
+ std::ofstream file( (productpath/"cookie").c_str() );
+ if ( !file )
{
// TranslatorExplanation '%s' is a filename
- ZYPP_THROW( Exception(str::form( _("Can't open file '%s' for
writing."), (tmpdir.path()/"cookie").c_str() )));
+ ZYPP_THROW( Exception(str::form( _("Can't open file '%s' for
writing."), (productpath/"cookie").c_str() )));
}
- file << url << endl;
+ file << url;
+ if ( ! info.path().empty() && info.path() != "/" )
+ file << " (" << info.path() << ")";
+ file << endl;
file << newstatus.checksum() << endl;

file.close();
@@ -1096,7 +1101,7 @@ namespace zypp
// recusive for plaindir as 2nd arg!
cmd.push_back( "-R" );
// FIXME this does only work form dir: URLs
- cmd.push_back( forPlainDirs->getPathName().c_str() );
+ cmd.push_back( forPlainDirs->getPathName( info.path() ).c_str() );
}
else
cmd.push_back( productdatapath.asString() );
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages