]> git.saurik.com Git - apt.git/commitdiff
merged from lp:~mvo/apt/mvo
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 10 Sep 2010 10:29:10 +0000 (12:29 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 10 Sep 2010 10:29:10 +0000 (12:29 +0200)
apt-pkg/contrib/cdromutl.cc
debian/changelog

index 6dce82fe1b757f4983798b50c56d93ff0963bfab..129e4a9f602605914c68993fd219a3ed492854e3 100644 (file)
@@ -157,6 +157,16 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version)
 {
    MD5Summation Hash;
 
+   // if we are on a writable medium (like a usb-stick) that is just
+   // used like a cdrom don't use "." as it will constantly change,
+   // use .disk instead
+   if (access(CD.c_str(), W_OK) == 0 && DirectoryExists(CD+string("/.disk"))) {
+      CD = CD+string("/.disk");
+      if (_config->FindB("Debug::aptcdrom",false) == true)
+         std::clog << "Found writable cdrom, using alternative path: "
+                   << CD.c_str() << std::endl;
+   }
+
    string StartDir = SafeGetCWD();
    if (chdir(CD.c_str()) != 0)
       return _error->Errno("chdir",_("Unable to change to %s"),CD.c_str());
index 64f606f778d4496bf5962f7edaa1c22a39c81d0d..64d37ba96ab2dc64318a32876a4b544de8eb5923 100644 (file)
@@ -1,8 +1,13 @@
-apt (0.8.3ubuntu2) maverick; urgency=low
+apt (0.8.3ubuntu2) UNRELEASEDmaverick; urgency=low
 
   * ftparchive/writer.cc:
     - write out {Files,Checksum-Sha1,Checksum-Sha256} only if
       available LP: #633967. Thanks to Colin Watson
+  * apt-pkg/contrib/cdromutl.cc:
+    - if apt-cdrom is used on writable media (like usb-sticks), do
+      not use the root directory to identify the medium (as all 
+      changes there change the ident id). Use the .disk directory 
+      instead 
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 09 Sep 2010 15:30:19 +0200