From f8e2c6131e6e501a507b70bb75bb58fa0f878ba4 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Mon, 17 Nov 2008 16:38:41 +0000 Subject: [PATCH] - use a random TmpDir for local rpms tmp repo packages path --- src/Zypper.cc | 2 +- src/Zypper.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Zypper.cc b/src/Zypper.cc index 5b74f40..42b97ef 100644 --- a/src/Zypper.cc +++ b/src/Zypper.cc @@ -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(); diff --git a/src/Zypper.h b/src/Zypper.h index 9566ea1..47d64f0 100644 --- a/src/Zypper.h +++ b/src/Zypper.h @@ -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 RepoManager_Ptr; -- 2.7.4