Changeset 1118


Ignore:
Timestamp:
Nov 26, 2010, 12:54:53 PM (9 years ago)
Author:
bruno
Message:

r4059@localhost: bruno | 2010-11-26 11:52:10 +0100

  • Improve Website delivery script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pbconf/devel/website/pbinit

    r1044 r1118  
    1010use ProjectBuilder::Env;
    1111use File::Basename;
     12use File::Copy;
    1213use Pod::Man;
    1314use Pod::Html qw(pod2html);
    1415use Pod::Text;
     16use Data::Dumper;
     17
     18my @MAN = (
     19    "pb-modules/lib/ProjectBuilder/Base.pm",
     20    "pb-modules/lib/ProjectBuilder/Conf.pm",
     21    "pb-modules/lib/ProjectBuilder/Distribution.pm",
     22    "pb/lib/ProjectBuilder/Changelog.pm",
     23    "pb/lib/ProjectBuilder/CMS.pm",
     24    "pb/lib/ProjectBuilder/Env.pm",
     25    "pb/lib/ProjectBuilder/Filter.pm",
     26    "pb/bin/pb",
     27    "rpmbootstrap/bin/rpmbootstrap",
     28    "pb-modules/bin/pbdistrocheck",
     29    "pb-modules/etc/pb.conf.pod",
     30);
     31
     32my @DOC = (
     33    "LabProject-Builder.org.odt",
     34    "LabProject-Builder.org.pdf",
     35    "One_Source_for_Multiple_Platforms_Sol_Brief_final.pdf"
     36);
    1537
    1638pb_temp_init();
     
    2547$pb{'date'} = "PBDATE";
    2648$pb{'repo'} = "PBREPO";
    27 $pb->{'realpkg'} = "PBREALPKG";
    28 $pb->{'packager'} = "PBPACKAGER";
    29 $pb->{'chglog'} = "";
     49$pb{'realpkg'} = "PBREALPKG";
     50$pb{'packager'} = q/PBPACKAGER/;
     51$pb{'chglog'} = "";
    3052
    3153# Action needs to be pbinit
     
    3456
    3557# export doc
    36 foreach my $f ("LabProject-Builder.org.odt", "LabProject-Builder.org.pdf","One_Source_for_Multiple_Platforms_Sol_Brief_final.pdf") {
     58foreach my $f (@DOC) {
    3759    pb_cms_export($uri,"$ENV{'PBDIR'}/pb-doc/$f","docs");
    3860}
    3961# using pod from files
    40 foreach my $f ("pb/bin/pb", "pb-modules/bin/pbdistrocheck", "pb-modules/etc/pb.conf.pod", "rpmbootstrap/bin/rpmbootstrap", <*/lib/ProjectBuilder/*.pm>) {
     62foreach my $f (@MAN) {
    4163    pb_cms_export($uri,"$ENV{'PBDIR'}/$f","tmp");
    4264}
     
    4466# call filter_file here
    4567my $ptr = pb_get_filters($pb{'pkg'});
    46 foreach my $f (<tmp/*>) {
    47     pb_log(0,"Processing $f\n");
     68chdir("tmp");
     69foreach my $f (<*>) {
     70    pb_log(0,"\nProcessing $f\n");
    4871    pb_log(0,"==========================\n");
    4972    pb_filter_file_inplace($ptr,$f,\%pb);
     
    6891            "--backlink='Back to Top'",
    6992            "--infile=$f",
    70             "--outfile=$f.$ext.html");
    71     # generate ps pages
    72     pb_system("groff -Tps -mandoc $f > $f.$ext.ps","Generating Postscript pages");
    73     # generate pdf pages
    74     pb_system("ps2pdf $f.$ext.ps","Generating PDF pages");
     93            "--outfile=../docs/$f.$ext.html");
    7594    # generate text pages
    7695    pb_log(0,"Generating text pages\n");
    7796    $parser = Pod::Text->new (sentence => 0, width => 78);
    78     $parser->parse_from_file ("$f","$f.$ext.txt");
     97    $parser->parse_from_file ("$f","../docs/$f.$ext.txt");
     98    # generate ps pages
     99    #system("groff -Tps -mandoc $f.$ext > ../docs/$f.$ext.ps");
     100    pb_system("groff -Tps -mandoc $f.$ext > ../docs/$f.$ext.ps","Generating Postscript pages");
     101    # generate pdf pages
     102    pb_system("ps2pdf ../docs/$f.$ext.ps","Generating PDF pages");
     103    move("$f.$ext.pdf","../docs/$f.$ext.pdf");
    79104}
    80 
    81 
     105chdir("..");
     106pb_rm_rf("tmp");
Note: See TracChangeset for help on using the changeset viewer.