- Create metadata download directories as sibling of the desired
authorMichael Andres <ma@suse.de>
Mon, 23 Jul 2007 10:58:47 +0000 (10:58 +0000)
committerMichael Andres <ma@suse.de>
Mon, 23 Jul 2007 10:58:47 +0000 (10:58 +0000)
  final location instead of /var/tmp. (prevent failing renames
  across filesystem boundaries).

zypp/RepoManager.cc

index b28f440..70c48c4 100644 (file)
@@ -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 );