From 9b6bc129b200014d97b3ee953fb12c89808f67c2 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Mon, 23 Jul 2007 10:58:47 +0000 Subject: [PATCH] - Create metadata download directories as sibling of the desired final location instead of /var/tmp. (prevent failing renames across filesystem boundaries). --- zypp/RepoManager.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index b28f440..70c48c4 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -323,7 +323,6 @@ namespace zypp try { Url url(*it); - filesystem::TmpDir tmpdir; repo::RepoType repokind = info.type(); @@ -342,6 +341,9 @@ namespace zypp filesystem::assert_dir(rawpath); oldstatus = metadataStatus(info); + // create temp dir as sibling of rawpath + filesystem::TmpDir tmpdir( filesystem::TmpDir::makeSibling( rawpath ) ); + if ( ( repokind.toEnum() == RepoType::RPMMD_e ) || ( repokind.toEnum() == RepoType::YAST2_e ) ) { @@ -428,7 +430,7 @@ namespace zypp // ok we have the metadata, now exchange // the contents - TmpDir oldmetadata; + TmpDir oldmetadata( TmpDir::makeSibling( rawpath ) ); filesystem::rename( rawpath, oldmetadata.path() ); // move the just downloaded there filesystem::rename( tmpdir.path(), rawpath ); -- 2.7.4