]> git.saurik.com Git - apt.git/commitdiff
merge with debian-experimental-ma
authorDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 5 Jul 2010 10:06:45 +0000 (12:06 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 5 Jul 2010 10:06:45 +0000 (12:06 +0200)
1  2 
apt-pkg/contrib/fileutl.cc
apt-pkg/deb/deblistparser.cc
debian/changelog
debian/control

index e95ddf56256143ff8264d44a504ba28ad9d11099,0b62d1bd836de1059040c81454490d20728d7318..62d42e4da8abe8e84a6706273e13a9da6fac22df
@@@ -27,6 -27,7 +27,7 @@@
  
  #include <cstdlib>
  #include <cstring>
+ #include <cstdio>
  
  #include <iostream>
  #include <unistd.h>
@@@ -281,7 -282,6 +282,7 @@@ std::vector<string> GetListOfFilesInDir
     }
  
     std::vector<string> List;
 +   Configuration::MatchAgainstConfig SilentIgnore("Dir::Ignore-Files-Silently");
     DIR *D = opendir(Dir.c_str());
     if (D == 0) 
     {
            {
               if (Debug == true)
                  std::clog << "Bad file: " << Ent->d_name << " → no extension" << std::endl;
 +             _error->Notice("Ignoring file '%s' in directory '%s' as it has no filename extension", Ent->d_name, Dir.c_str());
               continue;
            }
         }
         {
            if (Debug == true)
               std::clog << "Bad file: " << Ent->d_name << " → bad extension »" << flExtension(Ent->d_name) << "«" << std::endl;
 +          if (SilentIgnore.Match(Ent->d_name) == false)
 +             _error->Notice("Ignoring file '%s' in directory '%s' as it has an invalid filename extension", Ent->d_name, Dir.c_str());
            continue;
         }
        }
