summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/debindexfile.cc15
-rw-r--r--apt-pkg/deb/deblistparser.cc2
-rw-r--r--apt-pkg/deb/dpkgpm.cc10
-rw-r--r--debian/changelog16
-rw-r--r--methods/mirror.cc19
-rw-r--r--methods/mirror.h1
6 files changed, 49 insertions, 14 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index 1e8c04033..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;
}
@@ -468,9 +466,6 @@ string debTranslationsIndex::Info(const char *Type) const
/*}}}*/
bool debTranslationsIndex::HasPackages() const /*{{{*/
{
- if(!TranslationsAvailable())
- return false;
-
return FileExists(IndexFile(Language));
}
/*}}}*/
@@ -510,7 +505,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);
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 4a9e94c85..9ae1065a4 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<string> const lang = APT::Configuration::getLanguages();
+ std::vector<string> const lang = APT::Configuration::getLanguages(true);
for (std::vector<string>::const_iterator l = lang.begin();
l != lang.end(); l++)
if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 5ddcd47e9..5fbd1801a 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -32,6 +32,8 @@
#include <algorithm>
#include <sstream>
#include <map>
+#include <pwd.h>
+#include <grp.h>
#include <termios.h>
#include <unistd.h>
@@ -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 c8a4f4477..6ba17d067 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -86,6 +86,22 @@ apt (0.8.14.2) UNRELEASED; urgency=low
- ensure that an old version of a package with a provides can
never satisfy a dependency of a newer version of this package
+ [ Michael Vogt ]
+ * 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
+ * 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()"
+
+ [ Kenneth Solbø Andersen ]
+ * apt-pkg/deb/dpkgpm.cc:
+ - set permissions of term.log to root.adm and 644 (LP: #404724)
+
-- David Kalnischkies <kalnischkies@gmail.com> Sat, 28 May 2011 10:54:23 +0200
apt (0.8.14.1) unstable; urgency=low
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 2cf5c9ce1..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;
@@ -274,8 +278,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;
@@ -329,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<string> 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;