Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
#!/usr/local/bin/perl # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # "rBuild", a Perl application for remote installation of # user-filesystem-level Perl modules on WWW servers. # l/m: Sunday, February 25, 2001 3:52 PM # The latest version of this program may be found <A HREF="http://www.">here</A>. # Copyright (c) 2001 Soren Andersen, All Rights Reserved. # # This script is Free Software, and may be freely redistributed or # modified as defined in the Perl Artistic License. NO WARRENTY # WHATSOEVER is given, neither express nor implied, not even a claim # of merchandisability or fitness for a particular purpose. The USER # of this software is ENTIRELY responsible for any damage it may do. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BEGIN { use vars qw/$start_Dir $toErrIsGiven $tmpDir $uplDir $hEADr/; if ($ENV{'DOCUMENT_ROOT'}) { $toErrIsGiven = $ENV{'DOCUMENT_ROOT'}; $toErrIsGiven .= qq[/logs/remoteMake_log]; $start_Dir = ($^O =~/mswin32/i)? `cd`:`pwd`; chomp $start_Dir; require "$start_Dir/../lmods/Tie/"; import Tie::STDERR ">> $toErrIsGiven"; open(LOG, ">>$toErrIsGiven") or die("Unable to open Error log \"$toErrIsGiven\": $!\n"); require "$start_Dir/../lmods/File/"; import File::PathConvert qw{realpath rel2abs joinpath}; $tmpDir = $ENV{'DOCUMENT_ROOT'}. q[/secure/tmp]; $uplDir = $ENV{'DOCUMENT_ROOT'}. q[/secure/tmp/upL]; $hEADr = qq[Content-type: text/plain\n\n]; $ENV{PATH} = ".:$ENV{PATH}"; $^W = 0; } else { require "Tie/"; import Tie::STDERR '| D:\\cygwin\\bin\\less'; require "File/"; import File::PathConvert qw{realpath rel2abs joinpath}; $start_Dir = $ENV{TMP}; $tmpDir = $ENV{TMP}; $uplDir = q[F:/temp/inst]; $hEADr = qq[\n Running local test: $0\n\n]; $^W = 1; } select STDERR; $|++; select STDOUT; $|++; } my $rel_libloc = ($start_Dir =~m@/cgi\-bin$@)? '../lmods' : $ENV{'DOCUMENT_ROOT'}.'/lmods'; use lib realpath("$start_Dir/../lmods"); use File::Basename; use strict; use vars qw{ $Source_Archive @StepWise @MMr @Make_Msgs $nl }; use subs qw{ UnDOS }; my $fontSize = ( $ENV{HTTP_USER_AGENT} and $ENV{HTTP_USER_AGENT} =~m@\Q] (@ )? 'small' : 'x-small'; print $hEADr; my %ArgUh; foreach my $item (split(/&/,$ENV{QUERY_STRING})) { my ($name,$value) = split(/=/,$item,2); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $ArgUh{$name} = $value; } ($Source_Archive = $ArgUh{'archive'}) or die $!; my $blog = $start_Dir .q[/../lmods/buildjournal/]. substr( $Source_Archive,0, rindex($Source_Archive, q[.]) ). q[.html]; open JOURNAL,qq[> $blog] or die qq[We could not open an HTML "journal file" named "$blog"]. qq[ to write to: $!]; $Source_Archive = $uplDir .q[/]. $Source_Archive; my $just_distn = substr( $ArgUh{'archive'},0, rindex($ArgUh{'archive'},q[.])); print JOURNAL<<THERE; <HTML> <HEAD> <STYLE TYPE="text/css"> PRE { font-family: verdana,"avant-garde",helvetica,arial,sans-serif; font-size: $fontSize; } CODE { font-family: "Lucida Console","Andale Mono", "Courier Web","Courier New",mono; font-size: $fontSize; } </STYLE> </HEAD> <BODY> <H1>Build record for $just_distn</H1> <H3>\@INC contains:</H3><BLOCKQUOTE> THERE print JOURNAL join qq[\n&lt;BR&gt;\n], @INC, qq[&lt;/BLOCKQUOTE&gt;&lt;/CODE&gt;\n&lt;HR&gt;\n]; my $make_target = ($ArgUh{'target'})? [ $ArgUh{'target'} ] : [ 'test','pure_install' ]; @StepWise = @$make_target; $nl = "\n"; my $abs_libloc = rel2abs( $rel_libloc,$start_Dir ); $ENV{PERL5LIB} = qq[$abs_libloc:]. $ENV{PERL5LIB}; my $tar_exe = ($ENV{'DOCUMENT_ROOT'})? q[tar] : q[D:\\Cygwin\\bin\\tar.exe]; my $perl_exe = UnDOS($^X); my $tar_cmd = q[xf]; my $makeMakefile_cmd = qq[Makefile.PL LIB=$abs_libloc ]. qq[INSTALLMAN1DIR=$abs_libloc/man/man1 ]. qq[INSTALLMAN3DIR=$abs_libloc/man/man3]; my $make_exe = "$start_Dir/pmake"; my $distdir = $tmpDir .q[/]. basename( $Source_Archive ); $distdir = substr( $distdir,0, rindex($distdir,'.') ); unless ($ArgUh{'target'} and ( $ArgUh{'target'} eq 'clean' or $ArgUh{'target'} =~/dist/)) { (system( $tar_exe, $tar_cmd, $Source_Archive, qq[-C], ReadiP($tmpDir))) and die "tarball unrolling failed: $!"; print JOURNAL qq[\n The distro dir just created by ], qq[<CITE>tar</CITE> is: $distdir\n]; chdir $distdir or die $!; # HERE THE making of the Makefile HAPPENS @MMr = `$perl_exe -I$abs_libloc $makeMakefile_cmd`; } else { chdir $distdir or die qq[\nUnable to get into \$distdir ], qq["$distdir":\n$!]; } my ($rtv, $cmm); $rtv = 0; # vvvvv while (($cmm=shift @StepWise) and defined($rtv)) { $rtv = open (PIPE, "$make_exe $cmm 2>&1 |"); if (defined $rtv) { push @Make_Msgs, qq[\n\nIn process $rtv, ]. qq[got these messages back:\n\n]; foreach my $proc_line (<PIPE>) { push @Make_Msgs, $proc_line; } } else { warn qq[\nWhoa, we have not got a process going ], qq[to get the pmake invocations working: $?]; } close( PIPE ); } print LOG qq[\nDone. Here is the make-Makefile log:\n], $nl,'-' x 50,$nl, @MMr; print JOURNAL $nl, '</PRE><HR><P>Done. Here is the make-Makefile log:</P><PRE>', $nl; print JOURNAL @MMr; print LOG $nl,'-' x 50,$nl,@Make_Msgs; print JOURNAL $nl,'</PRE><HR><P>Here is the ', 'output from the make command sequence:<PRE>',$nl; print JOURNAL @Make_Msgs; print JOURNAL "</PRE><HR></BODY></HTML>\n"; print qq[\nDone\n]; close LOG; exit 0; sub UnDOS { my $revslashed = shift; $revslashed =~s@\\@/@g; return $revslashed; } # THIS IS JUST FOR LOCAL TESTING sub ReadiP { my $conversion; my $inpath = UnDOS(shift); if ( $ENV{OS} and $ENV{OS} =~m@Windows@i ) { chomp($conversion = `D:\\cygwin\\bin\\cygpath -pau $inpath`); return $conversion; } return $inpath; } __END__

In reply to rBuild hack by Intrepid

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (9)
    As of 2018-07-20 11:05 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (429 votes). Check out past polls.