From 09fab2442c2ab9a503841d3dcd56b3c0c3efb502 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Apr 2009 04:36:34 +0200 Subject: * apt-pkg/contrib/strutl.cc: - fix TimeToStr i18n (LP: #289807) * [ABI break] merge support for http redirects, thanks to Jeff Licquia and Anthony Towns * [ABI break] use int for the package IDs (thanks to Steve Cotton) * apt-pkg/pkgcache.cc: - do not run "dpkg --configure pkg" if pkg is in trigger-awaited state (LP: #322955) * methods/https.cc: - add Acquire::https::AllowRedirect support * Clarify the --help for 'purge' (LP: #243948) * cmdline/apt-get.cc - fix "apt-get source pkg" if there is a binary package and a source package of the same name but from different packages (LP: #330103) * cmdline/acqprogress.cc: - Call pkgAcquireStatus::Pulse even if quiet, so that we still get dlstatus messages on the status-fd (LP: #290234). --- apt-pkg/acquire-method.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'apt-pkg/acquire-method.cc') diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index bc29417f7..acf1156dc 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -447,6 +447,38 @@ void pkgAcqMethod::Status(const char *Format,...) } /*}}}*/ +// AcqMethod::Redirect - Send a redirect message /*{{{*/ +// --------------------------------------------------------------------- +/* This method sends the redirect message and also manipulates the queue + to keep the pipeline synchronized. */ +void pkgAcqMethod::Redirect(const string &NewURI) +{ + string CurrentURI = ""; + if (Queue != 0) + CurrentURI = Queue->Uri; + + char S[1024]; + snprintf(S, sizeof(S)-50, "103 Redirect\nURI: %s\nNew-URI: %s\n\n", + CurrentURI.c_str(), NewURI.c_str()); + + if (write(STDOUT_FILENO,S,strlen(S)) != (ssize_t)strlen(S)) + exit(100); + + // Change the URI for the request. + Queue->Uri = NewURI; + + /* To keep the pipeline synchronized, move the current request to + the end of the queue, past the end of the current pipeline. */ + FetchItem *I; + for (I = Queue; I->Next != 0; I = I->Next) ; + I->Next = Queue; + Queue = Queue->Next; + I->Next->Next = 0; + if (QueueBack == 0) + QueueBack = I->Next; +} + /*}}}*/ + // AcqMethod::FetchResult::FetchResult - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -- cgit v1.2.3 From 92fcbfc16396d9a2fbde0edb0902d4ebe7ff0090 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Jun 2009 21:37:30 +0200 Subject: add the various foldmarkers in apt-pkg & cmdline (no code change) --- apt-pkg/acquire-method.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'apt-pkg/acquire-method.cc') diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index acf1156dc..fe066741c 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -446,7 +446,6 @@ void pkgAcqMethod::Status(const char *Format,...) exit(100); } /*}}}*/ - // AcqMethod::Redirect - Send a redirect message /*{{{*/ // --------------------------------------------------------------------- /* This method sends the redirect message and also manipulates the queue @@ -478,7 +477,6 @@ void pkgAcqMethod::Redirect(const string &NewURI) QueueBack = I->Next; } /*}}}*/ - // AcqMethod::FetchResult::FetchResult - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -- cgit v1.2.3