Skip to content

Commit

Permalink
Make Changes match CPAN::Changes::Spec
Browse files Browse the repository at this point in the history
• generate DBI::Changes.pm from Changes
  • Loading branch information
Tux committed Aug 25, 2024
1 parent 479ff8c commit 83d0d6c
Show file tree
Hide file tree
Showing 13 changed files with 11,169 additions and 181 deletions.
299 changes: 139 additions & 160 deletions Changes

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ lib/DBD/Mem.pm A pure-perl in-memory driver using DBI::DBD::Sql
lib/DBD/NullP.pm An empty example Driver module
lib/DBD/Proxy.pm Proxy driver
lib/DBD/Sponge.pm A driver for fake cursors (precached data)
lib/DBI/Changes.pm
lib/DBI/Const/GetInfo/ANSI.pm GetInfo data based on ANSI standard
lib/DBI/Const/GetInfo/ODBC.pm GetInfo data based on ODBC standard
lib/DBI/Const/GetInfoReturn.pm GetInfo return values plus tools based on standards
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
\.[co]$
^appveyor\.yml
^blib/
^changes2pm\.pl
^DBI-\d
^dbi.tiddlyspot.com.html
^dbilogstrip$
Expand Down
11 changes: 8 additions & 3 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ dbixs_rev.h: DBIXS.h Driver_xst.h dbipport.h dbivport.h dbixs_rev.pl
DBI.c: Perl$(OBJ_EXT)
# make Changes file available as installed pod docs "perldoc DBI::Changes"
inst_libdbi = ' . File::Spec->catdir($self->{INST_LIB}, 'DBI') . '
changes_pm = ' . File::Spec->catfile($self->{INST_LIB}, 'DBI', 'Changes.pm') . '
inst_libdbi = ' . File::Spec->catdir ($self->{INST_LIB}, 'DBI') . '
changes_pm1 = ' . File::Spec->catfile ('lib', 'DBI', 'Changes.pm') . '
changes_pm2 = ' . File::Spec->catfile ($self->{INST_LIB}, 'DBI', 'Changes.pm') . '
'.q{
config :: $(changes_pm)
Expand All @@ -357,7 +358,8 @@ config :: $(changes_pm)
$(changes_pm): Changes
$(MKPATH) $(inst_libdbi)
$(RM_F) $(changes_pm)
$(CP) Changes $(changes_pm)
perl changes2pm.pl
$(CP) $(changes_pm1) $(changes_pm2)
ptest: all
prove --blib --jobs 8 --shuffle
Expand All @@ -381,6 +383,9 @@ dbipport:
ppport: dbipport.h
perl dbipport.h --compat-version=5.8.0 DBI.xs
lib/DBI/Changes.pm: Changes
perl changes2pm.pl
checkpod:
$(RM_RF) blib
find . -type f \( -name .svn -prune -o -name \*.pm -o -name \*.PL -o -name \*.pl \) \
Expand Down
110 changes: 110 additions & 0 deletions changes2pm.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/pro/bin/perl

use 5.014002;
use warnings;

our $VERSION = "0.01 - 20240825";
our $CMD = $0 =~ s{.*/}{}r;

sub usage {
my $err = shift and select STDERR;
say "usage: $CMD ...";
exit $err;
} # usage

use autodie;
use Getopt::Long qw(:config bundling);
GetOptions (
"help|?" => sub { usage (0); },
"V|version" => sub { say "$CMD [$VERSION]"; exit 0; },

"v|verbose:1" => \(my $opt_v = 0),
) or usage (1);

open my $ph, ">:encoding(utf-8)", "lib/DBI/Changes.pm";
open my $ch, "<:encoding(utf-8)", "Changes";

