~jibel/synaptic/bug.250359.31396

« back to all changes in this revision

Viewing changes to common/rpackagestatus.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-09-22 17:49:45 UTC
  • Revision ID: james.westby@ubuntu.com-20090922174945-3hs06w6ihzeno8pu
Tags: 0.62.7ubuntu4
* common/sections_trans.cc:
  - fix typo in gnu-r section description
* po/fr.po:
  - updated, thanks to Stéphane Blondon, closes: #543981
* po/sl.po:
  - updated, thanks to Matej Urbančič
* take the "Origin" field from the release file into account
  when looking for supported packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
 
65
65
 
66
66
   // check for unsupported stuff
67
 
   if(_config->FindB("Synaptic::mark-unsupported",true)) {
68
 
      string s, labels, components;
 
67
   if(_config->FindB("Synaptic::mark-unsupported", true)) {
 
68
      string s, labels, origin, components;
69
69
      markUnsupported = true;
70
70
 
71
71
      // read supported labels
75
75
         sst1 >> s;
76
76
         supportedLabels.push_back(s);
77
77
      }
 
78
 
 
79
      // read supported origins
 
80
      origin = _config->Find("Synaptic::supported-origins", "Debian");
 
81
      stringstream sst2(origin);
 
82
      while(!sst2.eof()) {
 
83
         sst2 >> s;
 
84
         supportedOrigins.push_back(s);
 
85
      }
78
86
      
79
87
      // read supported components
80
88
      components = _config->Find("Synaptic::supported-components", "main updates/main");
81
 
      stringstream sst2(components);
82
 
      while(!sst2.eof()) {
83
 
         sst2 >> s;
 
89
      stringstream sst3(components);
 
90
      while(!sst3.eof()) {
 
91
         sst3 >> s;
84
92
         supportedComponents.push_back(s);
85
93
      }
86
94
   } 
99
107
   bool res = true;
100
108
 
101
109
   if(markUnsupported) {
102
 
      bool sc, sl;
 
110
      bool sc, sl, so;
103
111
 
104
 
      sc=sl=false;
 
112
      sc=sl=so=false;
105
113
 
106
114
      string component = pkg->component();
107
115
      string label = pkg->label();
 
116
      string origin = pkg->origin();
108
117
 
109
118
      for(unsigned int i=0;i<supportedComponents.size();i++) {
110
119
         if(supportedComponents[i] == component) {
118
127
            break;
119
128
         }
120
129
      }
121
 
      res = (sc & sl & pkg->isTrusted());
 
130
      for(unsigned int i=0;i<supportedOrigins.size();i++) {
 
131
         if(supportedOrigins[i] == origin) {
 
132
            so = true;
 
133
            break;
 
134
         }
 
135
      }
 
136
 
 
137
      res = (sc & sl & so & pkg->isTrusted());
122
138
   }
123
139
 
124
140
   return res;