diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-09-12 13:49:44 +0000 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-09-12 13:49:44 +0000 |
commit | e3c00bf5af56e2575ffb0db49dd6d706544ca30b (patch) | |
tree | 265c4675670559ab3a180795217129b4ee22018a | |
parent | 3971f8e87d659d9ac657dafdf665019a9cfc5c4c (diff) | |
parent | 1a82c63ec114f123def943e16e8ec5ceaf8ed85a (diff) |
* cherry picked the media-change support from apt--mvo--0
Patches applied:
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-50
* meda-change message is send over status-fd now
* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-51
* include a human readable string for the MediaChange status-fd message as well
-rw-r--r-- | README.progress-reporting | 9 | ||||
-rw-r--r-- | apt-pkg/acquire-worker.cc | 19 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | debian/changelog | 7 |
4 files changed, 35 insertions, 2 deletions
diff --git a/README.progress-reporting b/README.progress-reporting index 73fbd8c08..b575e7879 100644 --- a/README.progress-reporting +++ b/README.progress-reporting @@ -5,7 +5,7 @@ If the apt options: "APT::Status-Fd" is set, apt will send status reports to that fd. The status information is seperated with a ':', there are the following status conditions: -status = {"pmstatus", "dlstatus", "conffile-prompt", "error" } +status = {"pmstatus", "dlstatus", "conffile-prompt", "error", "media-change" } The reason for using a fd instead of a OpProgress class is that many apt frontend fork a (vte) terminal for the actual installation. @@ -47,6 +47,13 @@ pmconffile pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited +media-change +------------ +media-change:medium:drive:human-readable string + +example: +media-change: Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830):/cdrom/:Please insert the disc labeled: 'Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830)' in the drive '/cdrom/' and press enter. + dlstatus -------- diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 5cd7d6f1e..d06024178 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -25,6 +25,7 @@ #include <apti18n.h> #include <iostream> +#include <sstream> #include <fstream> #include <sys/stat.h> @@ -367,6 +368,24 @@ bool pkgAcquire::Worker::Capabilities(string Message) /* */ bool pkgAcquire::Worker::MediaChange(string Message) { + int status_fd = _config->FindI("APT::Status-Fd",-1); + if(status_fd > 0) + { + string Media = LookupTag(Message,"Media"); + string Drive = LookupTag(Message,"Drive"); + ostringstream msg,status; + ioprintf(msg,_("Please insert the disc labeled: " + "'%s' " + "in the drive '%s' and press enter."), + Media.c_str(),Drive.c_str()); + status << "media-change: " // message + << Media << ":" // media + << Drive << ":" // drive + << msg.str() // l10n message + << endl; + write(status_fd, status.str().c_str(), status.str().size()); + } + if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"), LookupTag(Message,"Drive")) == false) { diff --git a/configure.in b/configure.in index 8b38188da..03399f5c5 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.6.40.1ubuntu4") +AC_DEFINE_UNQUOTED(VERSION,"0.6.40.1ubuntu5") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --git a/debian/changelog b/debian/changelog index d2c8fabd8..06a357661 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +apt (0.6.40.1ubuntu5) breezy; urgency=low + + * Cheery picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-{50,51}. + This adds media-change reporting to the apt status-fd (ubuntu #15213) + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 12 Sep 2005 15:44:26 +0200 + apt (0.6.40.1ubuntu4) breezy; urgency=low * debian/apt.cron.daily: |