You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

668 lines
20 KiB

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