summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-10 12:29:10 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-10 12:29:10 +0200
commitd674bb1d1a8e561ccedab9145dd58d34df68a66e (patch)
treeff308bbd559b13c55404b118098d5261a9b9e205 /apt-pkg
parent64b247e1939d43c6d8823c35615576594e4d18f5 (diff)
parent2a001232db431d995281c2bead32ed9423721447 (diff)
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/cdromutl.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index 6dce82fe1..129e4a9f6 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -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());