[pkg-bioc] svn commit r353 r353 - in /branches/tools-ng: pkgbioc.pm storage.pm
psychedelys-guest at users.alioth.debian.org
psychedelys-guest at users.alioth.debian.org
Sun Oct 21 20:29:13 UTC 2007
Author: psychedelys-guest
Date: Sun Oct 21 20:29:13 2007
New Revision: 353
URL: http://svn.debian.org/wsvn/pkg-bioc/?sc=1&rev=353
Log:
beta version of r_pkg_ordering, still a strange bug in storage.pm:557
Modified:
branches/tools-ng/pkgbioc.pm
branches/tools-ng/storage.pm
Modified: branches/tools-ng/pkgbioc.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/pkgbioc.pm?rev=353&op=diff
==============================================================================
--- branches/tools-ng/pkgbioc.pm (original)
+++ branches/tools-ng/pkgbioc.pm Sun Oct 21 20:29:13 2007
@@ -344,6 +344,8 @@ sub populate_description($$$$$) {
my $bfile = basename($cur);
my ( $head_pkg, $version_pkg, $tail_pkg ) = decomposition($bfile);
+ print "=========\nActing on $head_pkg\n";
+
my ( $pkg_id, $pkg_repoid, $mainrepo ) =
get_package_info( $sth, $head_pkg );
if ( ( $pkg_id == -1 ) || ( $pkg_repoid == -1 ) ) {
@@ -352,6 +354,10 @@ sub populate_description($$$$$) {
. " but with an associated repository $mainrepo ($pkg_repoid),....\n";
next;
}
+
+ print " getting an pkg_id $pkg_id for $head_pkg,"
+ . " with an associated repository $mainrepo ($pkg_repoid),....\n";
+
if ( pkg_uptodate( $sth, $pkg_id ) ) {
print "this package $head_pkg ($pkg_id)"
. " is already up-to-date, skipping...\n";
@@ -567,25 +573,29 @@ sub adddependencies ($$$$$$) {
if $main::verbose;
if ( exists $global->{AlreadyinDebian}->{$pkg} ) {
- if ( $global->{AlreadyinDebian}->{$pkg} =~ "baselibs" ) {
+ if ( $global->{AlreadyinDebian}->{$pkg} =~ /baselibs/ ) {
next;
}
- if ( $global->{AlreadyinDebian}->{$pkg} =~ "reclibs" ) {
+ if ( $global->{AlreadyinDebian}->{$pkg} =~ /reclibs/ ) {
insert_if_not_found_dependencies_by_name( $sth, $pkg_id,
"r-recommended" );
+ next;
}
- elsif ( $global->{AlreadyinDebian}->{$pkg} =~ "vrlibs" ) {
+ elsif ( $global->{AlreadyinDebian}->{$pkg} =~ /vrlibs/ ) {
insert_if_not_found_dependencies_by_name( $sth, $pkg_id,
"r-cran-vr" );
+ next;
}
- elsif ( $global->{AlreadyinDebian}->{$pkg} =~ "gregmisc" ) {
+ elsif ( $global->{AlreadyinDebian}->{$pkg} =~ /gregmisc/ ) {
insert_if_not_found_dependencies_by_name( $sth, $pkg_id,
"gregmisc" );
+ next;
}
elsif ( $global->{AlreadyinDebian}->{$pkg} =~ "ignore" ) {
+ next;
}
}
@@ -634,7 +644,8 @@ sub adddependencies ($$$$$$) {
. "So I am making it unbuildable.\n";
insert_update_cannotbuild( $sth, $pkg_id,
- "in manually curated, unknown dependencies $pkg" );
+ "in manually curated, unknown dependencies "
+ . $pkg );
}
else {
print STDERR "$package: unknown package $pkg."
@@ -642,7 +653,7 @@ sub adddependencies ($$$$$$) {
. "So I am making it unbuildable.\n";
insert_update_cannotbuild( $sth, $pkg_id,
- "unknown dependencies $pkg" );
+ "unknown dependencies " . $pkg );
}
next;
}
@@ -671,43 +682,33 @@ sub adddependencies ($$$$$$) {
}
}
- elsif ( $pkg =~ /-dev$/ ) {
+ elsif ( ( $pkg =~ /-dev$/ ) || ( $pkg =~ /^lib/ ) ) {
+
+ if ( exists( $main::cache_debian->{$pkg} ) ) {
# This is a library that is required for the build process
insert_if_not_found_ext_dependencies_by_name( $sth, $pkg_id,
$pkg );
}
- elsif ( $pkg =~ /^lib/ ) {
-
- insert_if_not_found_ext_dependencies_by_name( $sth, $pkg_id,
- $pkg );
-
+ else {
+ print "I do not found this dependencies $pkg on the debian"
+ . " cache, skipping this dependencies\n";
+ }
}
else {
if ($manuallycurated) {
-
- print STDERR
- "in manually curated builddependencies for $package\n";
- print STDERR
- "\tI am pushing the $pkg as I do not know it.\n";
+ print "in manually curated builddependencies for"
+ . "$package\n";
+ }
# check against apt-cache
if ( exists( $main::cache_debian->{$pkg} ) ) {
- insert_if_not_found_ext_dependencies_by_name( $sth,
- $pkg_id, $pkg );
- }
- else {
- insert_update_cannotbuild( $sth, $pkg_id,
- "unknown dependencies $pkg" );
- }
- }
- else {
+ print "\tI am pushing the $pkg "
+ . "as I able to find it on the debian archive.\n";
- # check against apt-cache
- if ( exists( $main::cache_debian->{$pkg} ) ) {
- insert_if_not_found_ext_dependencies_by_name( $sth,
- $pkg_id, $pkg );
+ insert_if_not_found_ext_dependencies_by_name( $sth, $pkg_id,
+ $pkg );
}
else {
print STDERR "$package: unknown package $pkg."
@@ -715,8 +716,7 @@ sub adddependencies ($$$$$$) {
. " So I am making it unbuildable.\n";
insert_update_cannotbuild( $sth, $pkg_id,
- "unknown dependencies $pkg" );
- }
+ "unknown dependencies " . $pkg );
}
}
}
Modified: branches/tools-ng/storage.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/storage.pm?rev=353&op=diff
==============================================================================
--- branches/tools-ng/storage.pm (original)
+++ branches/tools-ng/storage.pm Sun Oct 21 20:29:13 2007
@@ -179,15 +179,15 @@ sub init_storage($$$) {
#
$sql = qq{ CREATE TABLE IF NOT EXISTS packages (
id INTEGER PRIMARY KEY NOT NULL,
- Author TEXT NOT NULL,
- Package TEXT NOT NULL,
- Date TEXT NOT NULL,
- Description TEXT NOT NULL,
- License TEXT NOT NULL,
- Title TEXT NOT NULL,
- Imports TEXT,
- URL TEXT NOT NULL,
- biocViews TEXT,
+ Author TEXT DEFAULT NULL,
+ Package TEXT DEFAULT NULL,
+ Date TEXT DEFAULT NULL,
+ Description TEXT DEFAULT NULL,
+ License TEXT DEFAULT NULL,
+ Title TEXT DEFAULT NULL,
+ Imports TEXT DEFAULT NULL,
+ URL TEXT DEFAULT NULL,
+ biocViews TEXT DEFAULT NULL,
isBinary BOOLEAN NOT NULL,
status ENUM('unknown','error','clean','unclean'),
FOREIGN KEY (id) REFERENCES packagesupdate(id)
@@ -197,7 +197,7 @@ sub init_storage($$$) {
#list of dependencies of a package
$sql = qq{ CREATE TABLE IF NOT EXISTS dependencies (
- id INTEGER PRIMARY KEY NOT NULL,
+ id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
pkg_id INTEGER NOT NULL,
depend_id INTEGER NOT NULL,
FOREIGN KEY (pkg_id) REFERENCES packagesupdate(id),
@@ -209,7 +209,7 @@ sub init_storage($$$) {
# list of suggestion for a package.
$sql = qq{ CREATE TABLE IF NOT EXISTS suggested (
- id INTEGER PRIMARY KEY NOT NULL,
+ id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
pkg_id INTEGER NOT NULL,
suggest_id INTEGER NOT NULL,
FOREIGN KEY (pkg_id) REFERENCES packagesupdate(id),
@@ -221,7 +221,7 @@ sub init_storage($$$) {
# list of recommanded for a package.
$sql = qq{ CREATE TABLE IF NOT EXISTS recommended (
- id INTEGER PRIMARY KEY NOT NULL,
+ id INTEGER AUTO_INCREMENT PRIMARY KEY NOT NULL,
pkg_id INTEGER NOT NULL,
recommend_id INTEGER NOT NULL,
FOREIGN KEY (id) REFERENCES packagesupdate(id),
@@ -552,6 +552,8 @@ sub insert_if_not_found_anomalies ($$) {
}
$dbh->prepare("BEGIN TRANSACTION ");
+ print " Looking for '$name'\n";
+
$sth->{anomalies}->{sthselect}->execute($name)
or die "Couldn't execute statement: "
. $sth->{anomalies}->{sthselect}->errstr;
@@ -565,16 +567,22 @@ sub insert_if_not_found_anomalies ($$) {
$sth->{anomalies}->{sthselect}->execute($name)
or die "Couldn't execute statement: "
. $sth->{anomalies}->{sthselect}->errstr;
+ $l = $sth->{anomalies}->{sthselect}->rows();
+ if ( $l == 1 ) {
($anomaly_id) =
@{ $sth->{anomalies}->{sthselect}->fetchrow_arrayref() };
}
+ else {
+ die "Error smoking commit\n";
+ }
+ }
elsif ( $l == 1 ) {
($anomaly_id) =
@{ $sth->{anomalies}->{sthselect}->fetchrow_arrayref() };
}
else {
- die
-"Should not have severals line, this is excluded by the SQL constraint\n";
+ die "Should not have severals line,"
+ . " this is excluded by the SQL constraint\n";
}
$dbh->prepare("COMMIT TRANSACTION ");
@@ -691,7 +699,7 @@ sub pkg_uptodate ($$) {
my $l = $sth->{pkgexist}->rows();
if ( $l == 1 ) {
my @row = $sth->{pkgexist}->fetchrow_array();
- print "values :" . join( ",", @row ) . "\n";
+ print "values id $row[0] \n";
$sth->{pkgneedupdate}->execute($pkg_id)
or die "Couldn't execute statement: " . $sth->{pkgneedupdate}->errstr;
$l = $sth->{pkgneedupdate}->rows();
@@ -716,7 +724,7 @@ sub get_package_info($$) {
my $l = $sth->{getid}->rows();
if ( $l == 0 ) {
print
-" ERROR, THIS SHOULD NEVER APPEND. I DO NO KNOW THE ID OF THIS PACKAGE";
+" ERROR, THIS SHOULD NEVER APPEND. I DO NO KNOW THE ID OF THIS PACKAGE ($name)\n";
}
else {
($pkg_id) = @{ $sth->{getid}->fetchrow_arrayref() };
@@ -726,7 +734,7 @@ sub get_package_info($$) {
my $l = $sth->{getrepoid}->rows();
if ( $l == 0 ) {
print
-" ERROR, THIS SHOULD NEVER APPEND. I DO NO KNOW THE REPO OF THIS PACKAGE";
+" ERROR, THIS SHOULD NEVER APPEND. I DO NO KNOW THE REPO OF THIS PACKAGE ($name, $pkg_id)\n";
}
else {
($pkg_repoid) = @{ $sth->{getrepoid}->fetchrow_arrayref() };
@@ -737,7 +745,7 @@ sub get_package_info($$) {
my $l = $sth->{getreponame}->rows();
if ( $l == 0 ) {
print " ERROR, THIS SHOULD NEVER APPEND."
- . " I DO NO KNOW THE REPONAME OF THIS PACKAGE\n";
+ . " I DO NO KNOW THE REPONAME OF THIS PACKAGE ($name, $pkg_id, $pkg_repoid)\n";
}
else {
($pkg_reponame) = @{ $sth->{getreponame}->fetchrow_arrayref() };
@@ -753,24 +761,20 @@ sub prestore_description_package ($$) {
if ( !$dbh ) {
print "Cannot work, I am not connected\n";
}
- $sth->{package}->{sthselect}->execute( $packagehash->{pkg_id} )
+ $sth->{packages}->{sthselect}->execute( $packagehash->{pkg_id} )
or die "Couldn't execute statement: "
- . $sth->{package}->{sthselect}->errstr;
- my $l = $sth->{package}->{sthselect}->rows();
+ . $sth->{packages}->{sthselect}->errstr;
+ my $l = $sth->{packages}->{sthselect}->rows();
if ( $l == 0 ) {
$dbh->prepare("BEGIN TRANSACTION ");
- $sth->{package}->{sthinsert}->execute( $packagehash->{pkg_id},
+ $sth->{packages}->{sthinsert}->execute( $packagehash->{pkg_id},
$packagehash->{Package}, "unknown" )
or die "Couldn't execute statement: "
- . $sth->{package}->{sthinsert}->errstr;
+ . $sth->{packages}->{sthinsert}->errstr;
$dbh->prepare("COMMIT TRANSACTION ");
}
- else {
-
- }
-
}
sub insert_if_not_found_dependencies_by_id ($$$) {
@@ -785,7 +789,7 @@ sub insert_if_not_found_dependencies_by_
. $sth->{dependencies}->{sthselect}->errstr;
my $l = $sth->{dependencies}->{sthselect}->rows();
if ( $l == 0 ) {
- print "inserting ($pkg_id, $depend_id)\n";
+ print "inserting dependencies ($pkg_id, $depend_id)\n";
$dbh->prepare("BEGIN TRANSACTION ");
@@ -806,8 +810,14 @@ sub insert_if_not_found_dependencies_by_
my ( $sth, $pkg_id, $depend ) = @_;
my $depend_id = -1;
+ print
+"\tpreparing the insertion of the following dependencies $depend for $pkg_id\n";
+
$depend_id = insert_if_not_found_packagesname( $sth, $depend );
+ print
+"\tinserting the following dependencies $depend ($depend_id) for $pkg_id\n";
+
return insert_if_not_found_dependencies_by_id( $sth, $pkg_id, $depend_id );
}
More information about the pkg-bioc-devel
mailing list