X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/51b2a0fc603c8e4fe667bf7a278bd1ce151e38a3..6f43fac607c94f423f1d01708ecf947a8a303d38:/cmdline/apt-extracttemplates.cc?ds=sidebyside diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 60efafba5..8e1937113 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -36,17 +36,17 @@ #include #include #include +#include + #include -#include -#include #include "apt-extracttemplates.h" + +#include /*}}}*/ using namespace std; -#define TMPDIR "/tmp" - pkgCache *DebFile::Cache = 0; // DebFile::DebFile - Construct the DebFile object /*{{{*/ @@ -251,14 +251,11 @@ string WriteFile(const char *package, const char *prefix, const char *data) { char fn[512]; static int i; - const char *tempdir = NULL; - - tempdir = getenv("TMPDIR"); - if (tempdir == NULL) - tempdir = TMPDIR; + std::string tempdir = GetTempDir(); snprintf(fn, sizeof(fn), "%s/%s.%s.%u%d", - _config->Find("APT::ExtractTemplates::TempDir", tempdir).c_str(), + _config->Find("APT::ExtractTemplates::TempDir", + tempdir.c_str()).c_str(), package, prefix, getpid(), i++); FileFd f; if (data == NULL)