[pkg-bioc] svn commit r311 r311 - /trunk/tools/r_pkg_update.pl
psychedelys-guest at users.alioth.debian.org
psychedelys-guest at users.alioth.debian.org
Sat Sep 15 17:52:02 UTC 2007
Author: psychedelys-guest
Date: Sat Sep 15 17:52:02 2007
New Revision: 311
URL: http://svn.debian.org/wsvn/pkg-bioc/?sc=1&rev=311
Log:
removed a nug in the comparaison + added some comment and more check
Modified:
trunk/tools/r_pkg_update.pl
Modified: trunk/tools/r_pkg_update.pl
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools/r_pkg_update.pl?rev=311&op=diff
==============================================================================
--- trunk/tools/r_pkg_update.pl (original)
+++ trunk/tools/r_pkg_update.pl Sat Sep 15 17:52:02 2007
@@ -147,9 +147,9 @@ use IPC::Open3;
use IO::Handle;
use Text::ParseWords;
-use Cwd;
use LWP::Simple;
+# To read the R description file automatically
use R::Dcf;
#
@@ -158,6 +158,7 @@ use pkgbioc;
# unbuffered output:
$| = 1;
+# TODO update it to make it working with SVN....
my $VERSION = sprintf( "%d.%d", q$Revision: 1.28 $ =~ /(\d+)\.(\d+)/ );
my %options = (
@@ -622,8 +623,12 @@ sub EnsureExtractDescription($) {
my ( $head_pkg, $version_pkg, $tail_pkg ) = &decomposition($pkg);
- # print "$pkg is ($head_pkg, $version_pkg, $tail_pkg)\n" if $debug;
+ print " Extracting DESCRIPTION from $pkg ($head_pkg, $version_pkg, $tail_pkg)\n" if $debug;
+ if ( ( $head_pkg =~ "undef" ) || ( $version_pkg =~ "undef" ) || ( $tail_pkg =~ "undef" ) ) {
+ print "some part of $pkg are undef after the decomposition, is it an archive ?\n";
+ return 1;
+ }
if ( -f "Descriptions/" . $head_pkg . ".DESCRIPTION" ) {
#CRAN should take care of it, in theory !
@@ -642,6 +647,15 @@ sub EnsureExtractDescription($) {
print STDERR "Extracting the DESCRIPTION file for package $pkg\n"
if $verbose;
+ if ( $pkg !~ /\.tar\.gz/ ) {
+ print STDERR "Skipping extraction of the DESCRIPTION for $pkg,"
+ ." is it a tar.gz ?\n";
+ return 1;
+
+ }
+ else {
+
+
if (
0 != system(
"cd Descriptions/"
@@ -687,6 +701,7 @@ sub EnsureExtractDescription($) {
}
}
}
+ }
return 0;
}
@@ -718,24 +733,24 @@ sub updateclean($) {
next;
}
- print "Humm, are we cleanning: $cur ?\n" if $debug;
+ print "Humm, are we cleanning: $cur ?\n" if $verbose;
my $return = theSame( $cur, $prev );
- print
-"My return value of the comparison between '$prev' and '$cur' is $return\n"
- if $debug;
+ print "My return value of the comparison between "
+ ."'$prev' and '$cur' is $return\n"
+ if $verbose;
- if ( $return == 1 ) {
+ if ( $return == -1 ) {
$stay = $cur;
$toremove = $prev;
- print "Now \$stay('$stay') contains \$cur('$cur')\n";
- print "Now \$toremove('$toremove') contains \$prev('$prev')\n";
+ print "Now \$stay('$stay') contains \$cur('$cur')\n" if $verbose;
+ print "Now \$toremove('$toremove') contains \$prev('$prev')\n" if $verbose;
}
- elsif ( $return == -1 ) {
+ elsif ( $return == 1 ) {
$stay = $prev;
$toremove = $cur;
- print "Now \$stay('$stay') contains \$prev('$prev')\n";
- print "Now \$toremove('$toremove') contains \$cur('$cur')\n";
+ print "Now \$stay('$stay') contains \$prev('$prev')\n" if $verbose;
+ print "Now \$toremove('$toremove') contains \$cur('$cur')\n" if $verbose;
}
elsif ( $return == 0 ) {
$stay = $cur;
More information about the pkg-bioc-devel
mailing list