~ubuntu-branches/ubuntu/breezy/apt/breezy

« back to all changes in this revision

Viewing changes to ftparchive/override.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2005-03-07 20:08:33 UTC
  • Revision ID: james.westby@ubuntu.com-20050307200833-0lxdgg2cb4oculdv
Tags: 0.6.35
* Merge apt--mvo--0 (incorporates 0.6.34ubuntu1):
  - Implement MaxSize and MaxAge in apt.cron.daily, to prevent the cache
    from growing too large (Ubuntu #6761)
  - some comments about the pkgAcqMetaSig::Custom600Headers() added
  - use gpg --with-colons
  - commented the ftp no_proxy unseting in methods/ftp.cc
  - added support for "Acquire::gpgv::options" in methods/gpgv.cc
* Merge bubulle@debian.org--2005/apt--main--0
  - Make capitalization more consistent
  - Un-fuzzy translations resulting from capitalization changes
  - Italian translation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- mode: cpp; mode: fold -*-
2
2
// Description                                                          /*{{{*/
3
 
// $Id: override.cc,v 1.3 2001/06/26 02:50:27 jgg Exp $
 
3
// $Id: override.cc,v 1.4 2003/02/10 07:34:41 doogie Exp $
4
4
/* ######################################################################
5
5
 
6
6
   Override
16
16
 
17
17
#include "override.h"
18
18
    
 
19
#include <apti18n.h>
19
20
#include <apt-pkg/strutl.h>
20
21
#include <apt-pkg/error.h>
21
22
 
34
35
   
35
36
   FILE *F = fopen(File.c_str(),"r");
36
37
   if (F == 0)
37
 
      return _error->Errno("fopen","Unable to open %s",File.c_str());
 
38
      return _error->Errno("fopen",_("Unable to open %s"),File.c_str());
38
39
   
39
40
   char Line[500];
40
41
   unsigned long Counter = 0;
60
61
      for (; isspace(*End) == 0 && *End != 0; End++);
61
62
      if (*End == 0)
62
63
      {
63
 
         _error->Warning("Malformed override %s line %lu #1",File.c_str(),
 
64
         _error->Warning(_("Malformed override %s line %lu #1"),File.c_str(),
64
65
                         Counter);
65
66
         continue;
66
67
      }      
74
75
         for (; isspace(*End) == 0 && *End != 0; End++);
75
76
         if (*End == 0)
76
77
         {
77
 
            _error->Warning("Malformed override %s line %lu #2",File.c_str(),
 
78
            _error->Warning(_("Malformed override %s line %lu #2"),File.c_str(),
78
79
                            Counter);
79
80
            continue;
80
81
         }
88
89
      for (; isspace(*End) == 0 && *End != 0; End++);
89
90
      if (*End == 0)
90
91
      {
91
 
         _error->Warning("Malformed override %s line %lu #3",File.c_str(),
 
92
         _error->Warning(_("Malformed override %s line %lu #3"),File.c_str(),
92
93
                         Counter);
93
94
         continue;
94
95
      }      
127
128
   }
128
129
 
129
130
   if (ferror(F))
130
 
      _error->Errno("fgets","Failed to read the override file %s",File.c_str());
 
131
      _error->Errno("fgets",_("Failed to read the override file %s"),File.c_str());
131
132
   fclose(F);
132
133
   return true;
133
134
}
142
143
   
143
144
   FILE *F = fopen(File.c_str(),"r");
144
145
   if (F == 0)
145
 
      return _error->Errno("fopen","Unable to open %s",File.c_str());
 
146
      return _error->Errno("fopen",_("Unable to open %s"),File.c_str());
146
147
  
147
148
   char Line[500];
148
149
   unsigned long Counter = 0;
166
167
      for (; isspace(*End) == 0 && *End != 0; End++);
167
168
      if (*End == 0)
168
169
      {
169
 
         _error->Warning("Malformed override %s line %lu #1",File.c_str(),
 
170
         _error->Warning(_("Malformed override %s line %lu #1"),File.c_str(),
170
171
                         Counter);
171
172
         continue;
172
173
      }      
178
179
      for (; isspace(*End) == 0 && *End != 0; End++);
179
180
      if (*End == 0)
180
181
      {
181
 
         _error->Warning("Malformed override %s line %lu #2",File.c_str(),
 
182
         _error->Warning(_("Malformed override %s line %lu #2"),File.c_str(),
182
183
                         Counter);
183
184
         continue;
184
185
      }
191
192
      for (; isspace(*(End-1)) && End > Value; End--);
192
193
      if (End == Value)
193
194
      {
194
 
         _error->Warning("Malformed override %s line %lu #3",File.c_str(),
 
195
         _error->Warning(_("Malformed override %s line %lu #3"),File.c_str(),
195
196
                         Counter);
196
197
         continue;
197
198
      }      
201
202
   }
202
203
 
203
204
   if (ferror(F))
204
 
      _error->Errno("fgets","Failed to read the override file %s",File.c_str());
 
205
      _error->Errno("fgets",_("Failed to read the override file %s"),File.c_str());
205
206
   fclose(F);
206
207
   return true;
207
208
}