revert 2184.1.2: do not pollute namespace in headers
[ntk/apt.git] / apt-pkg / deb / debindexfile.cc
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: debindexfile.cc,v 1.5.2.3 2004/01/04 19:11:00 mdz Exp $
4 /* ######################################################################
5
6 Debian Specific sources.list types and the three sorts of Debian
7 index files.
8
9 ##################################################################### */
10 /*}}}*/
11 // Include Files /*{{{*/
12 #include <config.h>
13
14 #include <apt-pkg/debindexfile.h>
15 #include <apt-pkg/debsrcrecords.h>
16 #include <apt-pkg/deblistparser.h>
17 #include <apt-pkg/debrecords.h>
18 #include <apt-pkg/sourcelist.h>
19 #include <apt-pkg/configuration.h>
20 #include <apt-pkg/progress.h>
21 #include <apt-pkg/error.h>
22 #include <apt-pkg/strutl.h>
23 #include <apt-pkg/acquire-item.h>
24 #include <apt-pkg/debmetaindex.h>
25
26 #include <sys/stat.h>
27 /*}}}*/
28
29 // SourcesIndex::debSourcesIndex - Constructor /*{{{*/
30 // ---------------------------------------------------------------------
31 /* */
32 debSourcesIndex::debSourcesIndex(string URI,string Dist,string Section,bool Trusted) :
33 pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section)
34 {
35 }
36 /*}}}*/
37 // SourcesIndex::SourceInfo - Short 1 liner describing a source /*{{{*/
38 // ---------------------------------------------------------------------
39 /* The result looks like:
40 http://foo/debian/ stable/main src 1.1.1 (dsc) */
41 string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record,
42 pkgSrcRecords::File const &File) const
43 {
44 string Res;
45 Res = ::URI::NoUserPassword(URI) + ' ';
46 if (Dist[Dist.size() - 1] == '/')
47 {
48 if (Dist != "/")
49 Res += Dist;
50 }
51 else
52 Res += Dist + '/' + Section;
53
54 Res += " ";
55 Res += Record.Package();
56 Res += " ";
57 Res += Record.Version();
58 if (File.Type.empty() == false)
59 Res += " (" + File.Type + ")";
60 return Res;
61 }
62 /*}}}*/
63 // SourcesIndex::CreateSrcParser - Get a parser for the source files /*{{{*/
64 // ---------------------------------------------------------------------
65 /* */
66 pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const
67 {
68 string SourcesURI = _config->FindDir("Dir::State::lists") +
69 URItoFileName(IndexURI("Sources"));
70 string SourcesURIgzip = SourcesURI + ".gz";
71
72 if (!FileExists(SourcesURI) && !FileExists(SourcesURIgzip))
73 return NULL;
74 else if (!FileExists(SourcesURI) && FileExists(SourcesURIgzip))
75 SourcesURI = SourcesURIgzip;
76
77 return new debSrcRecordParser(SourcesURI,this);
78 }
79 /*}}}*/
80 // SourcesIndex::Describe - Give a descriptive path to the index /*{{{*/
81 // ---------------------------------------------------------------------
82 /* */
83 string debSourcesIndex::Describe(bool Short) const
84 {
85 char S[300];
86 if (Short == true)
87 snprintf(S,sizeof(S),"%s",Info("Sources").c_str());
88 else
89 snprintf(S,sizeof(S),"%s (%s)",Info("Sources").c_str(),
90 IndexFile("Sources").c_str());
91
92 return S;
93 }
94 /*}}}*/
95 // SourcesIndex::Info - One liner describing the index URI /*{{{*/
96 // ---------------------------------------------------------------------
97 /* */
98 string debSourcesIndex::Info(const char *Type) const
99 {
100 string Info = ::URI::NoUserPassword(URI) + ' ';
101 if (Dist[Dist.size() - 1] == '/')
102 {
103 if (Dist != "/")
104 Info += Dist;
105 }
106 else
107 Info += Dist + '/' + Section;
108 Info += " ";
109 Info += Type;
110 return Info;
111 }
112 /*}}}*/
113 // SourcesIndex::Index* - Return the URI to the index files /*{{{*/
114 // ---------------------------------------------------------------------
115 /* */
116 inline string debSourcesIndex::IndexFile(const char *Type) const
117 {
118 string s = URItoFileName(IndexURI(Type));
119 string sgzip = s + ".gz";
120 if (!FileExists(s) && FileExists(sgzip))
121 return sgzip;
122 else
123 return s;
124 }
125
126 string debSourcesIndex::IndexURI(const char *Type) const
127 {
128 string Res;
129 if (Dist[Dist.size() - 1] == '/')
130 {
131 if (Dist != "/")
132 Res = URI + Dist;
133 else
134 Res = URI;
135 }
136 else
137 Res = URI + "dists/" + Dist + '/' + Section +
138 "/source/";
139
140 Res += Type;
141 return Res;
142 }
143 /*}}}*/
144 // SourcesIndex::Exists - Check if the index is available /*{{{*/
145 // ---------------------------------------------------------------------
146 /* */
147 bool debSourcesIndex::Exists() const
148 {
149 return FileExists(IndexFile("Sources"));
150 }
151 /*}}}*/
152 // SourcesIndex::Size - Return the size of the index /*{{{*/
153 // ---------------------------------------------------------------------
154 /* */
155 unsigned long debSourcesIndex::Size() const
156 {
157 unsigned long size = 0;
158
159 /* we need to ignore errors here; if the lists are absent, just return 0 */
160 _error->PushToStack();
161
162 FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnly, FileFd::Extension);
163 if (!f.Failed())
164 size = f.Size();
165
166 if (_error->PendingError() == true)
167 size = 0;
168 _error->RevertToStack();
169
170 return size;
171 }
172 /*}}}*/
173
174 // PackagesIndex::debPackagesIndex - Contructor /*{{{*/
175 // ---------------------------------------------------------------------
176 /* */
177 debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string const &Section,
178 bool const &Trusted, string const &Arch) :
179 pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section), Architecture(Arch)
180 {
181 if (Architecture == "native")
182 Architecture = _config->Find("APT::Architecture");
183 }
184 /*}}}*/
185 // PackagesIndex::ArchiveInfo - Short version of the archive url /*{{{*/
186 // ---------------------------------------------------------------------
187 /* This is a shorter version that is designed to be < 60 chars or so */
188 string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const
189 {
190 string Res = ::URI::NoUserPassword(URI) + ' ';
191 if (Dist[Dist.size() - 1] == '/')
192 {
193 if (Dist != "/")
194 Res += Dist;
195 }
196 else
197 Res += Dist + '/' + Section;
198
199 Res += " ";
200 Res += Ver.ParentPkg().Name();
201 Res += " ";
202 if (Dist[Dist.size() - 1] != '/')
203 Res.append(Ver.Arch()).append(" ");
204 Res += Ver.VerStr();
205 return Res;
206 }
207 /*}}}*/
208 // PackagesIndex::Describe - Give a descriptive path to the index /*{{{*/
209 // ---------------------------------------------------------------------
210 /* This should help the user find the index in the sources.list and
211 in the filesystem for problem solving */
212 string debPackagesIndex::Describe(bool Short) const
213 {
214 char S[300];
215 if (Short == true)
216 snprintf(S,sizeof(S),"%s",Info("Packages").c_str());
217 else
218 snprintf(S,sizeof(S),"%s (%s)",Info("Packages").c_str(),
219 IndexFile("Packages").c_str());
220 return S;
221 }
222 /*}}}*/
223 // PackagesIndex::Info - One liner describing the index URI /*{{{*/
224 // ---------------------------------------------------------------------
225 /* */
226 string debPackagesIndex::Info(const char *Type) const
227 {
228 string Info = ::URI::NoUserPassword(URI) + ' ';
229 if (Dist[Dist.size() - 1] == '/')
230 {
231 if (Dist != "/")
232 Info += Dist;
233 }
234 else
235 Info += Dist + '/' + Section;
236 Info += " ";
237 if (Dist[Dist.size() - 1] != '/')
238 Info += Architecture + " ";
239 Info += Type;
240 return Info;
241 }
242 /*}}}*/
243 // PackagesIndex::Index* - Return the URI to the index files /*{{{*/
244 // ---------------------------------------------------------------------
245 /* */
246 inline string debPackagesIndex::IndexFile(const char *Type) const
247 {
248 string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
249 string sgzip = s + ".gz";
250 if (!FileExists(s) && FileExists(sgzip))
251 return sgzip;
252 else
253 return s;
254 }
255 string debPackagesIndex::IndexURI(const char *Type) const
256 {
257 string Res;
258 if (Dist[Dist.size() - 1] == '/')
259 {
260 if (Dist != "/")
261 Res = URI + Dist;
262 else
263 Res = URI;
264 }
265 else
266 Res = URI + "dists/" + Dist + '/' + Section +
267 "/binary-" + Architecture + '/';
268
269 Res += Type;
270 return Res;
271 }
272 /*}}}*/
273 // PackagesIndex::Exists - Check if the index is available /*{{{*/
274 // ---------------------------------------------------------------------
275 /* */
276 bool debPackagesIndex::Exists() const
277 {
278 return FileExists(IndexFile("Packages"));
279 }
280 /*}}}*/
281 // PackagesIndex::Size - Return the size of the index /*{{{*/
282 // ---------------------------------------------------------------------
283 /* This is really only used for progress reporting. */
284 unsigned long debPackagesIndex::Size() const
285 {
286 unsigned long size = 0;
287
288 /* we need to ignore errors here; if the lists are absent, just return 0 */
289 _error->PushToStack();
290
291 FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnly, FileFd::Extension);
292 if (!f.Failed())
293 size = f.Size();
294
295 if (_error->PendingError() == true)
296 size = 0;
297 _error->RevertToStack();
298
299 return size;
300 }
301 /*}}}*/
302 // PackagesIndex::Merge - Load the index file into a cache /*{{{*/
303 // ---------------------------------------------------------------------
304 /* */
305 bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
306 {
307 string PackageFile = IndexFile("Packages");
308 FileFd Pkg(PackageFile,FileFd::ReadOnly, FileFd::Extension);
309 debListParser Parser(&Pkg, Architecture);
310
311 if (_error->PendingError() == true)
312 return _error->Error("Problem opening %s",PackageFile.c_str());
313 if (Prog != NULL)
314 Prog->SubProgress(0,Info("Packages"));
315 ::URI Tmp(URI);
316 if (Gen.SelectFile(PackageFile,Tmp.Host,*this) == false)
317 return _error->Error("Problem with SelectFile %s",PackageFile.c_str());
318
319 // Store the IMS information
320 pkgCache::PkgFileIterator File = Gen.GetCurFile();
321 pkgCacheGenerator::Dynamic<pkgCache::PkgFileIterator> DynFile(File);
322 File->Size = Pkg.FileSize();
323 File->mtime = Pkg.ModificationTime();
324
325 if (Gen.MergeList(Parser) == false)
326 return _error->Error("Problem with MergeList %s",PackageFile.c_str());
327
328 // Check the release file
329 string ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("InRelease");
330 bool releaseExists = false;
331 if (FileExists(ReleaseFile) == true)
332 releaseExists = true;
333 else
334 ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("Release");
335
336 if (releaseExists == true || FileExists(ReleaseFile) == true)
337 {
338 FileFd Rel(ReleaseFile,FileFd::ReadOnly);
339 if (_error->PendingError() == true)
340 return false;
341 Parser.LoadReleaseInfo(File,Rel,Section);
342 }
343
344 return true;
345 }
346 /*}}}*/
347 // PackagesIndex::FindInCache - Find this index /*{{{*/
348 // ---------------------------------------------------------------------
349 /* */
350 pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const
351 {
352 string FileName = IndexFile("Packages");
353 pkgCache::PkgFileIterator File = Cache.FileBegin();
354 for (; File.end() == false; ++File)
355 {
356 if (File.FileName() == NULL || FileName != File.FileName())
357 continue;
358
359 struct stat St;
360 if (stat(File.FileName(),&St) != 0)
361 {
362 if (_config->FindB("Debug::pkgCacheGen", false))
363 std::clog << "PackagesIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
364 return pkgCache::PkgFileIterator(Cache);
365 }
366 if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
367 {
368 if (_config->FindB("Debug::pkgCacheGen", false))
369 std::clog << "PackagesIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
370 << ") or mtime (" << St.st_mtime << " <> " << File->mtime
371 << ") doesn't match for " << File.FileName() << std::endl;
372 return pkgCache::PkgFileIterator(Cache);
373 }
374 return File;
375 }
376
377 return File;
378 }
379 /*}}}*/
380
381 // TranslationsIndex::debTranslationsIndex - Contructor /*{{{*/
382 // ---------------------------------------------------------------------
383 /* */
384 debTranslationsIndex::debTranslationsIndex(string URI,string Dist,string Section,
385 char const * const Translation) :
386 pkgIndexFile(true), URI(URI), Dist(Dist), Section(Section),
387 Language(Translation)
388 {}
389 /*}}}*/
390 // TranslationIndex::Trans* - Return the URI to the translation files /*{{{*/
391 // ---------------------------------------------------------------------
392 /* */
393 inline string debTranslationsIndex::IndexFile(const char *Type) const
394 {
395 string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
396 string sgzip = s + ".gz";
397 if (!FileExists(s) && FileExists(sgzip))
398 return sgzip;
399 else
400 return s;
401 }
402 string debTranslationsIndex::IndexURI(const char *Type) const
403 {
404 string Res;
405 if (Dist[Dist.size() - 1] == '/')
406 {
407 if (Dist != "/")
408 Res = URI + Dist;
409 else
410 Res = URI;
411 }
412 else
413 Res = URI + "dists/" + Dist + '/' + Section +
414 "/i18n/Translation-";
415
416 Res += Type;
417 return Res;
418 }
419 /*}}}*/
420 // TranslationsIndex::GetIndexes - Fetch the index files /*{{{*/
421 // ---------------------------------------------------------------------
422 /* */
423 bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const
424 {
425 string const TranslationFile = string("Translation-").append(Language);
426 new pkgAcqIndexTrans(Owner, IndexURI(Language),
427 Info(TranslationFile.c_str()),
428 TranslationFile);
429
430 return true;
431 }
432 /*}}}*/
433 // TranslationsIndex::Describe - Give a descriptive path to the index /*{{{*/
434 // ---------------------------------------------------------------------
435 /* This should help the user find the index in the sources.list and
436 in the filesystem for problem solving */
437 string debTranslationsIndex::Describe(bool Short) const
438 {
439 char S[300];
440 if (Short == true)
441 snprintf(S,sizeof(S),"%s",Info(TranslationFile().c_str()).c_str());
442 else
443 snprintf(S,sizeof(S),"%s (%s)",Info(TranslationFile().c_str()).c_str(),
444 IndexFile(Language).c_str());
445 return S;
446 }
447 /*}}}*/
448 // TranslationsIndex::Info - One liner describing the index URI /*{{{*/
449 // ---------------------------------------------------------------------
450 /* */
451 string debTranslationsIndex::Info(const char *Type) const
452 {
453 string Info = ::URI::NoUserPassword(URI) + ' ';
454 if (Dist[Dist.size() - 1] == '/')
455 {
456 if (Dist != "/")
457 Info += Dist;
458 }
459 else
460 Info += Dist + '/' + Section;
461 Info += " ";
462 Info += Type;
463 return Info;
464 }
465 /*}}}*/
466 bool debTranslationsIndex::HasPackages() const /*{{{*/
467 {
468 return FileExists(IndexFile(Language));
469 }
470 /*}}}*/
471 // TranslationsIndex::Exists - Check if the index is available /*{{{*/
472 // ---------------------------------------------------------------------
473 /* */
474 bool debTranslationsIndex::Exists() const
475 {
476 return FileExists(IndexFile(Language));
477 }
478 /*}}}*/
479 // TranslationsIndex::Size - Return the size of the index /*{{{*/
480 // ---------------------------------------------------------------------
481 /* This is really only used for progress reporting. */
482 unsigned long debTranslationsIndex::Size() const
483 {
484 unsigned long size = 0;
485
486 /* we need to ignore errors here; if the lists are absent, just return 0 */
487 _error->PushToStack();
488
489 FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnly, FileFd::Extension);
490 if (!f.Failed())
491 size = f.Size();
492
493 if (_error->PendingError() == true)
494 size = 0;
495 _error->RevertToStack();
496
497 return size;
498 }
499 /*}}}*/
500 // TranslationsIndex::Merge - Load the index file into a cache /*{{{*/
501 // ---------------------------------------------------------------------
502 /* */
503 bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
504 {
505 // Check the translation file, if in use
506 string TranslationFile = IndexFile(Language);
507 if (FileExists(TranslationFile))
508 {
509 FileFd Trans(TranslationFile,FileFd::ReadOnly, FileFd::Extension);
510 debListParser TransParser(&Trans);
511 if (_error->PendingError() == true)
512 return false;
513
514 if (Prog != NULL)
515 Prog->SubProgress(0, Info(TranslationFile.c_str()));
516 if (Gen.SelectFile(TranslationFile,string(),*this) == false)
517 return _error->Error("Problem with SelectFile %s",TranslationFile.c_str());
518
519 // Store the IMS information
520 pkgCache::PkgFileIterator TransFile = Gen.GetCurFile();
521 TransFile->Size = Trans.FileSize();
522 TransFile->mtime = Trans.ModificationTime();
523
524 if (Gen.MergeList(TransParser) == false)
525 return _error->Error("Problem with MergeList %s",TranslationFile.c_str());
526 }
527
528 return true;
529 }
530 /*}}}*/
531 // TranslationsIndex::FindInCache - Find this index /*{{{*/
532 // ---------------------------------------------------------------------
533 /* */
534 pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) const
535 {
536 string FileName = IndexFile(Language);
537
538 pkgCache::PkgFileIterator File = Cache.FileBegin();
539 for (; File.end() == false; ++File)
540 {
541 if (FileName != File.FileName())
542 continue;
543
544 struct stat St;
545 if (stat(File.FileName(),&St) != 0)
546 {
547 if (_config->FindB("Debug::pkgCacheGen", false))
548 std::clog << "TranslationIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
549 return pkgCache::PkgFileIterator(Cache);
550 }
551 if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
552 {
553 if (_config->FindB("Debug::pkgCacheGen", false))
554 std::clog << "TranslationIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
555 << ") or mtime (" << St.st_mtime << " <> " << File->mtime
556 << ") doesn't match for " << File.FileName() << std::endl;
557 return pkgCache::PkgFileIterator(Cache);
558 }
559 return File;
560 }
561 return File;
562 }
563 /*}}}*/
564 // StatusIndex::debStatusIndex - Constructor /*{{{*/
565 // ---------------------------------------------------------------------
566 /* */
567 debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), File(File)
568 {
569 }
570 /*}}}*/
571 // StatusIndex::Size - Return the size of the index /*{{{*/
572 // ---------------------------------------------------------------------
573 /* */
574 unsigned long debStatusIndex::Size() const
575 {
576 struct stat S;
577 if (stat(File.c_str(),&S) != 0)
578 return 0;
579 return S.st_size;
580 }
581 /*}}}*/
582 // StatusIndex::Merge - Load the index file into a cache /*{{{*/
583 // ---------------------------------------------------------------------
584 /* */
585 bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
586 {
587 FileFd Pkg(File,FileFd::ReadOnly, FileFd::Extension);
588 if (_error->PendingError() == true)
589 return false;
590 debListParser Parser(&Pkg);
591 if (_error->PendingError() == true)
592 return false;
593
594 if (Prog != NULL)
595 Prog->SubProgress(0,File);
596 if (Gen.SelectFile(File,string(),*this,pkgCache::Flag::NotSource) == false)
597 return _error->Error("Problem with SelectFile %s",File.c_str());
598
599 // Store the IMS information
600 pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
601 struct stat St;
602 if (fstat(Pkg.Fd(),&St) != 0)
603 return _error->Errno("fstat","Failed to stat");
604 CFile->Size = Pkg.FileSize();
605 CFile->mtime = Pkg.ModificationTime();
606 CFile->Archive = Gen.WriteUniqString("now");
607
608 if (Gen.MergeList(Parser) == false)
609 return _error->Error("Problem with MergeList %s",File.c_str());
610 return true;
611 }
612 /*}}}*/
613 // StatusIndex::FindInCache - Find this index /*{{{*/
614 // ---------------------------------------------------------------------
615 /* */
616 pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const
617 {
618 pkgCache::PkgFileIterator File = Cache.FileBegin();
619 for (; File.end() == false; ++File)
620 {
621 if (this->File != File.FileName())
622 continue;
623
624 struct stat St;
625 if (stat(File.FileName(),&St) != 0)
626 {
627 if (_config->FindB("Debug::pkgCacheGen", false))
628 std::clog << "StatusIndex::FindInCache - stat failed on " << File.FileName() << std::endl;
629 return pkgCache::PkgFileIterator(Cache);
630 }
631 if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime)
632 {
633 if (_config->FindB("Debug::pkgCacheGen", false))
634 std::clog << "StatusIndex::FindInCache - size (" << St.st_size << " <> " << File->Size
635 << ") or mtime (" << St.st_mtime << " <> " << File->mtime
636 << ") doesn't match for " << File.FileName() << std::endl;
637 return pkgCache::PkgFileIterator(Cache);
638 }
639 return File;
640 }
641 return File;
642 }
643 /*}}}*/
644 // StatusIndex::Exists - Check if the index is available /*{{{*/
645 // ---------------------------------------------------------------------
646 /* */
647 bool debStatusIndex::Exists() const
648 {
649 // Abort if the file does not exist.
650 return true;
651 }
652 /*}}}*/
653
654 // Index File types for Debian /*{{{*/
655 class debIFTypeSrc : public pkgIndexFile::Type
656 {
657 public:
658
659 debIFTypeSrc() {Label = "Debian Source Index";};
660 };
661 class debIFTypePkg : public pkgIndexFile::Type
662 {
663 public:
664
665 virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const
666 {
667 return new debRecordParser(File.FileName(),*File.Cache());
668 };
669 debIFTypePkg() {Label = "Debian Package Index";};
670 };
671 class debIFTypeTrans : public debIFTypePkg
672 {
673 public:
674 debIFTypeTrans() {Label = "Debian Translation Index";};
675 };
676 class debIFTypeStatus : public pkgIndexFile::Type
677 {
678 public:
679
680 virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const
681 {
682 return new debRecordParser(File.FileName(),*File.Cache());
683 };
684 debIFTypeStatus() {Label = "Debian dpkg status file";};
685 };
686 static debIFTypeSrc _apt_Src;
687 static debIFTypePkg _apt_Pkg;
688 static debIFTypeTrans _apt_Trans;
689 static debIFTypeStatus _apt_Status;
690
691 const pkgIndexFile::Type *debSourcesIndex::GetType() const
692 {
693 return &_apt_Src;
694 }
695 const pkgIndexFile::Type *debPackagesIndex::GetType() const
696 {
697 return &_apt_Pkg;
698 }
699 const pkgIndexFile::Type *debTranslationsIndex::GetType() const
700 {
701 return &_apt_Trans;
702 }
703 const pkgIndexFile::Type *debStatusIndex::GetType() const
704 {
705 return &_apt_Status;
706 }
707
708 /*}}}*/