]> git.saurik.com Git - apt.git/commitdiff
merged from lp:~donkult/apt/sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:37:04 +0000 (10:37 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:37:04 +0000 (10:37 +0200)
13 files changed:
apt-pkg/aptconfiguration.cc
apt-pkg/cacheset.cc
apt-pkg/cacheset.h
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/sha2_internal.cc
apt-pkg/deb/deblistparser.cc
apt-pkg/packagemanager.cc
debian/changelog
methods/http.cc
test/integration/framework
test/integration/test-bug-593360-modifiers-in-names
test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first
test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering [new file with mode: 0755]

index d72b0c5aed2b0a6f2860aceb8c28564e1ea13447..f0cd8ebc088502ea0b33fc08fbb76205b978205d 100644 (file)
@@ -47,6 +47,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
        _config->CndSet("Acquire::CompressionTypes::gz","gzip");
 
        setDefaultConfigurationForCompressors();
+       std::vector<APT::Configuration::Compressor> const compressors = getCompressors();
 
        // accept non-list order as override setting for config settings on commandline
        std::string const overrideOrder = _config->Find("Acquire::CompressionTypes::Order","");
@@ -63,12 +64,12 @@ const Configuration::getCompressionTypes(bool const &Cached) {
                if (_config->Exists(std::string("Acquire::CompressionTypes::").append(*o)) == false)
                        continue;
                // ignore types we have no app ready to use
-               std::string const appsetting = std::string("Dir::Bin::").append(*o);
-               if (_config->Exists(appsetting) == true) {
-                       std::string const app = _config->FindFile(appsetting.c_str(), "");
-                       if (app.empty() == false && FileExists(app) == false)
-                               continue;
-               }
+               std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin();
+               for (; c != compressors.end(); ++c)
+                       if (c->Name == *o)
+                               break;
+               if (c == compressors.end())
+                       continue;
                types.push_back(*o);
        }
 
@@ -84,12 +85,12 @@ const Configuration::getCompressionTypes(bool const &Cached) {
                if (std::find(types.begin(),types.end(),Types->Tag) != types.end())
                        continue;
                // ignore types we have no app ready to use
-               std::string const appsetting = std::string("Dir::Bin::").append(Types->Value);
-               if (appsetting.empty() == false && _config->Exists(appsetting) == true) {
-                       std::string const app = _config->FindFile(appsetting.c_str(), "");
-                       if (app.empty() == false && FileExists(app) == false)
-                               continue;
-               }
+               std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin();
+               for (; c != compressors.end(); ++c)
+                       if (c->Name == Types->Value)
+                               break;
+               if (c == compressors.end())
+                       continue;
                types.push_back(Types->Tag);
        }
 
index b892ab4bfd9a69964c3c0762d63c4e187347f7d2..e2dbe0e5776e28259c006d3fc893c566cba36acc 100644 (file)
@@ -217,6 +217,7 @@ bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, P
                                                        pkgCacheFile &Cache, const char * cmdline,
                                                        std::list<Modifier> const &mods, CacheSetHelper &helper) {
        std::string str = cmdline;
+       unsigned short fallback = modID;
        bool modifierPresent = false;
        for (std::list<Modifier>::const_iterator mod = mods.begin();
             mod != mods.end(); ++mod) {
@@ -243,6 +244,7 @@ bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, P
                helper.showErrors(errors);
                if (Pkg.end() == false) {
                        pci->insert(Pkg);
+                       modID = fallback;
                        return true;
                }
        }
@@ -281,13 +283,14 @@ bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID,
                modifierPresent = true;
                break;
        }
-
        if (modifierPresent == true) {
                bool const errors = helper.showErrors(false);
                bool const found = VersionContainerInterface::FromString(vci, Cache, cmdline, select, helper, true);
                helper.showErrors(errors);
-               if (found == true)
+               if (found == true) {
+                       modID = fallback;
                        return true;
+               }
        }
        return FromString(vci, Cache, str, select, helper);
 }
index 6f0a0e3584dc318f8520b81051a8b6de9c9bd058..5b9900603986c758231c469f5857c3b76a6655c1 100644 (file)
@@ -186,7 +186,7 @@ public:                                                                     /*{{{*/
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
                operator typename Container::iterator(void) const { return _iter; }
-               operator typename PackageContainer<Container>::const_iterator() { return PackageContainer<Container>::const_iterator(_iter); }
+               operator typename PackageContainer<Container>::const_iterator() { return typename PackageContainer<Container>::const_iterator(_iter); }
                inline iterator& operator++() { ++_iter; return *this; }
                inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
@@ -506,7 +506,7 @@ public:                                                                     /*{{{*/
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; };
                operator typename Container::iterator(void) const { return _iter; }
-               operator typename VersionContainer<Container>::const_iterator() { return VersionContainer<Container>::const_iterator(_iter); }
+               operator typename VersionContainer<Container>::const_iterator() { return typename VersionContainer<Container>::const_iterator(_iter); }
                inline iterator& operator++() { ++_iter; return *this; }
                inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
index 9e3611b2663ccb17d8b8abfd637f22e2c91150f5..e9d1ba1ce0af72b0274935573fc084961c135915 100644 (file)
@@ -1098,6 +1098,12 @@ bool FileFd::OpenInternDescriptor(unsigned int const Mode, APT::Configuration::C
            dup2(d->compressed_fd,STDIN_FILENO);
         dup2(Pipe[1],STDOUT_FILENO);
       }
+      int const nullfd = open("/dev/null", O_WRONLY);
+      if (nullfd != -1)
+      {
+        dup2(nullfd,STDERR_FILENO);
+        close(nullfd);
+      }
 
       SetCloseExec(STDOUT_FILENO,false);
       SetCloseExec(STDIN_FILENO,false);
index 6d27e8f2b834e972a3d46a62845b9df6ddb228b0..83b5a98d3952391fbba89fcaa8cb9420d1cc05c8 100644 (file)
@@ -552,7 +552,9 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
        }
        while (len >= SHA256_BLOCK_LENGTH) {
                /* Process as many complete blocks as we can */
-               SHA256_Transform(context, (sha2_word32*)data);
+               sha2_byte buffer[SHA256_BLOCK_LENGTH];
+               MEMCPY_BCOPY(buffer, data, SHA256_BLOCK_LENGTH);
+               SHA256_Transform(context, (sha2_word32*)buffer);
                context->bitcount += SHA256_BLOCK_LENGTH << 3;
                len -= SHA256_BLOCK_LENGTH;
                data += SHA256_BLOCK_LENGTH;
@@ -879,7 +881,9 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
        }
        while (len >= SHA512_BLOCK_LENGTH) {
                /* Process as many complete blocks as we can */
-               SHA512_Transform(context, (sha2_word64*)data);
+               sha2_byte buffer[SHA512_BLOCK_LENGTH];
+               MEMCPY_BCOPY(buffer, data, SHA512_BLOCK_LENGTH);
+               SHA512_Transform(context, (sha2_word64*)buffer);
                ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3);
                len -= SHA512_BLOCK_LENGTH;
                data += SHA512_BLOCK_LENGTH;
