| Store | Cart

Re: Package installation: "Generating HTML..."

From: Serguei Trouchelle <s...@railways.dp.ua>
Fri, 23 Apr 2010 12:50:50 +0400
Hello,

more...@libero.it wrote:

> The problem is this: when I install a package (for example BioPerl),> everything works fine until I see the message "Generating HTML...". At that> point everything freezes and PPM never finishes the installation.

After every ActivePerl install I run attached script. It completely removes HTML generation, saving me a lot of time.

-- 
Serguei Trouchelle

#!/usr/bin/perl

use strict;
use warnings;
use DBI;

my $perlbin = substr($^X, 0, rindex $^X, '\\');
my $perl = substr($perlbin, 0, rindex $perlbin, '\\');

# Patch Documentation Generation:
#  ActivePerl::DocTools::UpdateHTML_blib(verbose => 0, blib => "$pname/blib");
#  sub UpdateHTML_blib {
my $DocTools = $perl . '/lib/ActivePerl/DocTools.pm';

print "Remove HTML generation\n";

if (-e $DocTools) {
    chmod 0666, $DocTools;

    if (open(FI, '<', $DocTools)) {
        local $/;
        my $DocToolsFile = <FI>;
        close FI;
        $DocToolsFile =~ s/(sub UpdateHTML_blib {)/sub  UpdateHTML_blib {\n    return 1;/sg;
        # Also add extra space so it would not add "return 1" once more
        if (open(FO, '>', $DocTools)) {
            print FO $DocToolsFile;
            close FO;
            chmod 0444, $DocTools;
        } else {
            warn "Cannot write to $DocTools, $!\n";
        }
    } else {
        warn "Cannot read $DocTools, $!\n";
    }
} else {
    warn "Cannot find $DocTools\n";
}

#print "Add more repositories\n";
#system "ppm repo add uwinnipeg";
#system "ppm repo add Local P:/pub/development/languages/perl/repository";

# Make correct versions for updated files
my @fixlist = (
    {
     'name' => 'File::Spec::Win32',
     'ver1' => '3.270101',
     'ver2' => '3.2701',
    },
#    {
#     'name' => 
#    },
);

#$VERSION = '3.270101';

print "Fix versions\n";

my $db_file = $perl . '/etc/ppm-perl-area.db';
my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file", "", "", {
     AutoCommit => 1,
     RaiseError => 1,
});

my $sql = q!
    UPDATE feature
       SET version = ?
     WHERE name = ?
       AND version = ?
!;

my $sth = $dbh->prepare($sql);

foreach my $fix (@fixlist) {
    print 'Fix ', $fix->{'name'}, ' ', $fix->{'ver1'}, "\n";
    $sth->execute($fix->{'ver2'}, $fix->{'name'}, $fix->{'ver1'});
}

Recent Messages in this Thread
more...@libero.it Apr 12, 2010 02:56 pm
C.A. Gibson Apr 12, 2010 03:58 pm
Jan Dubois Apr 12, 2010 04:11 pm
Serguei Trouchelle Apr 23, 2010 08:50 am
Messages in this thread