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.
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
--------
#include <apti18n.h>
#include <iostream>
+#include <sstream>
#include <fstream>
#include <sys/stat.h>
/* */
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)
{
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)
+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: