From 95f395cc774d522eda1b80b310bd75767aa11bd4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Jun 2011 08:48:09 +0200 Subject: * methods/mirror.cc: - ignore lines starting with "#" in the mirror file - ignore non http urls in the mirrors --- debian/changelog | 5 +++++ methods/mirror.cc | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d02091f54..9fbcf0ad6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -73,6 +73,11 @@ apt (0.8.15) UNRELEASED; urgency=low * apt-pkg/packagemanager.cc: - ensure for Multi-Arch:same packages that they are unpacked in lock step even in immediate configuration (Closes: #618288) + + [ Michael Vogt ] + * methods/mirror.cc: + - ignore lines starting with "#" in the mirror file + - ignore non http urls in the mirrors -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index 2cf5c9ce1..8a7228def 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -274,8 +274,18 @@ bool MirrorMethod::InitMirrors() while (!in.eof()) { getline(in, s); - if (s.size() > 0) - AllMirrors.push_back(s); + + // ignore lines that start with # + if (s.find("#") == 0) + continue; + // ignore empty lines + if (s.size() == 0) + continue; + // ignore non http lines + if (s.find("http://") != 0) + continue; + + AllMirrors.push_back(s); } Mirror = AllMirrors[0]; UsedMirror = Mirror; -- cgit v1.2.3 From 6885f3def825a5a0be6bb1715c800fada22f9b73 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Jun 2011 13:21:47 +0200 Subject: append the dist (e.g. sid, wheezy) as a query string when asking for a suitable mirror --- debian/changelog | 2 ++ methods/mirror.cc | 5 +++++ methods/mirror.h | 1 + 3 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9fbcf0ad6..dc653a090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -78,6 +78,8 @@ apt (0.8.15) UNRELEASED; urgency=low * methods/mirror.cc: - ignore lines starting with "#" in the mirror file - ignore non http urls in the mirrors + - append the dist (e.g. sid, wheezy) as a query string when + asking for a suitable mirror -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index 8a7228def..713dc211a 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -134,6 +134,10 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); + // append the dist as a query string + if (Dist != "") + fetch += "?dist=" + Dist; + if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" << " to " << MirrorFile << endl; @@ -339,6 +343,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str) if(Debug) std::cerr << "found BaseURI: " << uristr << std::endl; BaseUri = uristr.substr(0,uristr.size()-1); + Dist = (*I)->GetDist(); } } // get new file diff --git a/methods/mirror.h b/methods/mirror.h index bd807e122..97d18144a 100644 --- a/methods/mirror.h +++ b/methods/mirror.h @@ -29,6 +29,7 @@ class MirrorMethod : public HttpMethod vector AllMirrors; // all available mirrors string MirrorFile; // the file that contains the list of mirrors bool DownloadedMirrorFile; // already downloaded this session + string Dist; // the target distrubtion (e.g. sid, oneiric) bool Debug; -- cgit v1.2.3 From 85c26e8c9a04e98d1b5dc330d18429f628f230d4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Jun 2011 11:51:45 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - include all known languages when building the apt cache (LP: #794907) --- apt-pkg/deb/deblistparser.cc | 2 +- debian/changelog | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b59ae8896..ff6de2d9f 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -201,7 +201,7 @@ string debListParser::DescriptionLanguage() if (Section.FindS("Description").empty() == false) return ""; - std::vector const lang = APT::Configuration::getLanguages(); + std::vector const lang = APT::Configuration::getLanguages(true); for (std::vector::const_iterator l = lang.begin(); l != lang.end(); l++) if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false) diff --git a/debian/changelog b/debian/changelog index dc653a090..d75e2fb9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -80,6 +80,9 @@ apt (0.8.15) UNRELEASED; urgency=low - ignore non http urls in the mirrors - append the dist (e.g. sid, wheezy) as a query string when asking for a suitable mirror + * apt-pkg/deb/deblistparser.cc: + - include all known languages when building the apt cache + (LP: #794907) -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 -- cgit v1.2.3 From 64c2bdc9cfa77d05143aec6d744a3b65b4bb6cd7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Jun 2011 13:24:36 +0200 Subject: apt-pkg/deb/debindexfile.cc: remove tests for TranslationsAvailable() as this will break adding translations to the cache if the current environment does not include the language (e.g. LANG=C but german translations). testing for existance of the file is the better approach --- apt-pkg/deb/debindexfile.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 1e8c04033..1d828c144 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -468,9 +468,6 @@ string debTranslationsIndex::Info(const char *Type) const /*}}}*/ bool debTranslationsIndex::HasPackages() const /*{{{*/ { - if(!TranslationsAvailable()) - return false; - return FileExists(IndexFile(Language)); } /*}}}*/ @@ -510,7 +507,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { // Check the translation file, if in use string TranslationFile = IndexFile(Language); - if (TranslationsAvailable() && FileExists(TranslationFile)) + if (FileExists(TranslationFile)) { FileFd Trans(TranslationFile,FileFd::ReadOnlyGzip); debListParser TransParser(&Trans); -- cgit v1.2.3 From e4d30d3fdc11a5af7fb04b5f6bb65e5f47f76810 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Jun 2011 13:30:08 +0200 Subject: apt-pkg/deb/debindexfile.cc: kill off another TranslationsAvailable() usage that is not needed --- apt-pkg/deb/debindexfile.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 1d828c144..c9e7f1176 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -423,12 +423,10 @@ string debTranslationsIndex::IndexURI(const char *Type) const /* */ bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const { - if (TranslationsAvailable()) { - string const TranslationFile = string("Translation-").append(Language); - new pkgAcqIndexTrans(Owner, IndexURI(Language), - Info(TranslationFile.c_str()), - TranslationFile); - } + string const TranslationFile = string("Translation-").append(Language); + new pkgAcqIndexTrans(Owner, IndexURI(Language), + Info(TranslationFile.c_str()), + TranslationFile); return true; } -- cgit v1.2.3 From 21c1da10a011a341b0bb14904999442e64bb7584 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 9 Jun 2011 14:02:03 +0200 Subject: update changelog for the previous two commits --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index d75e2fb9d..2c296b597 100644 --- a/debian/changelog +++ b/debian/changelog @@ -83,6 +83,8 @@ apt (0.8.15) UNRELEASED; urgency=low * apt-pkg/deb/deblistparser.cc: - include all known languages when building the apt cache (LP: #794907) + * apt-pkg/deb/debindexfile.cc: + - remove some no longer valid checks for "TranslationsAvailable()" -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 -- cgit v1.2.3 From 9c76a88155c346666325339c5581a528d70b1f69 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Jun 2011 10:46:41 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - set permissions of term.log to root.adm and 644 (LP: #404724) --- apt-pkg/deb/dpkgpm.cc | 10 +++++++++- debian/changelog | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b37980b7e..ca544e778 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -667,7 +669,13 @@ bool pkgDPkgPM::OpenLog() return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str()); setvbuf(term_out, NULL, _IONBF, 0); SetCloseExec(fileno(term_out), true); - chmod(logfile_name.c_str(), 0600); + struct passwd *pw; + struct group *gr; + pw = getpwnam("root"); + gr = getgrnam("adm"); + if (pw != NULL && gr != NULL) + chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid); + chmod(logfile_name.c_str(), 0644); fprintf(term_out, "\nLog started: %s\n", timestr); } diff --git a/debian/changelog b/debian/changelog index 2c296b597..16c0990d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -86,6 +86,10 @@ apt (0.8.15) UNRELEASED; urgency=low * apt-pkg/deb/debindexfile.cc: - remove some no longer valid checks for "TranslationsAvailable()" + [ Kenneth Solbø Andersen ] + * apt-pkg/deb/dpkgpm.cc: + - set permissions of term.log to root.adm and 644 (LP: #404724) + -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 apt (0.8.14.1) unstable; urgency=low -- cgit v1.2.3