Permalink
Browse files

Switched to dzil and switched from File::chdir to File::pushd

  • Loading branch information...
1 parent 8631ee6 commit 4029c7f726e27882ce6e94380c1dd8daaa8ca371 @bingos committed Jun 21, 2010
Showing with 19 additions and 246 deletions.
  1. +0 −24 Changes
  2. +0 −22 MANIFEST
  3. +0 −18 Makefile.PL
  4. +0 −38 README
  5. +13 −0 dist.ini
  6. +6 −22 lib/Devel/PatchPerl.pm
  7. +0 −4 t/00_compile.t
  8. +0 −4 t/99_pod.t
  9. +0 −4 t/99_pod_coverage.t
  10. +0 −110 tools/git-log.pl
View
24 Changes
@@ -1,24 +0,0 @@
-==============================
-2010-05-18 09:10:40 +0100 0.06
-==============================
-
- commit 225c1ddde7fe4bdf568fba7784da4e4599444cf5
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue May 18 09:10:40 2010 +0100
-
- Fixed a few issues, tested patching against perl-5.6.1 source tree
- and it works now.
-
-==============================
-2010-05-18 00:33:32 +0100 0.04
-==============================
-
- commit 09dfd7daa6a1fe5bc172aad1ad1d57eb0af86227
- Author: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- Date: Tue May 18 00:33:32 2010 +0100
-
- Fixed a bug calling patch_source as a exported function
-
-==============
-End of Excerpt
-==============
View
@@ -1,22 +0,0 @@
-inc/Module/Install.pm
-inc/Module/Install/AutoLicense.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/GithubMeta.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/ReadmeFromPod.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
-Changes
-lib/Devel/PatchPerl.pm
-LICENSE
-Makefile.PL
-MANIFEST This list of files
-META.yml
-README
-t/00_compile.t
-t/99_pod.t
-t/99_pod_coverage.t
-tools/git-log.pl
View
@@ -1,18 +0,0 @@
-use strict;
-use inc::Module::Install;
-name 'Devel-PatchPerl';
-author 'Chris Williams <chris@bingosnet.co.uk>';
-version_from 'lib/Devel/PatchPerl.pm';
-abstract_from 'lib/Devel/PatchPerl.pm';
-readme_from 'lib/Devel/PatchPerl.pm';
-license 'perl';
-auto_license holder => 'Chris Williams and Marcus Holland-Moritz';
-perl_version '5.006';
-build_requires 'Test::More' => 0.47;
-requires 'File::chdir' => '0.1003';
-requires 'IO::File' => 0;
-requires 'IPC::Cmd' => '0.58';
-auto_provides;
-githubmeta;
-makemaker_args(dist => { PREOP => "$^X ./tools/git-log.pl > ./Changes" });
-WriteAll();
View
38 README
@@ -1,38 +0,0 @@
-NAME
- Devel::PatchPerl - Patch perl source a la Devel::PPort's buildperl.pl
-
-SYNOPSIS
- use strict;
- use warnings;
-
- use Devel::PatchPerl;
-
- Devel::PatchPerl->patch_source( '5.6.1', '/path/to/untarred/perl/source/perl-5.6.1' );
-
-DESCRIPTION
- Devel::PatchPerl is a modularisation of the patching code contained in
- Devel::PPort's "buildperl.pl".
-
- It does not build perls, it merely provides an interface to the source
- patching functionality.
-
-FUNCTION
- "patch_source"
- Takes two parameters, a "perl" version and the path to unwrapped
- perl source for that version. It dies on any errors.
-
-AUTHOR
- Chris "BinGOs" Williams <chris@bingosnet.co.uk>
-
- Marcus Holland-Moritz
-
-LICENSE
- Copyright � Chris Williams and Marcus Holland-Moritz
-
- This module may be used, modified, and distributed under the same terms
- as Perl itself. Please see the license that came with your Perl
- distribution for details.
-
-SEE ALSO
- Devel::PPPort
-
View
@@ -0,0 +1,13 @@
+name = Devel-PatchPerl
+version = 0.10
+author = Chris Williams <chris@bingosnet.co.uk>
+license = Perl_5
+copyright_holder = Chris Williams and Marcus Holland-Moritz
+
+[@BINGOS]
+
+[Prereq]
+perl = v5.6.0
+File::pushd = 1.00
+IO::File = 0
+IPC::Cmd = 0.58
View
@@ -1,14 +1,14 @@
package Devel::PatchPerl;
+# ABSTRACT: Patch perl source a la Devel::PPort's buildperl.pl
+
use strict;
use warnings;
-use File::chdir;
+use File::pushd qw[pushd];
use File::Spec;
use IO::File;
use IPC::Cmd qw[can_run run];
-use vars qw[$VERSION @ISA @EXPORT_OK];
-
-$VERSION = '0.08';
+use vars qw[@ISA @EXPORT_OK];
@ISA = qw(Exporter);
@EXPORT_OK = qw(patch_source);
@@ -109,7 +109,7 @@ sub patch_source {
$source = File::Spec->rel2abs($source);
warn "No patch utility found\n" unless $patch_exe;
{
- local $CWD = $source;
+ my $dir = pushd( $source );
for my $p ( grep { _is( $_->{perl}, $vers ) } @patch ) {
for my $s (@{$p->{subs}}) {
my($sub, @args) = @$s;
@@ -283,11 +283,7 @@ sub _run_or_die
qq[patchin'];
-__END__
-
-=head1 NAME
-
-Devel::PatchPerl - Patch perl source a la Devel::PPort's buildperl.pl
+=pod
=head1 SYNOPSIS
@@ -317,18 +313,6 @@ It dies on any errors.
=back
-=head1 AUTHOR
-
-Chris C<BinGOs> Williams <chris@bingosnet.co.uk>
-
-Marcus Holland-Moritz
-
-=head1 LICENSE
-
-Copyright E<copy> Chris Williams and Marcus Holland-Moritz
-
-This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.
-
=head1 SEE ALSO
L<Devel::PPPort>
View
@@ -1,4 +0,0 @@
-use strict;
-use warnings;
-use Test::More qw[no_plan];
-use_ok('Devel::PatchPerl');
View
@@ -1,4 +0,0 @@
-use Test::More;
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-all_pod_files_ok();
View
@@ -1,4 +0,0 @@
-use Test::More;
-eval "use Test::Pod::Coverage 1.00";
-plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
-all_pod_coverage_ok();
View
@@ -1,110 +0,0 @@
-#!/usr/bin/env perl
-
-use warnings;
-use strict;
-
-use Text::Wrap qw(wrap fill $columns $huge);
-use Getopt::Long;
-use POSIX qw(strftime);
-
-my $days_back = 110365; # Go back a year by default.
-my $send_help = 0; # Display help and exit.
-my $tag_pattern = "^\\d";
-
-GetOptions(
- "age=s" => \$days_back,
- "help" => \$send_help,
- "tags=s" => \$tag_pattern,
-) or $send_help = 1;
-
-# Find the trunk for the current repository if one isn't specified.
-
-die(
- "$0 usage:\n",
- " [--age DAYS] limit report to DAYS in the past (default: 365)\n",
- " [--tags REGEXP] report on tags matching REGEXP (default: ^v\\d+_)\n",
-) if $send_help;
-
-my $earliest_date = strftime(
- "%FT %T +0000", gmtime(time() - $days_back * 86400)
-);
-
-$Text::Wrap::huge = "wrap";
-$Text::Wrap::columns = 74;
-
-chomp(my @tags = `git tag`);
-
-{
- my $i = @tags;
- while ($i--) {
- unless ($tags[$i] =~ /$tag_pattern/o) {
- splice @tags, $i, 1;
- next;
- }
-
- my $commit = `git show $tags[$i] --pretty='tformat:(((((%ci)))))' | grep '(((((' | head -1`;
- die $commit unless $commit =~ /\(\(\(\(\((.+?)\)\)\)\)\)/;
-
- $tags[$i] = {
- 'time' => $1,
- 'tag' => $tags[$i],
- };
- }
-}
-
-push @tags, { 'time' => '9999-99-99 99:99:99 +0000', 'tag' => 'HEAD' };
-
-@tags = sort { $a->{'time'} cmp $b->{'time'} } @tags;
-
-{
- my $i = @tags;
- while ($i--) {
- last if $tags[$i]{time} lt $earliest_date;
-
- my @commit;
-
- open my $commit, "-|", "git log $tags[$i-1]{tag}..$tags[$i]{tag} ." or die $!;
- local $/ = "\n\n";
- while (<$commit>) {
- if (/^\S/) {
- s/^/ /mg;
- push @commit, $_;
- next;
- }
-
- # Trim off identical leading whitespace.
- my ($whitespace) = /^(\s*)/;
- if (length $whitespace) {
- s/^$whitespace//mg;
- }
-
- # Re-flow the paragraph if it isn't indented from the norm.
- # This should preserve indented quoted text, wiki-style.
- unless (/^\s/) {
- push @commit, fill(" ", " ", $_), "\n\n";
- }
- else {
- push @commit, $_;
- }
- }
-
- # Don't display the tag if there's nothing under it.
- next unless @commit;
-
- my $tag_line = "$tags[$i]{time} $tags[$i]{tag}";
- print(
- ("=" x length($tag_line)), "\n",
- $tag_line, "\n",
- ("=" x length($tag_line)), "\n",
- "\n",
- );
-
- print @commit;
- }
-}
-
-print(
- "==============\n",
- "End of Excerpt\n",
- "==============\n",
-);

0 comments on commit 4029c7f

Please sign in to comment.