From: Frank Lichtenheld Date: Sun, 17 Jun 2007 16:55:26 +0000 (+0200) Subject: Packages::DB, Packages::Page: Make translated descriptions available to code X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=9462a8d80b46404e07ca006eb369f130f7973b59;p=deb%2Fpackages.git Packages::DB, Packages::Page: Make translated descriptions available to code The database is available as %desctrans and the MD5 sums are now stored in the Page object. --- diff --git a/lib/Packages/DB.pm b/lib/Packages/DB.pm index 7d4f55f..1402690 100644 --- a/lib/Packages/DB.pm +++ b/lib/Packages/DB.pm @@ -10,10 +10,10 @@ use Packages::Config qw( $TOPDIR $DBDIR ); our @ISA = qw( Exporter ); our ( %packages, %sources, %src2bin, %did2pkg, %descriptions, - %postf, %spostf, %debtags, + %postf, %spostf, %debtags, %desctrans, $obj, $s_obj, $p_obj, $sp_obj ); our @EXPORT = qw( %packages %sources %src2bin %did2pkg %descriptions - %postf %spostf %debtags + %postf %spostf %debtags %desctrans $obj $s_obj $p_obj $sp_obj ); our $db_read_time ||= 0; @@ -32,6 +32,9 @@ sub init { tie %descriptions, 'DB_File', "$DBDIR/descriptions.db", O_RDONLY, 0666, $DB_BTREE or die "couldn't tie DB $DBDIR/descriptions.db: $!"; + tie %desctrans, 'DB_File', "$DBDIR/descriptions_translated.db", + O_RDONLY, 0666, $DB_BTREE + or die "couldn't tie DB $DBDIR/descriptions_translated.db: $!"; tie %did2pkg, 'DB_File', "$DBDIR/descriptions_packages.db", O_RDONLY, 0666, $DB_BTREE or die "couldn't tie DB $DBDIR/descriptions_packages.db: $!"; diff --git a/lib/Packages/Page.pm b/lib/Packages/Page.pm index 27c3f36..96ee156 100644 --- a/lib/Packages/Page.pm +++ b/lib/Packages/Page.pm @@ -94,7 +94,7 @@ sub is_virtual { return (exists($self->{provided_by}) && !exists($self->{versions})); } -our @TAKE_NEWEST = qw( description essential priority section subsection tag +our @TAKE_NEWEST = qw( description description-md5 essential priority section subsection tag archive source source-version url ); our @STORE_ALL = qw( version source source-version installed-size size filename md5sum sha1 sha256 task