@@@ -658,10 -655,11 +659,11 @@@ bool FileFd::Open(string FileName,OpenM
        
        case WriteEmpty:
        {
-        struct stat Buf;
-        if (lstat(FileName.c_str(),&Buf) == 0 && S_ISLNK(Buf.st_mode))
-           unlink(FileName.c_str());
-        iFd = open(FileName.c_str(),O_RDWR | O_CREAT | O_TRUNC,Perms);
+        Flags |= Replace;
+        char *name = strdup((FileName + ".XXXXXX").c_str());
+        TemporaryFileName = string(mktemp(name));
+        iFd = open(TemporaryFileName.c_str(),O_RDWR | O_CREAT | O_EXCL,Perms);
+        free(name);
         break;
        }
        
@@@ -843,11 -841,19 +845,19 @@@ bool FileFd::Close(
        if (iFd >= 0 && close(iFd) != 0)
         Res &= _error->Errno("close",_("Problem closing the file"));
     iFd = -1;
-    
+    if ((Flags & Replace) == Replace) {
+       if (rename(TemporaryFileName.c_str(), FileName.c_str()) != 0)
+        Res &= _error->Errno("rename",_("Problem renaming the file"));
+       FileName = TemporaryFileName; // for the unlink() below.
+    }
+           
     if ((Flags & Fail) == Fail && (Flags & DelOnFail) == DelOnFail &&
         FileName.empty() == false)
        if (unlink(FileName.c_str()) != 0)
         Res &= _error->WarningE("unlnk",_("Problem unlinking the file"));
     return Res;
  }
                                                                        /*}}}*/
index d1931f90926b4e151308a12477978a19ff6d7da3,6ede14c4db8ba308a8b80ef0716cc33c65395fea..24df57a5c2d9de4b431697efff74e2ea39d00cac
@@@ -19,6 -19,7 +19,7 @@@
  #include <apt-pkg/md5.h>
  #include <apt-pkg/macros.h>
  
+ #include <fnmatch.h>
  #include <ctype.h>
                                                                        /*}}}*/
  
@@@ -38,8 -39,6 +39,8 @@@ debListParser::debListParser(FileFd *Fi
                                Arch(Arch) {
     if (Arch == "native")
        this->Arch = _config->Find("APT::Architecture");
 +   Architectures = APT::Configuration::getArchitectures();
 +   MultiArchEnabled = Architectures.size() > 1;
  }
                                                                        /*}}}*/
  // ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
@@@ -157,9 -156,10 +158,9 @@@ bool debListParser::NewVersion(pkgCache
         to a NOP in the download/install step - this package will ensure that
         it is downloaded only one time and installed only one time -- even if
         the architecture bound versions coming in and out on regular basis. */
 -      bool const static multiArch = APT::Configuration::getArchitectures().size() > 1;
        if (strcmp(Ver.Arch(true),"all") == 0)
         return true;
 -      else if (multiArch == true)
 +      else if (MultiArchEnabled == true)
        {
         // our pseudo packages have no size to not confuse the fetcher
         Ver->Size = 0;
@@@ -473,6 -473,20 +474,20 @@@ const char *debListParser::ConvertRelat
     return I;
  }
  
+ /*
+  * CompleteArch:
+  *
+  * The complete architecture, consisting of <kernel>-<cpu>.
+  */
+ static string CompleteArch(std::string& arch) {
+     if (arch == "armel")              return "linux-arm";
+     if (arch == "lpia")               return "linux-i386";
+     if (arch == "powerpcspe")         return "linux-powerpc";
+     if (arch == "uclibc-linux-armel") return "linux-arm";
+     if (arch == "uclinux-armel")      return "uclinux-arm";
+     return (arch.find("-") != string::npos) ? arch : "linux-" + arch;
+ }
                                                                        /*}}}*/
  // ListParser::ParseDepends - Parse a dependency element              /*{{{*/
  // ---------------------------------------------------------------------
@@@ -546,6 -560,7 +561,7 @@@ const char *debListParser::ParseDepends
     if (ParseArchFlags == true)
     {
        string arch = _config->Find("APT::Architecture");
+       string completeArch = CompleteArch(arch);
  
        // Parse an architecture
        if (I != Stop && *I == '[')
               I++;
              }
  
-           if (stringcmp(arch,I,End) == 0)
+           if (stringcmp(arch,I,End) == 0) {
               Found = true;
+           } else {
+              std::string wildcard = SubstVar(string(I, End), "any", "*");
+              if (fnmatch(wildcard.c_str(), completeArch.c_str(), 0) == 0)
+                 Found = true;
+           }
            
            if (*End++ == ']') {
               I = End;
@@@ -621,6 -641,9 +642,6 @@@ bool debListParser::ParseDepends(pkgCac
     if (Section.Find(Tag,Start,Stop) == false)
        return true;
  
 -   static std::vector<std::string> const archs = APT::Configuration::getArchitectures();
 -   static bool const multiArch = archs.size() <= 1;
 -
     string Package;
     string const pkgArch = Ver.Arch(true);
     string Version;
        if (Start == 0)
         return _error->Error("Problem parsing dependency %s",Tag);
  
 -      if (multiArch == true &&
 +      if (MultiArchEnabled == true &&
          (Type == pkgCache::Dep::Conflicts ||
           Type == pkgCache::Dep::DpkgBreaks ||
           Type == pkgCache::Dep::Replaces))
        {
 -       for (std::vector<std::string>::const_iterator a = archs.begin();
 -            a != archs.end(); ++a)
 +       for (std::vector<std::string>::const_iterator a = Architectures.begin();
 +            a != Architectures.end(); ++a)
            if (NewDepends(Ver,Package,*a,Version,Op,Type) == false)
               return false;
        }
@@@ -690,13 -713,14 +711,13 @@@ bool debListParser::ParseProvides(pkgCa
     if (Ver->MultiArch != pkgCache::Version::Foreign)
        return true;
  
 -   std::vector<string> const archs = APT::Configuration::getArchitectures();
 -   if (archs.size() <= 1)
 +   if (MultiArchEnabled == false)
        return true;
  
     string const Package = Ver.ParentPkg().Name();
     string const Version = Ver.VerStr();
 -   for (std::vector<string>::const_iterator a = archs.begin();
 -      a != archs.end(); ++a)
 +   for (std::vector<string>::const_iterator a = Architectures.begin();
 +      a != Architectures.end(); ++a)
     {
        if (NewProvides(Ver, Package, *a, Version) == false)
         return false;
@@@ -736,7 -760,7 +757,7 @@@ bool debListParser::Step(
        if (Architecture.empty() == true)
         return true;
  
 -      if (Arch.empty() == true)
 +      if (Arch.empty() == true || MultiArchEnabled == false)
        {
         if (APT::Configuration::checkArchitecture(Architecture) == true)
            return true;
diff --combined debian/changelog
index 51c75dad0d15c42cfd01ffaee3704b6e222249d1,1bf6815a56efff69740abdcd6adec6846c8ccc29..878d5238a1893a115476845203a105e76c0b9407
@@@ -1,43 -1,19 +1,58 @@@
 -apt (0.7.26~exp8) experimental; urgency=low
 +apt (0.7.26~exp8) UNRELEASED; urgency=low
  
-  -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 28 Jun 2010 22:12:24 +0200
++  [ David Kalnischkies ]
 +  * cmdline/cacheset.cc:
 +    - doesn't include it in the library for now as it is too volatile
 +    - get the candidate either from an already built depcache
 +      or use the policy which is a bit faster than depcache generation
 +    - get packages by task^ with FromTask()
 +    - only print errors if all tries to get a package by string failed
 +    - factor out code to get a single package FromName()
 +    - check in Grouped* first without modifier interpretation
 +  * cmdline/apt-get.cc:
 +    - use the cachsets in the install commands
 +    - make the specify order of packages irrelevant (Closes: #196021)
 +  * apt-pkg/orderlist.cc:
 +    - untouched packages are never missing
 +  * apt-pkg/packagemanager.cc:
 +    - packages that are not touched doesn't need to be unpacked
 +  * debian/control:
 +    - remove intltool's dependency as it is an ubuntu artefact
 +  * apt-pkg/depcache.cc:
 +    - SetCandidateVer for all pseudo packages
 +    - SetReInstall for the "all" package of a pseudo package
 +    - use the new MatchAgainstConfig for the DefaultRootSetFunc
 +    - always mark the all package if a pseudo package is marked for install
 +  * apt-pkg/contrib/error.{cc,h}:
 +    - complete rewrite but use the same API
 +    - add NOTICE and DEBUG as new types of a message
 +    - add a simple stack handling to be able to delay error handling
 +  * apt-pkg/aptconfiguration.cc:
 +    - show a deprecation notice for APT::Acquire::Translation
 +  * apt-pkg/contrib/configuration.{cc,h}:
 +    - add a wrapper to match strings against configurable regex patterns
 +  * apt-pkg/contrib/fileutl.cc:
 +    - show notice about ignored file instead of being always silent
 +    - add a Dir::Ignore-Files-Silently list option to control the notice
 +  * apt-pkg/policy.h:
 +    - add another round of const& madness as the previous round accidentally
 +      NOT overrides the virtual GetCandidateVer() method (Closes: #587725)
 +
 - -- Julian Andres Klode <jak@debian.org>  Thu, 24 Jun 2010 10:56:39 +0200
++  [ Julian Andres Klode ]
+   * methods/ftp.h:
+     - Handle different logins on the same server (Closes: #586904).
+   * apt-pkg/deb/deblistparser.cc:
+     - Handle architecture wildcards (Closes: #547724).
+   * apt-pkg/versionmatch.cc:
+     - Support matching pins by regular expressions or glob() like patterns,
+       regular expressions have to be put between to slashes; for example,
+       /.*/.
+   * apt-pkg/contrib/fileutl.cc:
+     - Make FileFd replace files atomically in WriteTemp mode (for cache, etc).
+   * debian/control:
+     - Set Standards-Version to 3.9.0
++ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 05 Jul 2010 12:05:30 +0200
  
  apt (0.7.26~exp7) experimental; urgency=low
  
diff --combined debian/control
index 4f41c130b43975a6317522cde1ac3f080a5e75a9,8bc43568fc291f7c24c532cb14e0ef978a88b5b4..d482f2d0b0bf05b60fb44cfbff1ff0cf25334f22
@@@ -5,8 -5,8 +5,8 @@@ Maintainer: APT Development Team <deity
  Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
   Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
   Luca Bruno <lethalman88@gmail.com>, Julian Andres Klode <jak@debian.org>
- Standards-Version: 3.8.4
+ Standards-Version: 3.9.0
 -Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen, intltool
 +Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev | libcurl3-gnutls-dev (>= 7.15.5), debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen
  Build-Conflicts: autoconf2.13, automake1.4
  
  Package: apt