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.
 
 
 
 
 
 

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