X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a5eef4f76b4e46f607886eba0da8a03793f201b9..4a1778448653283970ea094822738ddbed8f7825:/cmdline/apt-extracttemplates.cc diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 70e7f914a..d6894a732 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-extracttemplates.cc,v 1.13 2002/11/09 23:08:08 doogie Exp $ +// $Id: apt-extracttemplates.cc,v 1.15 2003/07/26 00:00:11 mdz Exp $ /* ###################################################################### APT Extract Templates - Program to extract debconf config and template @@ -41,6 +41,8 @@ #include "apt-extracttemplates.h" /*}}}*/ +using namespace std; + #define TMPDIR "/tmp" pkgCache *DebFile::Cache = 0; @@ -97,7 +99,7 @@ bool DebFile::Go() if (File.Seek(Member->Start) == false) return false; - ExtractTar Tar(File, Member->Size); + ExtractTar Tar(File, Member->Size,"gzip"); return Tar.Go(*this); } /*}}}*/ @@ -247,7 +249,15 @@ string WriteFile(const char *package, const char *prefix, const char *data) { char fn[512]; static int i; - snprintf(fn, sizeof(fn), "%s/%s.%s.%u%d", _config->Find("APT::ExtractTemplates::TempDir", TMPDIR).c_str(), package, prefix, getpid(), i++); + char *tempdir = NULL; + + tempdir = getenv("TMPDIR"); + if (tempdir == NULL) + tempdir = TMPDIR; + + snprintf(fn, sizeof(fn), "%s/%s.%s.%u%d", + _config->Find("APT::ExtractTemplates::TempDir", tempdir).c_str(), + package, prefix, getpid(), i++); FileFd f; if (data == NULL) data = "";