]> git.saurik.com Git - apt.git/commitdiff
merged from lp:~mvo/apt/mvo
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 28 Jun 2011 14:51:33 +0000 (15:51 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 28 Jun 2011 14:51:33 +0000 (15:51 +0100)
apt-pkg/deb/debindexfile.cc
apt-pkg/deb/deblistparser.cc
apt-pkg/deb/dpkgpm.cc
debian/changelog
methods/mirror.cc
methods/mirror.h

index 1e8c040333b028def25e8330b484ab4cb15ac035..c9e7f11767f295c48937759ccebaad49f4abc5bd 100644 (file)
@@ -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);
index 4a9e94c855a2d8a24303f50e0f4005eabc2e1eb7..9ae1065a4047f72bb57b213b833a7b482b6e9b94 100644 (file)
@@ -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)
index 5ddcd47e99d908f0a8374e17f6e49124d9fecba6..5fbd1801a4de8b34ef0a7b3483694437dbca67f1 100644 (file)
@@ -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);
    }
 
index c8a4f44770788a8b65fe773a92cce76bcf0aefdc..6ba17d067b6bfe03c5044e60e808dc67e0befd26 100644 (file)
@@ -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
index 2cf5c9ce1110a9d7f9b259cf9913451b89126d94..713dc211a1c8ecd103502ad4f419645749126c1c 100644 (file)
@@ -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
index bd807e1227c0f84b4bf92bf24753337541f2d88b..97d18144a49bfbc64440941c58fc6f3b6ea54344 100644 (file)
@@ -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;