]> git.saurik.com Git - apt.git/commitdiff
* cherry picked the media-change support from apt--mvo--0
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 12 Sep 2005 13:49:44 +0000 (13:49 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 12 Sep 2005 13:49:44 +0000 (13:49 +0000)
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

README.progress-reporting
apt-pkg/acquire-worker.cc
configure.in
debian/changelog

index 73fbd8c0877a9ba90a29992d65b18a7cc02900cd..b575e7879d4c8960fb4a57c6fac5cfe5bf782370 100644 (file)
@@ -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
 --------
index 5cd7d6f1e640458aef11edffb85357605bbdec97..d06024178ef4fe17fe4adf97a7b14a7aa2423579 100644 (file)
@@ -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)
    {
index 8b38188dae30f576de27105b4ec913137a757fe9..03399f5c500f356999a83e79e239d50807a838a6 100644 (file)
@@ -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)
index d2c8fabd8a80c1f34db4d2aabb1d492bcfde6983..06a35766116221354a272a8ac7b8d3fb25c332b8 100644 (file)
@@ -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: