]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-extracttemplates.cc
* don't get candidate release as version tag for FindSrc by default. because it break...
[apt.git] / cmdline / apt-extracttemplates.cc
index 73b3bc51c78483dfaf86e025f21f59b20d0586e1..c87b436ba65e85429f7eb6e8e374acabe6dcc476 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-extracttemplates.cc,v 1.14 2003/01/11 07:18:44 jgg 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
@@ -99,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);
 }
                                                                        /*}}}*/
@@ -238,7 +238,7 @@ int ShowHelp(void)
                "  -h   This help text\n"
                "  -t   Set the temp dir\n"
                "  -c=? Read this configuration file\n"
-               "  -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp\n");
+               "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n");
        return 0;
 }
                                                                        /*}}}*/
@@ -249,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 = "";