]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-output.cc
extract travis installs from build-depends automatically
[apt.git] / apt-private / private-output.cc
index 52f65d7941e20238541a42d936990b85b9f16a12..757999167fc280492154980b8d45c58f82950293 100644 (file)
@@ -7,16 +7,22 @@
 #include <apt-pkg/cachefile.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/policy.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
+#include <apt-private/private-output.h>
+#include <apt-private/private-cachefile.h>
+
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <iomanip>
 #include <iostream>
-#include <locale.h>
 #include <langinfo.h>
 #include <unistd.h>
 
-#include "private-output.h"
-#include "private-cachefile.h"
-
 #include <apti18n.h>
                                                                        /*}}}*/
 
@@ -140,6 +146,10 @@ static std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterato
    pkgCache::VerIterator inst = P.CurrentVer();
    pkgCache::VerIterator cand = policy->GetCandidateVer(P);
 
+   // this may happen for packages in dpkg "deinstall ok config-file" state
+   if (inst.IsGood() == false && cand.IsGood() == false)
+      return P.VersionList().Arch();
+
    return inst ? inst.Arch() : cand.Arch();
 }
                                                                        /*}}}*/