my @m = qw( - Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
my @chg;
while (<$ch>) {
s/[\s\r\n]+\z//;
if (s/^([0-9]+(?:\.[.0-9]+))\s+//) {
my ($v, $dt, $svn) = ($1);
if (s/^[-,\s]*([0-9]{4})-([0-9]{2})-([0-9]{2})[-,\s]*//) {
$dt = "$3 $m[$2] $1";
}
else {
$dt = "TBD";
}
s/\s*\(?\s*svn\s+(?:rev |r)([0-9]+)\s*\)\s*$// and $svn = $1;
push @chg => [ $v, $dt, $_, $svn || "" ];
next;
}
push @{$chg[-1]} => $_;
}
close $ch;

print $ph <<"EOH";
#!/usr/bin/perl
use strict;
use warnings;
1;
__END__
=head1 NAME
DBI::Changes - List of significant changes to the DBI
=encoding UTF-8
EOH

foreach my $c (@chg) {
my @c = @$c;
my ($vsn, $date, $author, $svn) = splice @c, 0, 4;
$svn =~ s/([0-9]+)/ (svn rev $1)/;
say $ph "=head2 Changes in DBI $vsn$svn - $date";
say $ph "";
shift @c while @c && $c[ 0] !~ m/\S/;
pop @c while @c && $c[-1] !~ m/\S/;
if ($c[0] =~ s/^\s*\K(\*|\x{2022})\s*//) {
my @i = [ pop @c ];
while (@c) {
if ($c[0] =~ s/^\s*\K(\*|\x{2022})\s*//) {
push @i => [ shift @c ]
}
else {
push @{$i[-1]} => shift @c;
}
}
say $ph "=over 2";
for (@i) {
say $ph "";
say $ph "=item *";
say $ph "";
say $ph s/^\s+//r for @$_;
}

say $ph "";
say $ph "=back";
}
else {
say $ph $_ for @c;
}
say $ph "";
}

print $ph <<"EOF";
=head1 ANCIENT HISTORY
12th Oct 1994: First public release of the DBI module.
(for Perl 5.000-beta-3h)
19th Sep 1994: DBperl project renamed to DBI.
29th Sep 1992: DBperl project started.
=cut
EOF
11 changes: 5 additions & 6 deletions doc/DBI.3
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
.\" ========================================================================
.\"
.IX Title "DBI 3"
.TH DBI 3 2024-08-23 "perl v5.40.0" "User Contributed Perl Documentation"
.TH DBI 3 2024-08-25 "perl v5.40.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
Expand Down Expand Up @@ -6834,17 +6834,17 @@ Security, especially the "SQL Injection" attack:
.Ve
.SS FAQ
.IX Subsection "FAQ"
See <http://faq.dbi\-support.com/>
See <http://dbi.perl.org/support/>
.SH AUTHORS
.IX Header "AUTHORS"
DBI by Tim Bunce, <http://www.tim.bunce.name>
DBI by Tim Bunce (1994\-2024), The DBI developer group (2024..)
.PP
This pod text by Tim Bunce, J. Douglas Dunlop, Jonathan Leffler and others.
Perl by Larry Wall and the \f(CW\*(C`perl5\-porters\*(C'\fR.
.SH COPYRIGHT
.IX Header "COPYRIGHT"
The DBI module is Copyright (c) 1994\-2024 Tim Bunce. Ireland.
All rights reserved.
The DBI developer group (2024\-2024) All rights reserved.
.PP
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the Perl 5.10.0 README file.
Expand Down Expand Up @@ -6895,8 +6895,7 @@ A couple of specific DBI features have been sponsored by enlightened companies:
.PP
The development of the \fBswap_inner_handle()\fR method was sponsored by BizRate.com (<http://BizRate.com>)
.PP
The development of DBD::Gofer and related modules was sponsored by
Shopzilla.com (<http://Shopzilla.com>), where I currently work.
The development of DBD::Gofer and related modules was sponsored by Shopzilla.com (https::connexity.com).
.SH CONTRIBUTING
.IX Header "CONTRIBUTING"
As you can see above, many people have contributed to the DBI and
Expand Down
8 changes: 4 additions & 4 deletions doc/DBI.html
Original file line number Diff line number Diff line change
Expand Up @@ -4505,17 +4505,17 @@ <h2 id="Assorted-Related-Links">Assorted Related Links</h2>

<h2 id="FAQ">FAQ</h2>

<p>See <a href="http://faq.dbi-support.com/">http://faq.dbi-support.com/</a></p>
<p>See <a href="http://dbi.perl.org/support/">http://dbi.perl.org/support/</a></p>

<h1 id="AUTHORS">AUTHORS</h1>

<p>DBI by Tim Bunce, <a href="http://www.tim.bunce.name">http://www.tim.bunce.name</a></p>
<p>DBI by Tim Bunce (1994-2024), The DBI developer group (2024..)</p>

<p>This pod text by Tim Bunce, J. Douglas Dunlop, Jonathan Leffler and others. Perl by Larry Wall and the <code>perl5-porters</code>.</p>

<h1 id="COPYRIGHT">COPYRIGHT</h1>

<p>The DBI module is Copyright (c) 1994-2024 Tim Bunce. Ireland. All rights reserved.</p>
<p>The DBI module is Copyright (c) 1994-2024 Tim Bunce. Ireland. The DBI developer group (2024-2024) All rights reserved.</p>

<p>You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl 5.10.0 README file.</p>

Expand Down Expand Up @@ -4545,7 +4545,7 @@ <h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<p>The development of the swap_inner_handle() method was sponsored by BizRate.com (<a href="http://BizRate.com">http://BizRate.com</a>)</p>

<p>The development of DBD::Gofer and related modules was sponsored by Shopzilla.com (<a href="http://Shopzilla.com">http://Shopzilla.com</a>), where I currently work.</p>
<p>The development of DBD::Gofer and related modules was sponsored by Shopzilla.com (<a>https::connexity.com</a>).</p>

<h1 id="CONTRIBUTING">CONTRIBUTING</h1>

Expand Down
9 changes: 4 additions & 5 deletions doc/DBI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6181,19 +6181,19 @@ Security, especially the "SQL Injection" attack:

## FAQ

See [http://faq.dbi-support.com/](http://faq.dbi-support.com/)
See [http://dbi.perl.org/support/](http://dbi.perl.org/support/)

# AUTHORS

DBI by Tim Bunce, [http://www.tim.bunce.name](http://www.tim.bunce.name)
DBI by Tim Bunce (1994-2024), The DBI developer group (2024..)

This pod text by Tim Bunce, J. Douglas Dunlop, Jonathan Leffler and others.
Perl by Larry Wall and the `perl5-porters`.

# COPYRIGHT

The DBI module is Copyright (c) 1994-2024 Tim Bunce. Ireland.
All rights reserved.
The DBI developer group (2024-2024) All rights reserved.

You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the Perl 5.10.0 README file.
Expand Down Expand Up @@ -6248,8 +6248,7 @@ A couple of specific DBI features have been sponsored by enlightened companies:

The development of the swap\_inner\_handle() method was sponsored by BizRate.com ([http://BizRate.com](http://BizRate.com))

The development of DBD::Gofer and related modules was sponsored by
Shopzilla.com ([http://Shopzilla.com](http://Shopzilla.com)), where I currently work.
The development of DBD::Gofer and related modules was sponsored by Shopzilla.com ([https::connexity.com](https://metacpan.org/pod/https%3A%3Aconnexity.com)).

# CONTRIBUTING

Expand Down
Loading

0 comments on commit 83d0d6c

Please sign in to comment.