[med-svn] r2251 - in trunk/community/infrastructure/getData: . debian getData.conf.d

smoe-guest at alioth.debian.org smoe-guest at alioth.debian.org
Thu Jul 17 16:21:54 UTC 2008


Author: smoe-guest
Date: 2008-07-17 16:21:54 +0000 (Thu, 17 Jul 2008)
New Revision: 2251

Added:
   trunk/community/infrastructure/getData/getData.conf.d/
Removed:
   trunk/community/infrastructure/getData/getData.d/
Modified:
   trunk/community/infrastructure/getData/TODO
   trunk/community/infrastructure/getData/debian/install
   trunk/community/infrastructure/getData/debian/rules
   trunk/community/infrastructure/getData/getData
Log:
* added --remove


Modified: trunk/community/infrastructure/getData/TODO
===================================================================
--- trunk/community/infrastructure/getData/TODO	2008-07-17 09:37:33 UTC (rev 2250)
+++ trunk/community/infrastructure/getData/TODO	2008-07-17 16:21:54 UTC (rev 2251)
@@ -1,13 +1,6 @@
 getData - TODO
 ==============
 
-* separate machinery from database descriptions
-
-  Some configuration file should be read it at the time the
-  application is started.
-
-* come up with a set of standard use cases as a start
-
 * define Debian packages and/or applications that must
   be installed prior to the execution of some scripts.
 

Modified: trunk/community/infrastructure/getData/debian/install
===================================================================
--- trunk/community/infrastructure/getData/debian/install	2008-07-17 09:37:33 UTC (rev 2250)
+++ trunk/community/infrastructure/getData/debian/install	2008-07-17 16:21:54 UTC (rev 2251)
@@ -1,2 +1,3 @@
 getData			/usr/bin
 debian/getData.conf	/etc
