Try to create a missing destination dir before switching to tmp space (bnc#755239)
authorMichael Andres <ma@suse.de>
Tue, 17 Apr 2012 15:53:28 +0000 (17:53 +0200)
committerMichael Andres <ma@suse.de>
Tue, 17 Apr 2012 15:53:28 +0000 (17:53 +0200)
zypp/repo/RepoProvideFile.cc

index d86e6de..b934060 100644 (file)
@@ -274,7 +274,15 @@ namespace zypp
       // switch into the tmpspace (e.g. bnc#755239, download and
       // install srpms as user).
       Pathname destinationDir( repo_r.packagesPath() );
-      if ( ! PathInfo( destinationDir ).userMayW() )
+
+      PathInfo pi( destinationDir );
+      if ( ! pi.isExist() )
+      {
+       // try to create it...
+       assert_dir( destinationDir );
+       pi();
+      }
+      if ( ! pi.userMayW() )
       {
         WAR << "Destination dir '" << destinationDir << "' is not user writable, using tmp space." << endl;
         destinationDir = getZYpp()->tmpPath() / destinationDir;