From 2493f4b5dfa4b4d7fcaa944e9fd4bd2573ae3ec1 Mon Sep 17 00:00:00 2001 From: "bubulle@debian.org" <> Date: Thu, 9 Sep 2010 22:23:31 +0200 Subject: Fix missing space after dot in a message from apt-pkg Translations unfuzzied. Thanks to Holger Wansing. --- apt-pkg/acquire-item.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 7257f89e4..2c4ce91a0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1327,7 +1327,7 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Status = StatTransientNetworkError; _error->Warning(_("A error occurred during the signature " "verification. The repository is not updated " - "and the previous index files will be used." + "and the previous index files will be used. " "GPG error: %s: %s\n"), Desc.Description.c_str(), LookupTag(Message,"Message").c_str()); -- cgit v1.2.3 From 2a001232db431d995281c2bead32ed9423721447 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 10 Sep 2010 12:21:06 +0200 Subject: * 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 --- apt-pkg/contrib/cdromutl.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg') 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()); -- cgit v1.2.3 From 7970157ffb85024c03fde027bac2f0ebbe587ad7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 10 Sep 2010 13:43:32 +0200 Subject: apt-pkg/contrib/cdromutl.cc: style fixes (thanks to David for his code-review) --- apt-pkg/contrib/cdromutl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 129e4a9f6..9c00f94b5 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -161,10 +161,10 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) // 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"); + CD = CD.append("/.disk"); if (_config->FindB("Debug::aptcdrom",false) == true) - std::clog << "Found writable cdrom, using alternative path: " - << CD.c_str() << std::endl; + std::clog << "Found writable cdrom, using alternative path: " << CD + << std::endl; } string StartDir = SafeGetCWD(); -- cgit v1.2.3 From 4dc7b4a76ee7344c2c7743ab8dd070b85bf6935a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 10 Sep 2010 13:56:40 +0200 Subject: apt-pkg/contrib/cdromutl.cc: do not take Buf.f_bfree into account on writable media --- apt-pkg/contrib/cdromutl.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 9c00f94b5..68b980407 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -156,11 +156,14 @@ bool MountCdrom(string Path, string DeviceName) bool IdentCdrom(string CD,string &Res,unsigned int Version) { MD5Summation Hash; + bool writable_media = false; // 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"))) { + if (access(CD.c_str(), W_OK) == 0 && DirectoryExists(CD+string("/.disk"))) + { + writable_media = true; CD = CD.append("/.disk"); if (_config->FindB("Debug::aptcdrom",false) == true) std::clog << "Found writable cdrom, using alternative path: " << CD @@ -212,10 +215,15 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) struct statvfs Buf; if (statvfs(CD.c_str(),&Buf) != 0) return _error->Errno("statfs",_("Failed to stat the cdrom")); - + // We use a kilobyte block size to advoid overflow - sprintf(S,"%lu %lu",(long)(Buf.f_blocks*(Buf.f_bsize/1024)), - (long)(Buf.f_bfree*(Buf.f_bsize/1024))); + if (writable_media) + { + sprintf(S,"%lu",(long)(Buf.f_blocks*(Buf.f_bsize/1024))); + } else { + sprintf(S,"%lu %lu",(long)(Buf.f_blocks*(Buf.f_bsize/1024)), + (long)(Buf.f_bfree*(Buf.f_bsize/1024))); + } Hash.Add(S); sprintf(S,"-%u",Version); } -- cgit v1.2.3