~ubuntu-branches/ubuntu/saucy/synaptic/saucy

« back to all changes in this revision

Viewing changes to common/rpackagefilter.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-07-12 21:14:23 UTC
  • Revision ID: package-import@ubuntu.com-20120712211423-9yk5gfpob1r5dgd5
Tags: 0.75.13
* debian/synaptic.menu:
  - use x-terminal-emulator -e synaptic-pkexec to support systems
    that do not have a GUI policykit agent running (closes: #678847)
* include all origins in the origin filter not just the first one
* show all "archives" in the origins view even if they are "shadowed"
  by another one

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
bool RPatternPackageFilter::filterOrigin(Pattern pat, RPackage *pkg)
293
293
{
294
294
   bool found = false;
295
 
   string origin;
296
 
   origin = pkg->getCandidateOriginSiteUrl();
 
295
   vector<string>origins = pkg->getCandidateOriginSiteUrls();
297
296
 
298
297
   if (pat.regexps.size() == 0) {
299
298
      return true;
300
299
   }
301
300
   
302
 
   if(regexec(pat.regexps[0],origin.c_str(), 0, NULL, 0) == 0) {
303
 
      found = true;
304
 
   } 
 
301
   for (vector<string>::iterator it = origins.begin();
 
302
        it != origins.end();
 
303
        ++it)
 
304
   {
 
305
      if(regexec(pat.regexps[0],(*it).c_str(), 0, NULL, 0) == 0) {
 
306
         found = true;
 
307
      }
 
308
   }
305
309
 
306
310
   return found;
307
311
}
330
334
   bool globalfound = and_mode;
331
335
   bool useregexp = _config->FindB("Synaptic::UseRegexp", false);
332
336
 
 
337
   bool debug = _config->FindB("Debug::Synaptic::Filters", "false");
 
338
 
333
339
   if (_patterns.size() == 0)
334
340
      return true;
335
341
 
381
387
         cerr << "unknown pattern package filter (shouldn't happen) " << endl;
382
388
      }
383
389
 
 
390
      if (found && debug)
 
391
         clog << "RPatternPackageFilter::filter match for "
 
392
              << pkg->name() << endl;
 
393
 
384
394
      // each filter is applied in AND fasion
385
395
      // that means a include depends "mono" and include name "sharp"
386
396
      // results in all packages that depends on "mono" AND have sharp in name