- use a random TmpDir for local rpms tmp repo packages path
authorJan Kupec <jkupec@suse.cz>
Mon, 17 Nov 2008 16:38:41 +0000 (16:38 +0000)
committerJan Kupec <jkupec@suse.cz>
Mon, 17 Nov 2008 16:38:41 +0000 (16:38 +0000)
src/Zypper.cc
src/Zypper.h

index 5b74f40..42b97ef 100644 (file)
@@ -3097,7 +3097,7 @@ void Zypper::doCommand()
       // OTOH packages path == ZYPPER_RPM_CACHE_DIR (the same as repo URI)
       // causes cp file thesamefile, which fails silently. This may be worth
       // fixing in libzypp.
-      repo.setPackagesPath("/tmp/zypper");
+      repo.setPackagesPath(runtimeData().tmpdir);
 
       // shut up zypper
       Out::Verbosity tmp = out().verbosity();
index 9566ea1..47d64f0 100644 (file)
@@ -19,6 +19,7 @@
 #include "zypp/RepoInfo.h"
 #include "zypp/RepoManager.h" // for RepoManagerOptions
 #include "zypp/SrcPackage.h"
+#include "zypp/TmpPath.h"
 
 #include "Command.h"
 #include "utils/getopt.h"
@@ -150,6 +151,9 @@ struct RuntimeData
 
   //! \todo move this to a separate Status struct
   bool waiting_for_input;
+
+  //! Temporary directory for any use. Used e.g. as packagesPath of TMP_RPM_REPO_ALIAS repository.
+  zypp::filesystem::TmpDir tmpdir;
 };
 
 typedef zypp::shared_ptr<zypp::RepoManager> RepoManager_Ptr;