X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e5dfb858ba7dc53c2a29324f2b4678f4f6912871..ff6bf1be3844bcda15303efc81e234ede7501e3c:/methods/ftp.cc

diff --git a/methods/ftp.cc b/methods/ftp.cc
index 00d3476c8..0c2aa00a7 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -201,7 +201,7 @@ bool FTPConn::Login()
       if (ReadResp(Tag,Msg) == false)
 	 return false;
       if (Tag >= 400)
-	 return _error->Error(_("Server refused our connection and said: %s"),Msg.c_str());
+	 return _error->Error(_("The server refused the connection and said: %s"),Msg.c_str());
       
       // Send the user
       if (WriteMsg(Tag,Msg,"USER %s",User.c_str()) == false)
@@ -229,7 +229,7 @@ bool FTPConn::Login()
       if (ReadResp(Tag,Msg) == false)
 	 return false;
       if (Tag >= 400)
-	 return _error->Error(_("Server refused our connection and said: %s"),Msg.c_str());
+	 return _error->Error(_("The server refused the connection and said: %s"),Msg.c_str());
       
       // Perform proxy script execution
       Configuration::Item const *Opts = _config->Tree("Acquire::ftp::ProxyLogin");
@@ -443,7 +443,7 @@ bool FTPConn::WriteMsg(unsigned int &Ret,string &Text,const char *Fmt,...)
       int Res = write(ServerFd,S + Start,Len);
       if (Res <= 0)
       {
-	 _error->Errno("write",_("Write Error"));
+	 _error->Errno("write",_("Write error"));
 	 Close();
 	 return false;
       }
@@ -1055,9 +1055,12 @@ bool FtpMethod::Fetch(FetchItem *Itm)
 	 UBuf.modtime = FailTime;
 	 utime(FailFile.c_str(),&UBuf);
 	 
-	 // If the file is missing we hard fail otherwise transient fail
-	 if (Missing == true)
+	 // If the file is missing we hard fail and delete the destfile
+	 // otherwise transient fail
+	 if (Missing == true) {
+	    unlink(FailFile.c_str());
 	    return false;
+	 }
 	 Fail(true);
 	 return true;
       }
@@ -1098,12 +1101,11 @@ int main(int argc,const char *argv[])
 	 char S[300];
 	 snprintf(S,sizeof(S),"http_proxy=%s",getenv("ftp_proxy"));
 	 putenv(S);
-	 //mvo: why should we unset no_proxy here?
-	 //putenv("no_proxy=");
+	 putenv("no_proxy=");
 	 
 	 // Run the http method
 	 string Path = flNotFile(argv[0]) + "http";
-	 execl(Path.c_str(),Path.c_str(),0);
+	 execl(Path.c_str(),Path.c_str(),(char *)NULL);
 	 cerr << _("Unable to invoke ") << Path << endl;
 	 exit(100);
       }