]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/policy.cc
* apt-pkg/contrib/strutl.cc:
[apt.git] / apt-pkg / policy.cc
index 6a5130d485aace66d6e84016f666fac3036abf4b..b47dab90c65e20f0b95696db17c5cbef779c7095 100644 (file)
@@ -23,6 +23,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include<config.h>
+
 #include <apt-pkg/policy.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 
-#include <apti18n.h>
-
 #include <iostream>
 #include <sstream>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
 using namespace std;
@@ -64,7 +66,8 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
       {
         if ((F->Archive != 0 && vm.ExpressionMatches(DefRel, F.Archive()) == true) ||
             (F->Codename != 0 && vm.ExpressionMatches(DefRel, F.Codename()) == true) ||
-            (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true))
+            (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true) ||
+            (DefRel.length() > 2 && DefRel[1] == '='))
            found = true;
       }
       if (found == false)
@@ -319,6 +322,10 @@ signed short pkgPolicy::GetPriority(pkgCache::PkgIterator const &Pkg)
    }
    
    return 0;
+}
+signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File)
+{
+   return PFPriority[File->ID];
 }
                                                                        /*}}}*/
 // PreferenceSection class - Overriding the default TrimRecord method  /*{{{*/