From 59b46c414d5a5cebd26bdafac6b08fa4d1ba0963 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 19 Dec 2006 11:44:52 +0100 Subject: * apt-pkg/deb/debrecords.cc: - return the correct SHA1Hash() * methods/http.cc: - send VERSION of apt in the User-Agent string --- methods/http.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index c6623c46f..06b91686c 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -44,6 +44,7 @@ // Internet stuff #include +#include "config.h" #include "connect.h" #include "rfc2553emu.h" #include "http.h" @@ -714,7 +715,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: Debian APT-HTTP/1.3 ("VERSION")\r\n\r\n"; if (Debug == true) cerr << Req << endl; -- cgit v1.2.3 From 509598772f0df89ea5e783a636fb941b1fc6675c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 7 Mar 2007 10:04:31 +0100 Subject: * apt-pkg/cdrom.cc, methods/cdrom.cc: - only unmount if APT::CDROM::NoMount is false --- methods/cdrom.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'methods') diff --git a/methods/cdrom.cc b/methods/cdrom.cc index d6b8eae75..d662b7129 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -57,7 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | /* */ void CDROMMethod::Exit() { - if (Mounted == true) + if (Mounted == true && _config->FindB("APT::CDROM::NoMount",false) == false) UnmountCdrom(CDROM); } /*}}}*/ @@ -160,7 +160,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm) break; // I suppose this should prompt somehow? - if (UnmountCdrom(CDROM) == false) + if (_config->FindB("APT::CDROM::NoMount",false) == false && + UnmountCdrom(CDROM) == false) return _error->Error(_("Unable to unmount the CD-ROM in %s, it may still be in use."), CDROM.c_str()); if (MediaFail(Get.Host,CDROM) == false) -- cgit v1.2.3 From 25a04630d6eef123a62f50703b82cc62acf1fbfb Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 7 Mar 2007 12:06:08 +0100 Subject: - added APT::CDROM::UnMountOnFinish to have more control over the umount/mount process --- methods/cdrom.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/cdrom.cc b/methods/cdrom.cc index d662b7129..556d2c1a6 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -57,7 +57,8 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | /* */ void CDROMMethod::Exit() { - if (Mounted == true && _config->FindB("APT::CDROM::NoMount",false) == false) + if (Mounted == true && + _config->FindB("APT::CDROM::UnMountOnFinish",true) == true) UnmountCdrom(CDROM); } /*}}}*/ -- cgit v1.2.3 From 70dbf5f8f3e6e3526c82c72ed1795d9f2dad0338 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 7 Mar 2007 12:49:33 +0100 Subject: * apt-pkg/cdrom.cc: - only unmount if APT::CDROM::NoMount is false * methods/cdrom.cc: - only umount if it was mounted by the method before --- methods/cdrom.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'methods') diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 556d2c1a6..601bc11c9 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -30,7 +30,7 @@ class CDROMMethod : public pkgAcqMethod ::Configuration Database; string CurrentID; string CDROM; - bool Mounted; + bool MountedByApt; virtual bool Fetch(FetchItem *Itm); string GetID(string Name); @@ -48,7 +48,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | SendConfig | NeedsCleanup | Removable), DatabaseLoaded(false), - Mounted(false) + MountedByApt(false) { }; /*}}}*/ @@ -57,8 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | /* */ void CDROMMethod::Exit() { - if (Mounted == true && - _config->FindB("APT::CDROM::UnMountOnFinish",true) == true) + if (MountedByApt == true) UnmountCdrom(CDROM); } /*}}}*/ @@ -140,7 +139,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm) while (CurrentID.empty() == true) { bool Hit = false; - Mounted = MountCdrom(CDROM); + if(!IsMounted(CDROM)) + MountedByApt = MountCdrom(CDROM); for (unsigned int Version = 2; Version != 0; Version--) { if (IdentCdrom(CDROM,NewID,Version) == false) -- cgit v1.2.3 From c03462c6fed27e26b2bab4b3b34589fa8bf464f8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 17 Apr 2007 15:33:19 +0200 Subject: * [ABI] apt-pkg/acquire.{cc,h}: - deal better with duplicated sources.list entries (avoid double queuing of URLs) - this fixes hangs in bzip/gzip --- methods/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/makefile b/methods/makefile index 1e3b1ef85..3f561a2c3 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods # FIXME.. -LIB_APT_PKG_MAJOR = 3.11 +LIB_APT_PKG_MAJOR = 3.12 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method -- cgit v1.2.3