[Debian-l10n-commits] r2717 - in /ddtp-web: Changelog Packages2packages_tb.pl packages_tb2Packages.pl
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Mon Jul 25 16:04:08 UTC 2011
Author: nekral-guest
Date: Mon Jul 25 16:04:08 2011
New Revision: 2717
URL: http://svn.debian.org/wsvn/?sc=1&rev=2717
Log:
2011-07-25 Nicolas Francois <nicolas.francois at centraliens.net>
* Packages2packages_tb.pl: Packages2packages_tb.pl loads
descriptions into a psql table. This table is used by
packages_tb2Packages.pl to produce a Packages file with all the
packages independently from an architecture. Since
packages_tb2Packages.pl does not dump the md5 into this Packages
file, there is no need to load the md5 from
Packages2packages_tb.pl (and no need to compute these md5).
Note: The SQL layout should be adjusted, but I have some secret
goal to get rid of the complete table anyway.
2011-07-25 Nicolas Francois <nicolas.francois at centraliens.net>
* packages_tb2Packages.pl: Remove dead code. parse_header_format
inherited from Packages2packages_tb.pl. Hashes %descrmd5,
%descrlist, %total_counts, %important_packages not used. We do not
need LWP::Simple, strftime, md5_hex.
* Packages2packages_tb.pl: Remove dead code. Hashes %descrmd5,
%descrlist, %total_counts, %important_packages not used. We do
not need LWP::Simple, strftime
Modified:
ddtp-web/Changelog
ddtp-web/Packages2packages_tb.pl
ddtp-web/packages_tb2Packages.pl
Modified: ddtp-web/Changelog
URL: http://svn.debian.org/wsvn/ddtp-web/Changelog?rev=2717&op=diff
==============================================================================
--- ddtp-web/Changelog (original)
+++ ddtp-web/Changelog Mon Jul 25 16:04:08 2011
@@ -1,3 +1,25 @@
+2011-07-25 Nicolas Francois <nicolas.francois at centraliens.net>
+
+ * Packages2packages_tb.pl: Packages2packages_tb.pl loads
+ descriptions into a psql table. This table is used by
+ packages_tb2Packages.pl to produce a Packages file with all the
+ packages independently from an architecture. Since
+ packages_tb2Packages.pl does not dump the md5 into this Packages
+ file, there is no need to load the md5 from
+ Packages2packages_tb.pl (and no need to compute these md5).
+ Note: The SQL layout should be adjusted, but I have some secret
+ goal to get rid of the complete table anyway.
+
+2011-07-25 Nicolas Francois <nicolas.francois at centraliens.net>
+
+ * packages_tb2Packages.pl: Remove dead code. parse_header_format
+ inherited from Packages2packages_tb.pl. Hashes %descrmd5,
+ %descrlist, %total_counts, %important_packages not used. We do not
+ need LWP::Simple, strftime, md5_hex.
+ * Packages2packages_tb.pl: Remove dead code. Hashes %descrmd5,
+ %descrlist, %total_counts, %important_packages not used. We do
+ not need LWP::Simple, strftime
+
2011-07-25 Nicolas Francois <nicolas.francois at centraliens.net>
Introduce changes already applied to the DDTP server
Modified: ddtp-web/Packages2packages_tb.pl
URL: http://svn.debian.org/wsvn/ddtp-web/Packages2packages_tb.pl?rev=2717&op=diff
==============================================================================
--- ddtp-web/Packages2packages_tb.pl (original)
+++ ddtp-web/Packages2packages_tb.pl Mon Jul 25 16:04:08 2011
@@ -1,8 +1,5 @@
#!/usr/bin/perl -w
use strict;
-use LWP::Simple;
-use POSIX qw(strftime);
-use Digest::MD5 qw(md5_hex);
use DBI;
my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
@@ -15,12 +12,6 @@
die $DBI::errstr unless $dbh;
my $data = "/org/ddtp.debian.net/Packages/";
-
-my %descrmd5; # $descrmd5{$md5} = $desc_id, represents all known descriptions
-my %descrlist; # $descrlist{$package}{$md5} exists for each package in package file
- # $descrlist{$package}{priority} = package priority
-my %total_counts; # $total_counts{$priority} = number of packages with that priority
-my %important_packages; # $important_packages{$package}{$md5} exists for packages+description of priority standard or higher
load_packages(); # Read packages file
exit;
@@ -41,15 +32,13 @@
sub process_package
{
my $hash = shift;
- my $md5 = md5_hex( $hash->{Description}."\n" );
-# print "$hash->{Package} : $md5\n";
if (not $hash->{Source}) {
$hash->{Source} = $hash->{Package};
}
eval {
- $dbh->do("INSERT INTO packages_tb (package,source,version,tag,priority,maintainer,task,section,description,description_md5)
- VALUES (?,?,?,?,?,?,?,?,?,?);", undef,
+ $dbh->do("INSERT INTO packages_tb (package,source,version,tag,priority,maintainer,task,section,description)
+ VALUES (?,?,?,?,?,?,?,?,?);", undef,
$hash->{Package},
$hash->{Source},
$hash->{Version},
@@ -58,8 +47,7 @@
$hash->{Maintainer},
$hash->{Task},
$hash->{Section},
- $hash->{Description},
- $md5
+ $hash->{Description}
);
$dbh->commit; # commit the changes if we get this far
};
@@ -105,5 +93,3 @@
}
}
-
-
Modified: ddtp-web/packages_tb2Packages.pl
URL: http://svn.debian.org/wsvn/ddtp-web/packages_tb2Packages.pl?rev=2717&op=diff
==============================================================================
--- ddtp-web/packages_tb2Packages.pl (original)
+++ ddtp-web/packages_tb2Packages.pl Mon Jul 25 16:04:08 2011
@@ -1,8 +1,5 @@
#!/usr/bin/perl -w
use strict;
-use LWP::Simple;
-use POSIX qw(strftime);
-use Digest::MD5 qw(md5_hex);
use DBI;
my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
@@ -18,12 +15,6 @@
my $DIST = shift || "etch";
my $SECTION = shift || "main";
-
-my %descrmd5; # $descrmd5{$md5} = $desc_id, represents all known descriptions
-my %descrlist; # $descrlist{$package}{$md5} exists for each package in package file
- # $descrlist{$package}{priority} = package priority
-my %total_counts; # $total_counts{$priority} = number of packages with that priority
-my %important_packages; # $important_packages{$package}{$md5} exists for packages+description of priority standard or higher
export_packages(); # Read packages file
exit;
@@ -62,33 +53,3 @@
return $fh;
}
-sub parse_header_format
-{
- my $fh = shift;
- my $sub = shift;
-
- my $lastfield = undef;
- my %hash;
- while(<$fh>)
- {
- chomp;
- if( /^([\w.-]+): (.*)/ )
- {
- $lastfield = $1;
- $hash{$1} = $2;
- }
- elsif( /^( .*)/ )
- {
- $hash{$lastfield} .= "\n$_";
- }
- elsif( /^$/ )
- {
- $sub->( \%hash );
- %hash = ();
- $lastfield = undef;
- }
- }
-}
-
-
-
More information about the Debian-l10n-commits
mailing list