diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/gzip.cc | 8 | ||||
-rw-r--r-- | methods/http.cc | 2 | ||||
-rw-r--r-- | methods/makefile | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/methods/gzip.cc b/methods/gzip.cc index 809afc0fc..f732c0b86 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -52,6 +52,13 @@ bool GzipMethod::Fetch(FetchItem *Itm) // Open the source and destination files FileFd From(Path,FileFd::ReadOnly); + // if the file is empty, just rename it and return + if(From.Size() == 0) + { + rename(Path.c_str(), Itm->DestFile.c_str()); + return true; + } + int GzOut[2]; if (pipe(GzOut) < 0) return _error->Errno("pipe",_("Couldn't open pipe for %s"),Prog); @@ -111,6 +118,7 @@ bool GzipMethod::Fetch(FetchItem *Itm) if (To.Write(Buffer,Count) == false) { Failed = true; + FromGz.Close(); break; } } diff --git a/methods/http.cc b/methods/http.cc index c6623c46f..1833f41ef 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -714,7 +714,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) Req += string("Authorization: Basic ") + Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n"; - Req += "User-Agent: Debian APT-HTTP/1.3\r\n\r\n"; + Req += "User-Agent: Ubuntu APT-HTTP/1.3\r\n\r\n"; if (Debug == true) cerr << Req << endl; diff --git a/methods/makefile b/methods/makefile index 7af5d38d1..2e3abe55c 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods # FIXME.. -LIB_APT_PKG_MAJOR = 3.13 +LIB_APT_PKG_MAJOR = 3.51 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method |