index 84e6c38c5440c90db4375da3e67ea740a7feb987..00e2bd900db73644c91ac76bcdc3612496ab9151 100644 (file)
@@ -249,8 +249,14 @@ bool debListParser::UsePackage(pkgCache::PkgIterator &Pkg,
       return false;
 
    if (strcmp(Pkg.Name(),"apt") == 0)
-      Pkg->Flags |= pkgCache::Flag::Essential | pkgCache::Flag::Important;
-   
+   {
+      if ((essential == "native" && Pkg->Arch != 0 && myArch == Pkg.Arch()) ||
+         essential == "all")
+        Pkg->Flags |= pkgCache::Flag::Essential | pkgCache::Flag::Important;
+      else
+        Pkg->Flags |= pkgCache::Flag::Important;
+   }
+
    if (ParseStatus(Pkg,Ver) == false)
       return false;
    return true;
index 093999bc243e66da1727838bfaf25a46f31f4200..b56619ef53c33abd2107c8c9bb311050851d610b 100644 (file)
@@ -621,7 +621,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
            // Look for easy targets: packages that are already okay
            for (DepIterator Cur = Start; Bad == true; ++Cur)
            {
-              SPtrArray<Version *> VList = Start.AllTargets();
+              SPtrArray<Version *> VList = Cur.AllTargets();
               for (Version **I = VList; *I != 0; ++I)
               {
                  VerIterator Ver(Cache,*I);
@@ -644,7 +644,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
            // Look for something that could be configured.
            for (DepIterator Cur = Start; Bad == true; ++Cur)
            {
-              SPtrArray<Version *> VList = Start.AllTargets();
+              SPtrArray<Version *> VList = Cur.AllTargets();
               for (Version **I = VList; *I != 0; ++I)
               {
                  VerIterator Ver(Cache,*I);
index f401f312c9d0f39cc450a4c009bf0a0a62bbeeac..2f5a3dc5c34b7d0dea2b5e96be773a11c6afb1ec 100644 (file)
@@ -6,6 +6,22 @@ apt (0.9.2) UNRELEASED; urgency=low
       that the pipe is closed when InFd is closed. This fixes a Fd leak
       (LP: #985452)
 
+  [ David Kalnischkies ]
+   * apt-pkg/deb/deblistparser.cc:
+    - only treat the native apt as essential by default (Closes: #669377)
+  * apt-pkg/contrib/fileutl.cc:
+    - redirect stderr from compressors to /dev/null
+  * apt-pkg/aptconfiguration.cc:
+    - if the compressor is not installed, but we link against it's
+      library accept it as a CompressionType (Closes: #669328)
+  * apt-pkg/contrib/sha2_internal.cc:
+    - do not use the input data directly but memcpy it instead as
+      it could be unaligned as in the http-transport which causes
+      a sigbus error on sparc (Closes: #669061)
+  * apt-pkg/cacheset.cc:
+    - actually return to the fallback modifier if we have detected we
+      should for packagenames which look like modifiers (Closes: #669591)
+
   [ Adam Conrad ]
   * Set FD_CLOEXEC on history.log's FD (Closes: #610069, LP: #636010)
 
@@ -13,7 +29,12 @@ apt (0.9.2) UNRELEASED; urgency=low
   * apt-pkg/deb/dpkgpm.cc:
     - do not crash if (*I).Pkg is NULL (LP: #939867)
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 20 Apr 2012 09:13:19 +0200
+  [ Malcolm Scott ]
+  * apt-pkg/packagemanager.cc:
+    - iterate over all pre-depends or-group member instead of looping
+      endlessly over the first member in SmartUnpack (LP: #985852)
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 20 Apr 2012 10:11:24 +0200
 
 apt (0.9.1) unstable; urgency=low
 
index c62ca71d38e51a0569d244ec39b983e6b6cc4965..b450b6ffcb71a8dab04e3387be5c72bb987c5f50 100644 (file)
@@ -602,7 +602,7 @@ bool ServerState::HeaderLine(string Line)
         return true;
 
       Size = strtoull(Val.c_str(), NULL, 10);
-      if (Size == ULLONG_MAX)
+      if (Size >= std::numeric_limits<unsigned long long>::max())
         return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header"));
       return true;
    }
index 0670d6a7818963e7298f723bb5fabbb4e7cacb52..b80b02922507f2bbbb9cf2524e2472d4b3227d0f 100644 (file)
@@ -151,7 +151,7 @@ setupenvironment() {
        echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf
        echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf
        echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf
-       if ! $(which dpkg) --assert-multi-arch; then
+       if ! $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then
                echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it…
        fi
        echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
@@ -199,7 +199,7 @@ configdpkg() {
                        echo -n > rootdir/var/lib/dpkg/status
                fi
        fi
-       if $(which dpkg) --assert-multi-arch; then
+       if $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then
                local ARCHS="$(getarchitectures)"
                if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then
                        DPKGARCH="$(dpkg --print-architecture)"
index 83a3cfabfdc7699731c18c7f19a2eaeb4373808a..74826cbdba8a47b68ae49aa5d68abb1597b7782a 100755 (executable)
@@ -15,6 +15,11 @@ The following NEW packages will be installed:
 Inst g++ (4:4.4.5-1 localhost [i386])
 Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g++ -s
 
+testequal "Reading package lists...
+Building dependency tree...
+Package 'g++' is not installed, so not removed
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove g++ -s
+
 testequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed:
index a9a4069cf726c47771ebf390d038b08eecf5406d..269038d0feb889b89bf15de931801b0243de68fb 100755 (executable)
@@ -14,7 +14,7 @@ insertpackage 'unstable' 'apt' 'i386' '2' 'Depends: libsame (= 2)'
 
 setupaptarchive
 
-testequal 'Reading package lists...
+testequalor2 'Reading package lists...
 Building dependency tree...
 The following extra packages will be installed:
   apt:i386 libsame:i386
@@ -28,4 +28,18 @@ Inst libsame (2 unstable [amd64]) [apt:i386 ]
 Conf libsame:i386 (2 unstable [i386]) [apt:i386 ]
 Conf libsame (2 unstable [amd64]) [apt:i386 ]
 Inst apt:i386 [1] (2 unstable [i386])
+Conf apt:i386 (2 unstable [i386])' 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  apt:i386 libsame:i386
+The following NEW packages will be installed:
+  libsame
+The following packages will be upgraded:
+  apt:i386 libsame:i386
+2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst apt:i386 [1] (2 unstable [i386]) []
+Inst libsame:i386 [1] (2 unstable [i386])
+Inst libsame (2 unstable [amd64])
+Conf libsame:i386 (2 unstable [i386])
+Conf libsame (2 unstable [amd64])
 Conf apt:i386 (2 unstable [i386])' aptget install libsame:amd64 -s
diff --git a/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering b/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering
new file mode 100755 (executable)
index 0000000..462acad
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'custom' 'amd64' '1.0' 'Pre-Depends: grub-pc | grub'
+insertinstalledpackage 'grub' 'amd64' '1.0'
+insertpackage 'unstable' 'custom' 'amd64' '2.0' 'Pre-Depends: grub-pc | grub'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+  custom
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst custom [1.0] (2.0 unstable [amd64])
+Conf custom (2.0 unstable [amd64])' aptget dist-upgrade -s