~jr/ubuntu/oneiric/apt/bzr-get-rename

« back to all changes in this revision

Viewing changes to apt-pkg/deb/debindexfile.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: debindexfile.cc,v 1.5 2001/04/29 05:13:51 jgg Exp $
 
3
// $Id: debindexfile.cc,v 1.5.2.3 2004/01/04 19:11:00 mdz Exp $
4
4
/* ######################################################################
5
5
 
6
6
   Debian Specific sources.list types and the three sorts of Debian
23
23
#include <apt-pkg/error.h>
24
24
#include <apt-pkg/strutl.h>
25
25
#include <apt-pkg/acquire-item.h>
 
26
#include <apt-pkg/debmetaindex.h>
26
27
    
27
28
#include <sys/stat.h>
28
29
                                                                        /*}}}*/
30
31
// SourcesIndex::debSourcesIndex - Constructor                          /*{{{*/
31
32
// ---------------------------------------------------------------------
32
33
/* */
33
 
debSourcesIndex::debSourcesIndex(string URI,string Dist,string Section) :
34
 
                                     URI(URI), Dist(Dist), Section(Section)
 
34
debSourcesIndex::debSourcesIndex(string URI,string Dist,string Section,bool Trusted) :
 
35
     pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section)
35
36
{
36
37
}
37
38
                                                                        /*}}}*/
78
79
{
79
80
   char S[300];
80
81
   if (Short == true)
81
 
      snprintf(S,sizeof(S),"%s",Info("Packages").c_str());
 
82
      snprintf(S,sizeof(S),"%s",Info("Sources").c_str());
82
83
   else
83
 
      snprintf(S,sizeof(S),"%s (%s)",Info("Packages").c_str(),
 
84
      snprintf(S,sizeof(S),"%s (%s)",Info("Sources").c_str(),
84
85
               IndexFile("Sources").c_str());
85
86
   
86
87
   return S;
129
130
   return Res;
130
131
}
131
132
                                                                        /*}}}*/
132
 
// SourcesIndex::GetIndexes - Fetch the index files                     /*{{{*/
133
 
// ---------------------------------------------------------------------
134
 
/* */
135
 
bool debSourcesIndex::GetIndexes(pkgAcquire *Owner) const
136
 
{
137
 
   new pkgAcqIndex(Owner,IndexURI("Sources"),Info("Sources"),"Sources");
138
 
   new pkgAcqIndexRel(Owner,IndexURI("Release"),Info("Release"),"Release");
139
 
   return true;
140
 
}
141
 
                                                                        /*}}}*/
142
133
// SourcesIndex::Exists - Check if the index is available               /*{{{*/
143
134
// ---------------------------------------------------------------------
144
135
/* */
162
153
// PackagesIndex::debPackagesIndex - Contructor                         /*{{{*/
163
154
// ---------------------------------------------------------------------
164
155
/* */
165
 
debPackagesIndex::debPackagesIndex(string URI,string Dist,string Section) : 
166
 
                  URI(URI), Dist(Dist), Section(Section)
 
156
debPackagesIndex::debPackagesIndex(string URI,string Dist,string Section,bool Trusted) : 
 
157
                  pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section)
167
158
{
168
159
}
169
160
                                                                        /*}}}*/
246
237
   return Res;
247
238
}
248
239
                                                                        /*}}}*/
249
 
// PackagesIndex::GetIndexes - Fetch the index files                    /*{{{*/
250
 
// ---------------------------------------------------------------------
251
 
/* */
252
 
bool debPackagesIndex::GetIndexes(pkgAcquire *Owner) const
253
 
{
254
 
   new pkgAcqIndex(Owner,IndexURI("Packages"),Info("Packages"),"Packages");
255
 
   new pkgAcqIndexRel(Owner,IndexURI("Release"),Info("Release"),"Release");
256
 
   return true;
257
 
}
258
 
                                                                        /*}}}*/
259
240
// PackagesIndex::Exists - Check if the index is available              /*{{{*/
260
241
// ---------------------------------------------------------------------
261
242
/* */
303
284
      return _error->Error("Problem with MergeList %s",PackageFile.c_str());
304
285
 
305
286
   // Check the release file
306
 
   string ReleaseFile = IndexFile("Release");
 
287
   string ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("Release");
307
288
   if (FileExists(ReleaseFile) == true)
308
289
   {
309
290
      FileFd Rel(ReleaseFile,FileFd::ReadOnly);
342
323
// StatusIndex::debStatusIndex - Constructor                            /*{{{*/
343
324
// ---------------------------------------------------------------------
344
325
/* */
345
 
debStatusIndex::debStatusIndex(string File) : File(File)
 
326
debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), File(File)
346
327
{
347
328
}
348
329
                                                                        /*}}}*/
418
399
}
419
400
                                                                        /*}}}*/
420
401
 
421
 
// Source List types for Debian                                         /*{{{*/
422
 
class debSLTypeDeb : public pkgSourceList::Type
423
 
{
424
 
   public:
425
 
 
426
 
   bool CreateItem(vector<pkgIndexFile *> &List,string URI,
427
 
                   string Dist,string Section,
428
 
                   pkgSourceList::Vendor const *Vendor) const
429
 
   {
430
 
      List.push_back(new debPackagesIndex(URI,Dist,Section));
431
 
      return true;
432
 
   };
433
 
 
434
 
   debSLTypeDeb()
435
 
   {
436
 
      Name = "deb";
437
 
      Label = "Standard Debian binary tree";
438
 
   }   
439
 
};
440
 
 
441
 
class debSLTypeDebSrc : public pkgSourceList::Type
442
 
{
443
 
   public:
444
 
 
445
 
   bool CreateItem(vector<pkgIndexFile *> &List,string URI,
446
 
                   string Dist,string Section,
447
 
                   pkgSourceList::Vendor const *Vendor) const 
448
 
   {      
449
 
      List.push_back(new debSourcesIndex(URI,Dist,Section));
450
 
      return true;
451
 
   };  
452
 
   
453
 
   debSLTypeDebSrc()
454
 
   {
455
 
      Name = "deb-src";
456
 
      Label = "Standard Debian source tree";
457
 
   }   
458
 
};
459
 
 
460
 
debSLTypeDeb _apt_DebType;
461
 
debSLTypeDebSrc _apt_DebSrcType;
462
 
                                                                        /*}}}*/
463
402
// Index File types for Debian                                          /*{{{*/
464
403
class debIFTypeSrc : public pkgIndexFile::Type
465
404
{