[pkg-bioc] svn commit r354 r354 - in /branches/tools-ng: README pkgbioc.pm storage.pm
psychedelys-guest at users.alioth.debian.org
psychedelys-guest at users.alioth.debian.org
Sun Nov 4 16:57:02 UTC 2007
Author: psychedelys-guest
Date: Sun Nov 4 16:57:02 2007
New Revision: 354
URL: http://svn.debian.org/wsvn/pkg-bioc/?sc=1&rev=354
Log:
version beta 2 of r_pkg_ordering
Modified:
branches/tools-ng/README
branches/tools-ng/pkgbioc.pm
branches/tools-ng/storage.pm
Modified: branches/tools-ng/README
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/README?rev=354&op=diff
==============================================================================
--- branches/tools-ng/README (original)
+++ branches/tools-ng/README Sun Nov 4 16:57:02 2007
@@ -2,7 +2,7 @@
./r_pkg_prepare.sh --create-all --eu
./r_pkg_update.pl --dobuilderupdate
./r_pkg_update.pl --doupdate
-./r_pkg_ordering
+./r_pkg_ordering.pl
# to generate the file list.d/AlreadyIncludeInDebian.list
Modified: branches/tools-ng/pkgbioc.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/pkgbioc.pm?rev=354&op=diff
==============================================================================
--- branches/tools-ng/pkgbioc.pm (original)
+++ branches/tools-ng/pkgbioc.pm Sun Nov 4 16:57:02 2007
@@ -338,7 +338,7 @@ sub populate_description($$$$$) {
print "populate description $repo\n" if $main::verbose;
my @ary = glob( "../" . $directory . "/$sources/*.tar.gz" );
print "Found " . ( $#ary + 1 ) . " patterns in the repository $repo.\n"
- if $main::debug;
+ if $main::verbose;
foreach my $cur (@ary) {
next unless defined($cur);
my $bfile = basename($cur);
Modified: branches/tools-ng/storage.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/storage.pm?rev=354&op=diff
==============================================================================
--- branches/tools-ng/storage.pm (original)
+++ branches/tools-ng/storage.pm Sun Nov 4 16:57:02 2007
@@ -404,6 +404,47 @@ sub insert_if_not_found_repository($) {
return $repo_id;
}
+sub prepare_store_anomalies($) {
+ my ($hash) = @_;
+ if ( !$dbh ) {
+ print "Cannot work, I am not connected\n";
+ }
+
+ $hash->{cannotbuild}->{sthselect} =
+ $dbh->prepare(
+"SELECT count(*) FROM cannotbuild WHERE packagesupdate_id = ? AND anomalies_id = ? "
+ );
+ $hash->{cannotbuild}->{sthinsert} =
+ $dbh->prepare(
+"INSERT INTO cannotbuild (packagesupdate_id, anomalies_id, lastcheck) VALUES( ?,?,? )"
+ );
+ $hash->{cannotbuild}->{sthupdateseen} =
+ $dbh->prepare(
+"UPDATE cannotbuild SET lastcheck = ? WHERE packagesupdate_id = ? AND anomalies_id = ?"
+ );
+
+ $hash->{anomalies}->{sthselect} =
+ $dbh->prepare("SELECT id FROM anomalies WHERE name = ?");
+ $hash->{anomalies}->{sthinsert} =
+ $dbh->prepare("INSERT INTO anomalies (name) VALUES( ? )");
+
+}
+
+sub finish_store_anomalies($) {
+ my ($hash) = @_;
+ if ( !$dbh ) {
+ print "Cannot work, I am not connected\n";
+ }
+
+ $hash->{cannotbuild}->{sthselect}->finish();
+ $hash->{cannotbuild}->{sthinsert}->finish();
+ $hash->{cannotbuild}->{sthupdateseen}->finish();
+
+ $hash->{anomalies}->{sthselect}->finish();
+ $hash->{anomalies}->{sthinsert}->finish();
+
+}
+
sub prepare_store_source($) {
my ($hash) = @_;
if ( !$dbh ) {
@@ -436,23 +477,7 @@ sub prepare_store_source($) {
"SELECT id FROM packagesupdate WHERE packagesname_id = ? AND repository_id = ? "
);
- $hash->{cannotbuild}->{sthselect} =
- $dbh->prepare(
-"SELECT count(*) FROM cannotbuild WHERE packagesupdate_id = ? AND anomalies_id = ? "
- );
- $hash->{cannotbuild}->{sthinsert} =
- $dbh->prepare(
-"INSERT INTO cannotbuild (packagesupdate_id, anomalies_id, lastcheck) VALUES( ?,?,? )"
- );
- $hash->{cannotbuild}->{sthupdateseen} =
- $dbh->prepare(
-"UPDATE cannotbuild SET lastcheck = ? WHERE packagesupdate_id = ? AND anomalies_id = ?"
- );
-
- $hash->{anomalies}->{sthselect} =
- $dbh->prepare("SELECT id FROM anomalies WHERE name = ?");
- $hash->{anomalies}->{sthinsert} =
- $dbh->prepare("INSERT INTO anomalies (name) VALUES( ? )");
+ prepare_store_anomalies($hash);
}
@@ -550,9 +575,8 @@ sub insert_if_not_found_anomalies ($$) {
if ( !$dbh ) {
print "Cannot work, I am not connected\n";
}
- $dbh->prepare("BEGIN TRANSACTION ");
- print " Looking for '$name'\n";
+ print "insert_if_not_found_anomalies: Looking for '$name'\n";
$sth->{anomalies}->{sthselect}->execute($name)
or die "Couldn't execute statement: "
@@ -561,9 +585,12 @@ sub insert_if_not_found_anomalies ($$) {
if ( $l == 0 ) {
print "inserting $name\n";
+ $dbh->prepare("BEGIN TRANSACTION ");
$sth->{anomalies}->{sthinsert}->execute($name)
or die "Couldn't execute statement: "
. $sth->{anomalies}->{sthinsert}->errstr;
+ $dbh->prepare("COMMIT TRANSACTION ");
+
$sth->{anomalies}->{sthselect}->execute($name)
or die "Couldn't execute statement: "
. $sth->{anomalies}->{sthselect}->errstr;
@@ -585,7 +612,6 @@ sub insert_if_not_found_anomalies ($$) {
. " this is excluded by the SQL constraint\n";
}
- $dbh->prepare("COMMIT TRANSACTION ");
print "anomaly_id for $name is $anomaly_id\n";
return $anomaly_id;
@@ -596,7 +622,6 @@ sub insert_update_cannotbuild ($$$) {
if ( !$dbh ) {
print "Cannot work, I am not connected\n";
}
- $dbh->prepare("BEGIN TRANSACTION ");
my $motif_id = insert_if_not_found_anomalies( $sth, $motif );
@@ -607,9 +632,11 @@ sub insert_update_cannotbuild ($$$) {
if ( $l == 0 ) {
print "inserting $motif ($motif_id) for $pkg_id\n";
+ $dbh->prepare("BEGIN TRANSACTION ");
$sth->{cannotbuild}->{sthinsert}->execute( $pkg_id, $motif_id, "now()" )
or die "Couldn't execute statement: "
. $sth->{cannotbuild}->{sthinsert}->errstrd;
+ $dbh->prepare("COMMIT TRANSACTION ");
}
elsif ( $l == 1 ) {
print "updating $motif ($motif_id) for $pkg_id\n";
@@ -622,8 +649,6 @@ sub insert_update_cannotbuild ($$$) {
die
"Should not have severals line, this is excluded by the SQL constraint\n";
}
- $dbh->prepare("COMMIT TRANSACTION ");
-
}
sub finish_store_source($) {
@@ -641,12 +666,7 @@ sub finish_store_source($) {
$hash->{packagesupdate}->{sthupdateversion}->finish();
$hash->{packagesupdate}->{sthselectid}->finish();
- $hash->{cannotbuild}->{sthselect}->finish();
- $hash->{cannotbuild}->{sthinsert}->finish();
- $hash->{cannotbuild}->{sthupdateseen}->finish();
-
- $hash->{anomalies}->{sthselect}->finish();
- $hash->{anomalies}->{sthinsert}->finish();
+ finish_store_anomalies($hash);
}
@@ -687,6 +707,9 @@ sub prepare_store_description($) {
$hash->{packages}->{sthinsert} = $dbh->prepare(
"INSERT INTO packages (id, Package, status) VALUES( ?, ?, ? )");
+
+ prepare_store_anomalies($hash);
+
}
sub pkg_uptodate ($$) {
@@ -705,7 +729,7 @@ sub pkg_uptodate ($$) {
$l = $sth->{pkgneedupdate}->rows();
return $l;
}
- print "pkg is yet unknown, returning 0 ($l) for $pkg_id\n";
+ print "pkg_uptodate: pkg is yet unknown, returning 0 ($l) for $pkg_id\n";
return 0;
}
@@ -842,6 +866,7 @@ sub finish_store_description($) {
$hash->{packages}->{sthselect}->finish();
$hash->{packages}->{sthinsert}->finish();
+ finish_store_anomalies($hash);
}
sub clean_cannotbuild_since_last_updated($) {
More information about the pkg-bioc-devel
mailing list