~brian-murray/ubuntu/oneiric/apt/block-fsys-tarfile

« back to all changes in this revision

Viewing changes to apt-pkg/policy.cc

  • Committer: Michael Vogt
  • Date: 2011-06-28 21:41:29 UTC
  • mfrom: (1327.97.34 debian-sid)
  • Revision ID: michael.vogt@ubuntu.com-20110628214129-tait7qp81nvm7wjv
mergedĀ fromĀ debian-sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
   // Allow pinning by wildcards
221
221
   // TODO: Maybe we should always prefer specific pins over non-
222
222
   // specific ones.
223
 
   if (Name.find("*") != string::npos || Name.find("[") != string::npos
224
 
       || Name.find("?") != string::npos || Name[0] == '/') {
225
 
          pkgVersionMatch match(Data, Type);
226
 
          for (pkgCache::PkgIterator P = Cache->PkgBegin();
227
 
               P != Cache->PkgEnd(); P++) {
228
 
                  if (match.ExpressionMatches(Name, P.Name())) {
229
 
                        CreatePin(Type, P.Name(), Data, Priority);
230
 
                  }  
231
 
      }
 
223
   if (Name[0] == '/' || Name.find_first_of("*[?") != string::npos)
 
224
   {
 
225
      pkgVersionMatch match(Data, Type);
 
226
      for (pkgCache::GrpIterator G = Cache->GrpBegin(); G.end() != true; ++G)
 
227
         if (match.ExpressionMatches(Name, G.Name()))
 
228
            CreatePin(Type, G.Name(), Data, Priority);
232
229
      return;
233
230
   }
234
231
 
235
232
   // Get a spot to put the pin
236
233
   pkgCache::GrpIterator Grp = Cache->FindGrp(Name);
237
 
   for (pkgCache::PkgIterator Pkg = Grp.FindPkg("any");
 
234
   for (pkgCache::PkgIterator Pkg = Grp.PackageList();
238
235
        Pkg.end() != true; Pkg = Grp.NextPkg(Pkg))
239
236
   {
240
237
      Pin *P = 0;