+getData.conf.d/*	/etc/getData.conf.d

Modified: trunk/community/infrastructure/getData/debian/rules
===================================================================
--- trunk/community/infrastructure/getData/debian/rules	2008-07-17 09:37:33 UTC (rev 2250)
+++ trunk/community/infrastructure/getData/debian/rules	2008-07-17 16:21:54 UTC (rev 2251)
@@ -2,3 +2,8 @@
   
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/makefile.mk
+
+getData.1: getData
+	$(MAKE) getData.1
+
+install:: getData.1

Modified: trunk/community/infrastructure/getData/getData
===================================================================
--- trunk/community/infrastructure/getData/getData	2008-07-17 09:37:33 UTC (rev 2250)
+++ trunk/community/infrastructure/getData/getData	2008-07-17 16:21:54 UTC (rev 2251)
@@ -70,7 +70,7 @@
 physicists, well, they haven come up with (first) the web and (second)
 the computational grids to access their problems. Debian helps with the
 programs but will not provide such huge datasets that are even frequently
-updated. Not even in volatile.debian.org. Most bioinformatics researchers
+updated - not even in volatile.debian.org. Most bioinformatics researchers
 will not need too many of such databases. And even more so will gladly
 continue in using public services remotely.
 
@@ -83,6 +83,13 @@
 all (most) communities, not only of the bioinformatics world. The seed was
 hence made with databases from astronomy.
 
+Please contact the Debian-Med community if you consider this program
+to be
+almost
+ready for your needs and explain what still needs to be added. Public
+databases that you managed to integrate with this system are also very
+warmly welcomed as feedback.
+
 =head1 OPTIONS
 
 =over 4
@@ -99,7 +106,6 @@
 
     Say one or two words more than required.
 
-
 =item --mirrordir <path>
 
     Specifies destination directory. The data will be mirrored to the folder $mirrordir/$dbname/. 
@@ -131,6 +137,10 @@
 
     Preparation of the configuration file that would be reuired for a particular system that deals with the database. The configuration is printed to stdout and is expected to be copied manually to the proper file or folder. One could imagine this process to be automated, though this is not yet implemented. Currently implemented systems are: emboss and dre. "dre" stands for "dynamic runtime environment", which is a concept of the ARC grid middleware of which more can be learned on http://www.nordugrid.org.
 
+=item --remove <list of dbnames>
+
+    This command removes folders that store the data. In principle this could be perfomed manually, though some databases may have special requirements pre- or post-removal, which can be specified individually for every database.
+
 =back
 
 =head1 EXAMPLES
@@ -151,7 +161,8 @@
 
 =head1 AUTHORS
 
-Steffen Moeller <moeller at debian.org>, Charles Plessy <debian-no-spam at plessy.org> ... and ?, from the Debian-Med packaging initiative.
+Steffen Moeller <moeller at debian.org>,
+Charles Plessy <debian-no-spam at plessy.org> ... and ?, from the Debian-Med packaging initiative.
 
 =cut
 
@@ -210,7 +221,8 @@
 
 	"jaspar" => {
 		name => "The high-quality transcription factor binding profile database",
-		source => "wget -r -nH -nd -l1 --no-parent -A.zip http://jaspar.genereg.net/html/DOWNLOAD/MatrixDir/",
+		source => "wget --recursive --no-host-directories --no-directories --level 1 --no-parent --accept .zip "
+		          . "http://jaspar.genereg.net/html/DOWNLOAD/MatrixDir/",
 	},
 
 	"jaspar.core" => {
@@ -311,7 +323,7 @@
 $mirrordir = "/var/lib/mirrored" unless defined($mirrordir);
 $confd = "/etc/getData.d" unless defined($confd);
 
-my ($post,$source,$config,$list,$help,$man,$verbose)=(undef,undef,undef,0,0,0,0);
+my ($post,$source,$removal,$config,$list,$help,$man,$verbose)=(undef,undef,undef,0,0,0,0);
 
 my %options=("mirrordir:s" => \$mirrordir,
 	     "list" => \$list,
@@ -320,10 +332,11 @@
 	     "post"=>\$post,
 	     "confd"=>\$confd,
 	     "config:s@"=>\$config,
+	     "remove"=>\$removal,
 	     "source"=>\$source);
 
 
-my ($do_source,$do_post,$do_config)=(1,1,0);
+my ($do_source,$do_post,$do_config,$do_removal)=(1,1,0,0);
 
 
 sub myhelp () {
@@ -345,24 +358,37 @@
 print "post: $post, source: $source\n" if $verbose;
 
 if ($post) {
-	print "disabling retrieval of database updates.\n";
+	print "solely enabling post-download operations, disabling retrieval of database updates and removal.\n";
 	$do_source=0;
 	$do_post=1;
 	$do_config=0;
+	$do_removal=0;
 }
+
 if ($source) {
-	print "disabling unpacking and indexing.\n";
+	print "solely enabling download, disabling unpacking, configuration, indexing and removal.\n";
 	$do_post=0;
 	$do_source=1;
 	$do_config=0;
+	$do_removal=0;
 }
+
 if ($config) {
-	print "disabling retrieval of updates and their unpacking/indexing.\n";
+	print "solely enabling database configuration for external systems, disabling retrieval of updates, the removal and their unpacking/indexing.\n";
 	$do_post=0;
 	$do_source=0;
+	$do_removal=0;
 	$do_config=1;
 }
 
+if ($removal) {
+	print "enabling removal, disabling retrieval of updates, the configuration and their unpacking/indexing.\n";
+	$do_post=0;
+	$do_source=0;
+	$do_config=0;
+	$do_removal=1;
+}
+
 if ($verbose) {
 	foreach my $o (keys %options) {
 		print "$o => " . ${$options{$o}}."\n";
@@ -456,7 +482,6 @@
 	}
 
 	print STDERR "\"$db\" -> \"$mirrordir\"\n";
-	print "Mirroring ".$toBeMirrored{$db}{"name"}." ($db)\n";
 
 	unless ( -d "$mirrordir/$db" ) {
 		if ($do_source) {
@@ -471,6 +496,7 @@
 	chdir("$mirrordir/$db") or die "Could not change directory to \"$mirrordir/$db\"\n";
 
 	if ($do_source) {
+		print "Mirroring ".$toBeMirrored{$db}{"name"}." ($db)\n";
 		my $cmd = $toBeMirrored{$db}{"source"};
 		if (!defined ($cmd) or "" eq $cmd) {
 			print STDERR "$db: download instructions not specified - skipping.\n";
@@ -481,14 +507,46 @@
 	}
 
 	if ($do_post) {
+		print "Executing post-download scripts for ".$toBeMirrored{$db}{"name"}." ($db)\n";
 		my $cmd = $toBeMirrored{$db}{"post-download"};
 		if ( defined($cmd) and "" ne $cmd) {
 			print STDERR "$cmd\n";
-			system($cmd) and die "Experienced problem.";
+			system($cmd) and die "$db: post-download: Experienced problem.";
 		}
 		else {
 			print STDERR "$db: No post-download command defined.\n" if $verbose;
 		}
 	}
+
+	if ($do_removal) {
+		print "Removal of ".$toBeMirrored{$db}{"name"}." ($db)\n";
+		if (exists($toBeMirrored{$db}{"pre-removal"})) {
+			my $cmd = $toBeMirrored{$db}{"pre-removal"};
+			print "Performing: '$cmd'\n" if $verbose;
+			if (defined($cmd)) {
+				system($cmd) and die "$db: pre-removal: Experienced problem while executing '$cmd': $@\n";
+			}
+		}
+		
+		# This will be performed one way or the other
+		my $cmd="";
+		if (exists($toBeMirrored{$db}{"removal"})) {
+			$cmd = $toBeMirrored{$db}{"removal"};
+		}
+		else {
+			$cmd = "rm -rf \"$mirrordir/$db\"";
+		}
+		print "Performing: '$cmd'\n" if $verbose;
+		system($cmd) and die "$db: removal: Experienced problem while executing '$cmd': $@\n";
+		if (exists($toBeMirrored{$db}{"post-removal"})) {
+			my $cmd = $toBeMirrored{$db}{"post-removal"};
+			print "Performing: '$cmd'\n" if $verbose;
+			if (defined($cmd)) {
+				my $cmd = $toBeMirrored{$db}{"post-removal"};
+				system($cmd) and die "$db: post-removal: Experienced problem while executing '$cmd': $@\n";
+			}
+		}
+	}
+
 	chdir($d) or die "Could not change back to dir '$d'.\n";
 }

Copied: trunk/community/infrastructure/getData/getData.conf.d (from rev 2248, trunk/community/infrastructure/getData/getData.d)


Property changes on: trunk/community/infrastructure/getData/getData.conf.d
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the debian-med-commit mailing list