FAQ
Hello Perl5 Porters,

I was redirected to you by tchrist@perl.com.

Please find in my email to Tom Christiansen a patch for pod2html
and the reasoning behind it.

If you have any questions regarding the same, please ask.

Thank you
rv

------- Forwarded Message
To: tchrist@perl.com
Subject: pod2html leaves cache files lying around?
Reply-to: rv@gnu.org
X-Loop-Detect: rv@gnu.org
Date: Mon, 16 Apr 2001 17:55:22 -0400 (EDT)
From: Rajesh Vaidheeswarran <rv@gnu.org>

Hello,

I'm the maintainer of GNU Cons - a software construction system (like, but
unlike Make).

The matter that I wish to address in this mail is regarding pod2html.
Apparently, pod2html creates item and directory cache files in the working
directory.

For cons users, that assumption leaves these files in the wrong place since
cons doesn't cd to the src directory, but instead calls coomands with the
relative path..

For example, in the cons build (i.e., cons build the cons distribution)

pod2html --title="Cons - Software Construction System" --outfile=build/export/cons-2.3.0/cons.html --infile=build/export/cons-2.3.0/cons

leaves the cache files in the top level.

I have a patch for this which, if you hopefully accept, would give a clean
way of requesting pod2html (or rather Pod::Html) to put the cache files in
a directory of the user's choice with the --cachedir directive.

pod2html --cachedir=build/export/cons-2.3.0 --title="Cons - Software Construction System" --outfile=build/export/cons-2.3.0/cons.html --infile=build/export/cons-2.3.0/cons

I have attached the patch to Pod/Html.pm below.

Thanks
rv

*** /usr/lib/perl5/5.6.0/Pod/Html.pm Mon Aug 7 11:05:48 2000
---- Pod/Html.pm Mon Apr 16 17:00:50 2001
***************
*** 44,49 ****
---- 44,55 ----
Adds "Back to Top" links in front of every HEAD1 heading (except for
the first). By default, no backlink are being generated.

+ =item cachedir
+
+ --cachedir=name
+
+ Creates the item and directory caches in the given directory.
+
=item css

--css=stylesheet
***************
*** 195,200 ****
---- 201,208 ----

=cut

+ my $cachedir = "."; # The directory to which item and directory
+ # caches will be written.
my $cache_ext = $^O eq 'VMS' ? ".tmp" : ".x~~";
my $dircache = "pod2htmd$cache_ext";
my $itemcache = "pod2htmi$cache_ext";
***************
*** 566,574 ****
Usage: $0 --help --htmlroot=<name> --infile=<name> --outfile=<name>
--podpath=<name>:...:<name> --podroot=<name>
--libpods=<name>:...:<name> --recurse --verbose --index
! --netscape --norecurse --noindex

--backlink - set text for "back to top" links (default: none).
--css - stylesheet URL
--flush - flushes the item and directory caches.
--[no]header - produce block header/footer (default is no headers).
---- 574,583 ----
Usage: $0 --help --htmlroot=<name> --infile=<name> --outfile=<name>
--podpath=<name>:...:<name> --podroot=<name>
--libpods=<name>:...:<name> --recurse --verbose --index
! --netscape --norecurse --noindex --cachedir=<name>

--backlink - set text for "back to top" links (default: none).
+ --cachedir - directory for the item and directory cache files.
--css - stylesheet URL
--flush - flushes the item and directory caches.
--[no]header - produce block header/footer (default is no headers).
***************
*** 601,614 ****
END_OF_USAGE

sub parse_command_line {
! my ($opt_backlink,$opt_css,$opt_flush,$opt_header,$opt_help,$opt_htmldir,
! $opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,$opt_netscape,
! $opt_outfile,$opt_podpath,$opt_podroot,$opt_quiet,$opt_recurse,
! $opt_title,$opt_verbose);

unshift @ARGV, split ' ', $Config{pod2html} if $Config{pod2html};
my $result = GetOptions(
'backlink=s' => \$opt_backlink,
'css=s' => \$opt_css,
'flush' => \$opt_flush,
'header!' => \$opt_header,
---- 610,624 ----
END_OF_USAGE

sub parse_command_line {
! my ($opt_backlink,$opt_cachedir,$opt_css,$opt_flush,$opt_header,$opt_help,
! $opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,
! $opt_netscape,$opt_outfile,$opt_podpath,$opt_podroot,$opt_quiet,
! $opt_recurse,$opt_title,$opt_verbose);

unshift @ARGV, split ' ', $Config{pod2html} if $Config{pod2html};
my $result = GetOptions(
'backlink=s' => \$opt_backlink,
+ 'cachedir=s' => \$opt_cachedir,
'css=s' => \$opt_css,
'flush' => \$opt_flush,
'header!' => \$opt_header,
***************
*** 636,641 ****
---- 646,652 ----
@libpods = split(":", $opt_libpods) if defined $opt_libpods;

$backlink = $opt_backlink if defined $opt_backlink;
+ $cachedir = $opt_cachedir if defined $opt_cachedir;
$css = $opt_css if defined $opt_css;
$header = $opt_header if defined $opt_header;
$htmldir = $opt_htmldir if defined $opt_htmldir;
***************
*** 652,657 ****
---- 663,670 ----

warn "Flushing item and directory caches\n"
if $opt_verbose && defined $opt_flush;
+ $dircache = "$cachedir/pod2htmd$cache_ext";
+ $itemcache = "$cachedir/pod2htmi$cache_ext";
unlink($dircache, $itemcache) if defined $opt_flush;
}



------- End of Forwarded Message

Search Discussions

  • Jarkko Hietaniemi at Apr 18, 2001 at 11:35 pm

    On Tue, Apr 17, 2001 at 09:35:00AM -0400, Rajesh Vaidheeswarran wrote:
    Hello Perl5 Porters,

    I was redirected to you by tchrist@perl.com.

    Please find in my email to Tom Christiansen a patch for pod2html
    and the reasoning behind it.
    Reasoning looks good. I now applied your patch to the Perl development
    code base, which means that Perl 5.8, hopefully released during this
    summer, will have the change applied.

    --
    $jhi++; # http://www.iki.fi/jhi/
    # There is this special biologist word we use for 'stable'.
    # It is 'dead'. -- Jack Cohen

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedApr 17, '01 at 1:35p
activeApr 18, '01 at 11:35p
posts2
users2
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase