aboutsummaryrefslogtreecommitdiffstats
path: root/Perl/Webwml
diff options
context:
space:
mode:
authorDenis Barbier <barbier>2001-11-22 09:46:33 +0000
committerDenis Barbier <barbier>2001-11-22 09:46:33 +0000
commit6c8fa1f633fe12eda50bc6ec051971b5cbfc2abf (patch)
tree35241df218ce2391c0a5fb95a1a494e04cddbec0 /Perl/Webwml
parentc50190583f7250e2c425051faf51ff877a3fb61b (diff)
Add PoolDir field, and remove Stats which can be retrieved from the PO
fields. CVS version numbers Perl/Webwml/L10n/Db.pm: 1.3 -> 1.4
Diffstat (limited to 'Perl/Webwml')
-rw-r--r--Perl/Webwml/L10n/Db.pm24
1 files changed, 9 insertions, 15 deletions
diff --git a/Perl/Webwml/L10n/Db.pm b/Perl/Webwml/L10n/Db.pm
index bbe04298fc5..72a001bbcc7 100644
--- a/Perl/Webwml/L10n/Db.pm
+++ b/Perl/Webwml/L10n/Db.pm
@@ -57,9 +57,9 @@ sub new {
version => '$',
section => '$',
priority => '$',
+ pooldir => '$',
type => '$',
upstream => '$',
- stats => '%',
errors => '@',
warnings => '@',
catgets => '@',
@@ -153,7 +153,7 @@ sub read {
chomp($self->{date});
<DB>;
MAIN: while (1) {
- my $entry = { stats => {} };
+ my $entry = {};
my $desc = '';
my $last_item = 0;
my $text;
@@ -170,7 +170,7 @@ sub read {
# leading tabs are illegal, but handle them anyway
$desc =~ s/^\t/ \t/mg;
- foreach (qw(Package Version Section Priority Type Upstream)) {
+ foreach (qw(Package Version Section Priority PoolDir Type Upstream)) {
if ($desc =~ m/^$_: (.*)$/m) {
$entry->{lc $_} = $1;
} else {
@@ -178,9 +178,6 @@ sub read {
next MAIN;
}
}
- while ($desc =~ m/^Stats: ([^:]*): ([^\n]*)/mg) {
- $entry->{stats}->{$1} = $2;
- }
foreach (qw(Errors Warnings Catgets Gettext)) {
if ($desc =~ m/(^|\n)$_:\n(.+?)(\n\S|$)/s) {
$text = $2;
@@ -222,12 +219,9 @@ sub write {
print DB join('-', (localtime->year() + 1900, localtime->mon() + 1, localtime->mday))."\n\n";
foreach my $pkg (keys %{$self->{data}}) {
- foreach (qw(Package Version Section Priority Type Upstream)) {
+ foreach (qw(Package Version Section Priority PoolDir Type Upstream)) {
print DB $_.": ".$self->{data}->{$pkg}->{lc $_}."\n";
}
- foreach (keys %{$self->{data}->{$pkg}->{stats}}) {
- print DB "Stats: ".$_.": ".$self->{data}->{$pkg}->{stats}->{$_}."\n";
- }
foreach (qw(Errors Warnings Catgets Gettext)) {
if (defined($self->{data}->{$pkg}->{lc $_})) {
$text = join("\n\.\n", @{$self->{data}->{$pkg}->{lc $_}})."\n";
@@ -293,9 +287,9 @@ sub get_date {
=head2 DATA MANIPULATION
Data about packages can be classified within scalar values (C<package>,
-C<version>, C<section>, C<priority>, C<type>, C<upstream>), arrays
-(C<errors>, C<warnings>, C<catgets>, C<gettext>, C<nls>, C<po>,
-C<templates>, C<menu>) and hash tables (C<stats>).
+C<version>, C<section>, C<priority>, C<pooldir>, C<type>, C<upstream>),
+and arrays (C<errors>, C<warnings>, C<catgets>, C<gettext>, C<nls>,
+C<po>, C<templates>, C<menu>).
Each field has a method with the same name to get and set it, e.g.
$section = $l10n_db->section($pkg);
@@ -304,7 +298,7 @@ Each field has a method with the same name to get and set it, e.g.
The first line get the section associated with the package in C<$pkg>,
whereas the second set it to C<libs>.
-Two other methods are also defined to access those datas, by prefixing
+Two other methods are also defined to access those data, by prefixing
field name by C<has_> and C<add_>. The former is used to ask whether
this field is defined in database, and the latter appends values for
arrays or hash values.
@@ -312,7 +306,7 @@ arrays or hash values.
if ($l10n_db->has_templates($pkg)) {
print "Package $pkg has Debconf templates\n";
}
- $l10n_db->add_stats($pkg, 'fr', 'fr.po');
+ $l10n_db->add_po($pkg, 'po/fr.po:fr:42t0f0u:po/adduser_3.42_po_fr.po');
=head1 AUTHOR

© 2014-2024 Faster IT GmbH | imprint | privacy policy