[pkg-bioc] svn commit r345 r345 - in /branches/tools-ng: r_pkg_prepare.sh r_pkg_update.pl storage.pm
psychedelys-guest at users.alioth.debian.org
psychedelys-guest at users.alioth.debian.org
Sat Oct 13 13:30:58 UTC 2007
Author: psychedelys-guest
Date: Sat Oct 13 13:30:58 2007
New Revision: 345
URL: http://svn.debian.org/wsvn/pkg-bioc/?sc=1&rev=345
Log:
the sql parameters are now in the autogenerate file
Modified:
branches/tools-ng/r_pkg_prepare.sh
branches/tools-ng/r_pkg_update.pl
branches/tools-ng/storage.pm
Modified: branches/tools-ng/r_pkg_prepare.sh
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/r_pkg_prepare.sh?rev=345&op=diff
==============================================================================
--- branches/tools-ng/r_pkg_prepare.sh (original)
+++ branches/tools-ng/r_pkg_prepare.sh Sat Oct 13 13:30:58 2007
@@ -33,6 +33,13 @@
# Are actually working : PBuilder CowBuilder
installMethods="CowBuilder"
+# SQL parameters :
+
+sqlip='192.168.44.33'
+sqldbname="pkgbioc"
+sqlusername="pkgbioc"
+sqluser_password="pkgbioc"
+
### END TO EDIT, START MODE READ-ONLY!!!
# Name of the file where I store my intermediate variable.
@@ -525,6 +532,22 @@ echo -n "\$patchessourcedir = '" >> ${AU
echo -n ${patchessourcedir} >> ${AUTOVARS}
echo "';" >> ${AUTOVARS}
+echo "### SQL zone"
+echo -n "\$sqlip = '" >> ${AUTOVARS}
+echo -n ${sqlip} >> ${AUTOVARS}
+echo "';" >> ${AUTOVARS}
+
+echo -n "\$sqldbname = '" >> ${AUTOVARS}
+echo -n ${sqldbname} >> ${AUTOVARS}
+echo "';" >> ${AUTOVARS}
+
+echo -n "\$sqlusername = '" >> ${AUTOVARS}
+echo -n ${sqlusername} >> ${AUTOVARS}
+echo "';" >> ${AUTOVARS}
+
+echo -n "\$sqluser_password = '" >> ${AUTOVARS}
+echo -n ${sqluser_password} >> ${AUTOVARS}
+echo "';" >> ${AUTOVARS}
# Ok, here it's a dirty hack !
Modified: branches/tools-ng/r_pkg_update.pl
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/r_pkg_update.pl?rev=345&op=diff
==============================================================================
--- branches/tools-ng/r_pkg_update.pl (original)
+++ branches/tools-ng/r_pkg_update.pl Sat Oct 13 13:30:58 2007
@@ -160,15 +160,6 @@ $VERSION = $1;
( $name = $0 ) =~ s|.*/||;
print("$name rev:$VERSION\n");
-# SQL Stuff
-my $ip = '192.168.44.33';
-my $dbname = "pkgbioc";
-my $username = "pkgbioc";
-my $user_password = "pkgbioc";
-
-init_storage( "DBI:mysql:dbname=$dbname;host=$ip", $username, $user_password );
-start_tracking( $name, $VERSION );
-
my %options = (
"help" => \$help,
"man" => \$man,
@@ -203,13 +194,15 @@ use vars qw(
$AptAliothSourcesList $AptAliothStateDir $AptAliothDpkgDir
$AptAliothCacheDir $AptAliothParams
$currentpackage
+
+ $sqlip $sqldbname $sqlusername $sqluser_password
);
my $RepositoryList = ();
use vars qw( $needpackagebefore );
# auto Load the values of variables from the files.
-sub loadfile {
+sub loadfile () {
die "Variable File not found: $autogeneratevariable. Did you run "
. "r_pkg_prepare ??"
if ( !-f $autogeneratevariable );
@@ -237,6 +230,11 @@ sub loadfile {
# Loading the autogenerated files
&loadfile();
+# SQL Stuff (need ip, username, password,... from &loadfile)
+init_storage( "DBI:mysql:dbname=$sqldbname;host=$sqlip",
+ $sqlusername, $sqluser_password );
+start_tracking( $name, $VERSION );
+
installation_methods( $installMethods, "update" )
if ($dobuilderupdate);
Modified: branches/tools-ng/storage.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/branches/tools-ng/storage.pm?rev=345&op=diff
==============================================================================
--- branches/tools-ng/storage.pm (original)
+++ branches/tools-ng/storage.pm Sat Oct 13 13:30:58 2007
@@ -287,7 +287,7 @@ sub start_tracking($$) {
$sthselect->execute($deamon)
or die "Couldn't execute statement: " . $sthselect->errstr;
- my ($l) = @{ $sthselect->fetchrow_arrayref };
+ my $l = $sthselect->rows;
if ( $l == 0 ) {
print "inserting $deamon\n";
$sthinsert->execute( $deamon, $version, "now()" )
@@ -295,9 +295,13 @@ sub start_tracking($$) {
}
else {
+
+# TODO add a test : if sql start date is bigger than sql stop date , exit, as an other version is still running.
+# add a --force-start for forcing start-up. this will be seen mainly if the script is stop with ctrl-C
+
$sthselectversion->execute( $deamon, $version )
or die "Couldn't execute statement: " . $sthselectversion->errstr;
- my ($j) = @{ $sthselectversion->fetchrow_arrayref };
+ my $j = $sthselectversion->rows;
if ( $j == 0 ) {
$sthupdateversion->execute( "now()", $version, $deamon )
or die "Couldn't execute statement: " . $sthupdateversion->errstr;
@@ -623,8 +626,7 @@ sub finish_store_source($) {
}
-sub clean_cannotbuild_since_last_updated($)
-{
+sub clean_cannotbuild_since_last_updated($) {
my ( $name ) = @_;
if ( !$dbh ) {
print "Cannot work, I am not connected\n";
@@ -640,6 +642,7 @@ sub clean_cannotbuild_since_last_updated
print "There is $l too old cannot build\n";
+ # TODO : drop them...
$sthselect->finish();
More information about the pkg-bioc-devel
mailing list