]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-method.cc
Fixes for file opening
[apt.git] / apt-pkg / acquire-method.cc
index 681015910da72ad57c6c945af7e6cbe7e0ad517b..75ddee14af86dc4dd18edcb515907d1a177702ff 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire-method.cc,v 1.4 1998/11/05 07:21:38 jgg Exp $
+// $Id: acquire-method.cc,v 1.8 1998/11/14 01:39:41 jgg Exp $
 /* ######################################################################
 
    Acquire Method
@@ -41,6 +41,9 @@ pkgAcqMethod::pkgAcqMethod(const char *Ver,unsigned long Flags)
    
    if ((Flags & SendConfig) == SendConfig)
       strcat(End,"Send-Config: true\n");
+
+   if ((Flags & LocalOnly) == LocalOnly)
+      strcat(End,"Local-Only: true\n");
    strcat(End,"\n");
 
    if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
@@ -141,6 +144,10 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
    if (Res.MD5Sum.empty() == false)
       End += snprintf(End,sizeof(S) - (End - S),"MD5Sum: %s\n",Res.MD5Sum.c_str());
 
+   if (Res.ResumePoint != 0)
+      End += snprintf(End,sizeof(S) - (End - S),"Resume-Point: %u\n",
+                     Res.ResumePoint);
+
    if (Res.IMSHit == true)
       strcat(End,"IMS-Hit: true\n");
    End = S + strlen(S);
@@ -256,7 +263,9 @@ int pkgAcqMethod::Run(bool Single)
            
            Tmp->Uri = LookupTag(Message,"URI");
            Tmp->DestFile = LookupTag(Message,"FileName");
-           StrToTime(LookupTag(Message,"Last-Modified"),Tmp->LastModified);
+           if (StrToTime(LookupTag(Message,"Last-Modified"),Tmp->LastModified) == false)
+              Tmp->LastModified = 0;
+           
            Tmp->Next = 0;
            
            // Append it to the list
@@ -314,7 +323,7 @@ void pkgAcqMethod::Status(const char *Format,...)
 
    // sprintf the description
    char S[1024];
-   unsigned int Len = snprintf(S,sizeof(S),"101 Status\nURI: %s\n"
+   unsigned int Len = snprintf(S,sizeof(S),"102 Status\nURI: %s\n"
                               "Message: ",CurrentURI.c_str());
 
    vsnprintf(S+Len,sizeof(S)-Len,Format,args);
@@ -328,8 +337,8 @@ void pkgAcqMethod::Status(const char *Format,...)
 // AcqMethod::FetchResult::FetchResult - Constructor                   /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-pkgAcqMethod::FetchResult::FetchResult() : LastModified(0), 
-                                   IMSHit(false), Size(0)
+pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
+                                   IMSHit(false), Size(0), ResumePoint(0)
 {
 }
                                                                        /*}}}*/