[pkg-bioc] svn commit r365 r365 - in /trunk: tools-ng/deldoubles.pl tools-ng/pkgbioc.pm tools-ng/r_pkg_ordering.pl tools-ng/r_pkg_prepare.sh tools-ng/r_pkg_update.pl tools/deldoubles.pl
smoe-guest at users.alioth.debian.org
smoe-guest at users.alioth.debian.org
Sun Dec 2 15:25:38 UTC 2007
Author: smoe-guest
Date: Sun Dec 2 15:25:38 2007
New Revision: 365
URL: http://svn.debian.org/wsvn/pkg-bioc/?sc=1&rev=365
Log:
* deldoubles now apparently works
* some smaller nicifications here and there
Added:
trunk/tools-ng/deldoubles.pl (with props)
Removed:
trunk/tools/deldoubles.pl
Modified:
trunk/tools-ng/pkgbioc.pm
trunk/tools-ng/r_pkg_ordering.pl
trunk/tools-ng/r_pkg_prepare.sh
trunk/tools-ng/r_pkg_update.pl
Added: trunk/tools-ng/deldoubles.pl
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools-ng/deldoubles.pl?rev=365&op=file
==============================================================================
--- trunk/tools-ng/deldoubles.pl (added)
+++ trunk/tools-ng/deldoubles.pl Sun Dec 2 15:25:38 2007
@@ -0,0 +1,139 @@
+#!/usr/bin/perl -w
+use strict;
+use Getopt::Long;
+
+my $pattern;
+
+GetOptions("pattern:s" => \$pattern) or die "Could not read options.\n";
+
+
+my @ary = glob("*");
+
+print STDERR "Found " . ( $#ary + 1 ) . " files in current directory.\n";
+
+sub theSame {
+ my $cur = shift;
+ my $prev = shift;
+ my ($head_prev) = $prev =~ /^([.0-9A-Za-z-]+)/;
+ my ($head_cur) = $cur =~ /^([.0-9A-Za-z-]+)/;
+ my ($tail_prev) = $prev =~ /\.tar.gz|\.pl|\.log|\.^([A-Za-z.]+)$/;
+ my ($tail_cur) = $cur =~ /\.tar.gz|\.pl|\.log|\.^([A-Za-z.]+)$/;
+
+ $head_prev = "undef" unless defined($head_prev);
+ $head_cur = "undef" unless defined($head_cur);
+ $tail_prev = "undef" unless defined($tail_prev);
+ $tail_cur = "undef" unless defined($tail_cur);
+
+#print STDERR "Everything is defined between $prev ($head_prev - $tail_prev) and $cur.($head_cur - $tail_cur) \n";
+
+ return 0 if $head_prev ne $head_cur;
+ return 0 if $tail_prev ne $tail_cur;
+ return 1;
+}
+
+sub versionComparison($$) {
+ my @as=split(/\./,shift);
+ my @bs=split(/\./,shift);
+ foreach my $a (@as) {
+ my $b=shift @bs;
+ return 1 unless defined($b);
+ my $c = ($a <=> $b);
+ return($c) if ($c != 0);
+ }
+ my $b=shift @bs;
+ return (-1)if defined($b);
+ return (0);
+}
+
+sub removeThemAll($$) {
+ my ($packagename, $version)=@_;
+ my @debs = grep(/^r-([^-]+)-$packagename-$version/, at ary);
+ foreach my $d (@debs) {
+ print "d\n";
+ }
+
+ my @files = grep(/^${packagename}_${version}/, at ary);
+ foreach my $f (@files) {
+ if ( -d $f) {
+ print "$f\n";
+ }
+ else {
+ print "$f\n";
+ }
+ }
+}
+
+my %packages;
+
+my $prev = "";
+foreach my $cur (@ary) {
+
+ if (defined($pattern)) {
+ next unless $cur =~ /$pattern/i;
+ }
+
+ next unless defined($cur);
+
+ my ($packagename,$version)=$cur =~ /([^_]+)_(.*)(\.log|\.orig.tar.gz|-[^-]+)/;
+# print STDERR "$packagename ($version)\n";
+
+ if (!defined($packagename)) {
+ print STDERR "Could not parse '$cur' to retrieve package and version info.\n";
+ next;
+ }
+
+ if (! exists($packages{$packagename})) {
+# print STDERR "Creating entry for '$packagename'.\n";
+ $packages{$packagename}={};
+ }
+ else {
+# print STDERR "Found entry for '$packagename'.\n";
+ }
+
+ my $packagehashref = $packages{$packagename};
+ if (! exists($packagehashref->{$version})) {
+# print STDERR "Creating entry for '$packagename' version $version.\n";
+ $packagehashref->{$version}=[];
+ }
+ else {
+# print STDERR "Found entry for '$packagename' version $version.\n";
+ }
+
+ my $arrayref = $packagehashref->{$version};
+
+ push @$arrayref, $cur;
+}
+
+foreach my $packagename (keys %packages) {
+ my $versionshashref = $packages{$packagename};
+ my @versions = sort {versionComparison($b,$a)} keys %$versionshashref;
+ if ($#versions>0) {
+ print STDERR "$packagename has "
+ . at versions." many different versions: "
+ . join(", ", at versions)."\n";
+ foreach my $v (@versions) {
+ if (exists($versionshashref->{versionToKeep})) {
+ if ("$v" eq $versionshashref->{versionToKeep}) {
+ # should not happen
+ next;
+ }
+ else {
+ print STDERR "Should be removed: $packagename version $v.\n";
+ removeThemAll($packagename,$v);
+ }
+ }
+ elsif (grep(/r-([^-]+)-$packagename-$v/, at ary)) {
+ $versionshashref->{versionToKeep}=$v;
+ print STDERR "Should be kept: $packagename version $v.\n";
+ next;
+ }
+ elsif ($versions[0] eq "$v") {
+ print STDERR "Kept, latest version is apparently a build failure: $packagename version $v.\n";
+ }
+ else {
+ print STDERR "Removed: A build failure but not latest version: $packagename version $v.\n";
+ removeThemAll($packagename,$v);
+ }
+ }
+ }
+}
Propchange: trunk/tools-ng/deldoubles.pl
------------------------------------------------------------------------------
svn:executable = *
Modified: trunk/tools-ng/pkgbioc.pm
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools-ng/pkgbioc.pm?rev=365&op=diff
==============================================================================
--- trunk/tools-ng/pkgbioc.pm (original)
+++ trunk/tools-ng/pkgbioc.pm Sun Dec 2 15:25:38 2007
@@ -133,13 +133,13 @@ sub check_requirement ($$$$$$) {
$needpackagebefore->{'libapt-pkg-perl'} = "nop";
$needpackagebefore->{'libgraph-perl'} = "nop";
- $needpackagebefore->{'r-base-core'} = "nop";
- $needpackagebefore->{'subversion'} = "nop";
+ $needpackagebefore->{'r-base-core'} = "nop"; # why if pbuilder is used?
+ $needpackagebefore->{'subversion'} = "nop"; # why?
$needpackagebefore->{'r-base-dev'} = "nop";
- $needpackagebefore->{'dpatch'} = "nop";
- $needpackagebefore->{'cdbs'} = "nop";
+ $needpackagebefore->{'dpatch'} = "nop"; # why if pbuilder is used?
+ $needpackagebefore->{'cdbs'} = "nop"; # why if pbuilder is used?
- if ( !$QAcheck ) {
+ if ( $QAcheck ) {
$needpackagebefore->{'lintian'} = "nop";
$needpackagebefore->{'linda'} = "nop";
}
@@ -477,6 +477,15 @@ sub descriptionfile ($$$) {
my ( $directory, $sources, $pkg ) = @_;
my ( $head_pkg, $version_pkg, $tail_pkg ) = &decomposition($pkg);
+ die "pkgbioc: Could not find directory '../$directory' from cwd '".getcwd()."\n"
+ unless -d "../$directory";
+
+ die "pkgbioc: Could not find folder with sources expected at directory '../$directory/$sources' from cwd '".getcwd()."\n"
+ unless -d "../$directory/$sources";
+
+ die "pkgbioc: Could not find folder with descriptions expected at directory '../$directory/$sources/Descriptions' from cwd '".getcwd()."\n"
+ unless -d "../$directory/$sources/Descriptions";
+
if ( -f "../"
. $directory . "/"
. $sources
@@ -508,6 +517,7 @@ sub descriptionfile ($$$) {
. $version_pkg
. ".DESCRIPTION";
}
+ # TODO: The return value seems unappropiate and is not properly treated.
return 0;
}
@@ -939,8 +949,8 @@ sub loadDescriptionsForPackage($$$$$$$)
my $descriptionfile = descriptionfile( $directory, $sources, $pkg );
if ( !-f $descriptionfile ) {
- print STDERR "the description files $descriptionfile"
- . " for this packages $pkg has not been found\n";
+ print STDERR "The description file $descriptionfile"
+ . " for packages '$pkg' has not been found.\n";
$packagehashref->{DebName} = lc( $packagehashref->{Package} );
$packagehashref->{DebVersion} = "0.undef";
$packagehashref->{DebRelease} = "0.undef";
Modified: trunk/tools-ng/r_pkg_ordering.pl
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools-ng/r_pkg_ordering.pl?rev=365&op=diff
==============================================================================
--- trunk/tools-ng/r_pkg_ordering.pl (original)
+++ trunk/tools-ng/r_pkg_ordering.pl Sun Dec 2 15:25:38 2007
@@ -589,6 +589,20 @@ foreach my $package (@nodes) {
my $directory = directoryof($repository);
my $debname = "r-$repository-" . $packagehashref->{DebName};
my $builddirectory = "../" . $directory . "/" . $builds . "/";
+
+ # additional test because of disappearing build directories
+ foreach my $ttt (("cran","bioc","omegahat")) {
+ my $bd = "../".directoryof($ttt)."/".$builds;
+ if ( ! -d $bd ) {
+ die "Could not find build directory at '$builddirectory' for $ttt.\n";
+ }
+ }
+
+ unless (exists($packagehashref->{DebDir})) {
+ print "Mysterious error: \packagehashref->{DebDir} is undefined. Skipping package $package.\n";
+ next;
+ }
+
$packagehashref->{BuildDir} = $builddirectory . $packagehashref->{DebDir};
my $debfile =
$builddirectory
@@ -757,9 +771,8 @@ foreach my $package (@nodes) {
# expand archives for package building
if (
- 0 != system(
- "ln -sf ../$packagehashref->{TarGz} "
- . $builddirectory
+ 0 != system("cd $builddirectory && "
+ . "ln -sf ../".$packagehashref->{TarGz}." "
. $origsourcefile
)
)
@@ -772,9 +785,9 @@ foreach my $package (@nodes) {
}
# extracting the sources directory
- if ( 0 != system("cd $builddirectory ; tar xzf $origsourcefile") ) {
+ if ( 0 != system("cd $builddirectory && tar xzf $origsourcefile") ) {
print "Cannot unpack $origsourcefile" . ", skipping package.\n";
- print "cd $builddirectory ; tar xzf $origsourcefile\n";
+ print "cd $builddirectory && tar xzf $origsourcefile\n";
MarkedPackageUnbuildable( $packagehashref, \%globalstuff, $g,
"Cannot unpack $origsourcefile" );
next;
@@ -907,12 +920,12 @@ print HTML "<hr />\n";
print HTML "The list of unbuildable package are:\n";
foreach my $k ( sort { lc($a) cmp lc($b) } keys %{ $globalstuff{cannotbuild} } )
{
- print "<pre>";
+ print HTML "<pre>";
print HTML "$k: \n";
foreach my $a ( @{ $globalstuff{cannotbuild}{$k} } ) {
print HTML "\t:$a\n";
}
- print "</pre>\n";
+ print HTML "</pre>\n";
print HTML "<hr />\n";
}
HTML->close;
Modified: trunk/tools-ng/r_pkg_prepare.sh
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools-ng/r_pkg_prepare.sh?rev=365&op=diff
==============================================================================
--- trunk/tools-ng/r_pkg_prepare.sh (original)
+++ trunk/tools-ng/r_pkg_prepare.sh Sun Dec 2 15:25:38 2007
@@ -250,6 +250,7 @@ if [ ! -r "${webdir}/index.html" ]; then
<html>
<head>
<title>Server for Debian packages for BioConductor</title>
+<link rel="shortcut icon" type="image/x-icon" href="http://www.debian.org/favicon.ico">
</head>
<body>
<h1>Debian Packages for BioConductor</h1>
Modified: trunk/tools-ng/r_pkg_update.pl
URL: http://svn.debian.org/wsvn/pkg-bioc/trunk/tools-ng/r_pkg_update.pl?rev=365&op=diff
==============================================================================
--- trunk/tools-ng/r_pkg_update.pl (original)
+++ trunk/tools-ng/r_pkg_update.pl Sun Dec 2 15:25:38 2007
@@ -301,7 +301,7 @@ sub R_update($$$$) {
my ( $destdir, $mirror, $loc, $path, $debug_mode ) = @_;
my ( $RIN, $ROUT, $RERR );
- my $RPID = open3( $RIN, $ROUT, $RERR, 'R', '--no-save' );
+ my $RPID = open3( $RIN, $ROUT, $RERR, 'R', '--no-save', '--vanilla' );
print "R process id: $RPID\n" if $verbose;
# This following R code originated from the BioConductor community.
More information about the pkg-bioc-devel
mailing list