X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/90a88b83020eb9526951eec83e3075b54653fa33..08b1e22c3d1bdf94e61ff5e23bed00b8d32b8725:/apt-inst/extract.cc

diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index 85363b9a1..2c95fba92 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -44,9 +44,12 @@
    ##################################################################### */
 									/*}}}*/
 // Include Files							/*{{{*/
+#include<config.h>
+
 #include <apt-pkg/extract.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/debversion.h>
+#include <apt-pkg/fileutl.h>
 
 #include <sys/stat.h>
 #include <stdio.h>
@@ -78,8 +81,6 @@ pkgExtract::pkgExtract(pkgFLCache &FLCache,pkgCache::VerIterator Ver) :
 /* This performs the setup for the extraction.. */
 bool pkgExtract::DoItem(Item &Itm,int &Fd)
 {
-   char Temp[sizeof(FileName)];
-   
    /* Strip any leading/trailing /s from the filename, then copy it to the
       temp buffer and re-apply the leading / We use a class variable
       to store the new filename for use by the three extraction funcs */
@@ -180,6 +181,7 @@ bool pkgExtract::DoItem(Item &Itm,int &Fd)
       // See if we can recover the backup file
       if (Nde.end() == false)
       {
+	 char Temp[sizeof(FileName)];
 	 snprintf(Temp,sizeof(Temp),"%s.%s",Itm.Name,TempExt);
 	 if (rename(Temp,Itm.Name) != 0 && errno != ENOENT)
 	    return _error->Errno("rename",_("Failed to rename %s to %s"),
@@ -372,7 +374,6 @@ bool pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator Nde,
    pkgFLCache::NodeIterator TmpNde = Nde;
    unsigned long DiverOwner = 0;
    unsigned long FileGroup = Nde->File;
-   const char *FirstOwner = 0;
    for (; Nde.end() == false && FileGroup == Nde->File; Nde++)
    {
       if ((Nde->Flags & pkgFLCache::Node::Diversion) != 0)
@@ -392,8 +393,7 @@ bool pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator Nde,
          if something has already been diverted by this diversion */
       if (FPkg.Offset() == DiverOwner)
 	 continue;
-      FirstOwner = FPkg.Name();
-      
+
       // Now see if this package matches one in a replace depends
       pkgCache::DepIterator Dep = Ver.DependsList();
       bool Ok = false;