Author: dagolden Date: Sat Jun 27 19:34:09 2009 New Revision: 12938 Added: ExtUtils-ParseXS/trunk/.perl_developer.yml (contents, props changed) ExtUtils-ParseXS/trunk/devtools/ ExtUtils-ParseXS/trunk/devtools/bleadcheck.pl (contents, props changed) ExtUtils-ParseXS/trunk/devtools/bump_version.pl (contents, props changed) ExtUtils-ParseXS/trunk/devtools/patching_blead.pod (contents, props changed) ExtUtils-ParseXS/trunk/devtools/release_instructions.pod (contents, props changed) Removed: ExtUtils-ParseXS/trunk/bleadcheck.pl
Log: import devtools Added: ExtUtils-ParseXS/trunk/.perl_developer.yml ============================================================================== --- (empty file) +++ ExtUtils-ParseXS/trunk/.perl_developer.yml Sat Jun 27 19:34:09 2009 @@ -0,0 +1,31 @@ +svn: + repository: "https://svn.perl.org/modules/" + layout: + trunk: "#DIST#/trunk/" + tags: "#DIST#/tags/" + branches: "#DIST#/branches/" + tag: + name: "#VERSION#" + message: "tagging #DIST# release #VERSION#" +not_kwalitee: + - has_test_pod + - has_test_pod_coverage +publish: + pause: + process: + - clean + - create_build --no-sign + - check_manifest + - check_changes + - check_meta_author + - .test + - .testpod + #- .testpodcoverage + - .dist + #- check_kwalitee + - .disttest + - check_version_control + shipit: + - tag_version_control +# - scp_relay +# - pause_http_relay Added: ExtUtils-ParseXS/trunk/devtools/bleadcheck.pl ============================================================================== --- (empty file) +++ ExtUtils-ParseXS/trunk/devtools/bleadcheck.pl Sat Jun 27 19:34:09 2009 @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +# A script to check a local copy against bleadperl, generating a blead +# patch if they're out of sync. The path to bleadperl is required. +# An optional directory argument will be chdir()-ed into before comparing. + +use strict; +my $blead = shift @ARGV + or die "Usage: $0 <bleadperl-src> [ExtUtils-ParseXS-src]\n"; + +chdir shift() if @ARGV; + + +diff( "$blead/lib/ExtUtils/ParseXS.pm", "lib/ExtUtils/ParseXS.pm"); + +diff( "$blead/lib/ExtUtils/ParseXS", "lib/ExtUtils/ParseXS", + qw(t Changes .svn) ); + +diff( "$blead/lib/ExtUtils/ParseXS/t", "t", + qw(.svn) ); + +###################### +sub diff { + my ($first, $second, @skip) = @_; + local $_ = `diff -ur $first $second`; + + for my $x (@skip) { + s/^Only in .* $x\n//mg; + } + print; +} Added: ExtUtils-ParseXS/trunk/devtools/bump_version.pl ============================================================================== --- (empty file) +++ ExtUtils-ParseXS/trunk/devtools/bump_version.pl Sat Jun 27 19:34:09 2009 @@ -0,0 +1,115 @@ +#!/usr/bin/env perl + +# NOTE: we run this immediately *after* a release so that any reports +# against svn are obvious + +use strict; +use warnings; + +use lib 'lib'; +use Module::Build; + +use Tie::File; + +eval { require File::Find::Rule } or + die "$0 requires File::Find::Rule. Please install and try again.\n"; + +my $current = Module::Build->new_from_context(quiet => 1)->dist_version; + +# Get version from command line or prompt +my $version = shift; +unless($version) { + my $default = $current; + + # try to construct a reasonable default automatically + $default =~ s/(\d+)$// or + die "Usage: $0 VERSION\ncurrently: $current\n"; + my $end = $1; + $default .= sprintf('%0'.length($end).'d', $end+1); + + local $| = 1; + print "enter new version [$default]: "; + chomp(my $ans = <STDIN>); + $version = $ans ? $ans : $default; + # TODO check for garbage in? +} + +die "must bump forward! ($version < $current)\n" + unless($version >= $current); + +# NEVER BUMP THESE $VERSION numbers +my @excluded = qw( + lib/Module/Build/Version.pm + lib/Module/Build/YAML.pm +); + +# Get list of .pm files +my @pmfiles = File::Find::Rule->new->or( + File::Find::Rule->name('*.pm'), + File::Find::Rule->directory->name( qr/\.svn/ )->prune->discard +)->in( 'lib' ); +my @scripts = File::Find::Rule->new()->or( + File::Find::Rule->name('*'), + File::Find::Rule->directory->name( qr/\.svn/ )->prune->discard +)->in( './scripts' ); + +# first start the new Changes entry +sub { + my $file = 'Changes'; + open(my $fh, '<', $file) or die "cannot read '$file' $!"; + my @lines = <$fh>; + my @head; + while(@lines) { + my $line = shift(@lines); + if($line =~ m/^$current - \w/) { + warn "Updating '$file'\n"; + open(my $ofh, '>', $file) or die "cannot write '$file' $!"; + print $ofh @head, "$version - \n", "\n", $line, @lines; + close($ofh) or die "cannot write '$file' $!"; + return; + } + elsif($line =~ m/^$version(?: *- *)?$/) { + # TODO should just be checking for a general number+eol case? + die "$file probably needs to be reverted!"; + } + elsif($line =~ m/^$current(?: *- *)?$/) { + die "Error parsing $file - found unreleased '$current'"; + } + else { + push(@head, $line); + } + } + die "cannot find changes entry for current version ($current)!"; +}->(); + +for my $file ( @pmfiles, @scripts ) { + next if grep { $file eq $_ } @excluded; + bump_version( $file, $version ); +} + + +exit; + +sub bump_version { + my ( $file, $version ) = @_; + my $o = tie my @lines, 'Tie::File', $file + or die "Couldn't tie '$file' for editing\n"; + $o->flock; + + # find line to change just like EU::MM::parse_version + my $inpod = 0; + for ( @lines ) { + $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; + next if $inpod || /^\s*#/; + next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + # TODO check that what we found matches $current? + $_ = "\$VERSION = '$version';"; + warn "Updated $file\n"; + last; + } + + undef $o; untie @lines; + return; +} + +# vi:ts=2:sw=2:et:sta Added: ExtUtils-ParseXS/trunk/devtools/patching_blead.pod ============================================================================== --- (empty file) +++ ExtUtils-ParseXS/trunk/devtools/patching_blead.pod Sat Jun 27 19:34:09 2009 @@ -0,0 +1,135 @@ +=head1 Patching ExtUtils::ParseXS in bleadperl + +=head2 Prerequisites + +These instructions assume you have already cloned the perl git +repository and have checked out the blead branch. The blead branch should +be clean of extraneous files + + $ cd ~/git + $ git clone git://perl5.git.perl.org/perl.git + $ git checkout blead + $ git clean -dxf + +The rest of the instructions assume your perl git repo is ~/git/perl + +=head2 Creating a perl branch with changes + +Start in the ExtUtils-ParseXS directory. This would be the distdir left +behind right after publishing a new release, or could be an unpacked +tarball from CPAN. + + $ cd ExtUtils-ParseXS-0.33_02 + +Run the add-packages.pl program from ~/git/perl/Porting to create a +new git branch and copy in ExtUtils::ParseXS files. + +=head2 Verifying and editing the branch + +After add-packages.pl finishes, ~/git/perl will be on the new branch. Verify +that and see what changes have been made: + + $ git branch + $ git status + +If there are other changes made but not staged, examine them individually and +determine if they should be staged or if an error occurred. + +If any files are being removed, be sure to edit Perl's MANIFEST file and stage +it to be committed. + + $ vim MANIFEST + $ git add MANIFEST + +Next, modify the ExtUtils::ParseXS section of Porting/Maintainers.pl to +indicate the distribution file on which the patch is based. Note the version +that is being replaced -- you'll need this later when creating the commit +message. Update any other metadata necessary, then add this file to the index. + + $ vim Porting/Maintainers.pl + $ git add Porting/Maintainers.pl + +=head2 Commiting the branch + +Commit the branch and use the editor to create a commit message. The +first line should be like this: "Update ExtUtils::ParseXS to 0.33_02". (Use +the correct version, of course.) The rest of the file should contain +an excerpt from the Changes file since the last version in blead (i.e. +the old version number in Porting/Maintainers.pl) + + $ git commit + + ### In editor ### + Update ExtUtils::ParseXS to 0.33_02 + + 0.33_02 - Mon Jun 15 12:23:55 EDT 2009 + + Bug-fixes: + - Fixed tests for bleadperl + + 0.33_01 - Sat Jun 13 20:24:42 EDT 2009 + + [... rest of Changes ...] + +=head2 Testing the branch + +Build and test Perl to confirm the changes don't break anything. This +takes a while, but saves embarassment posting a buggy patch to perl5-porters. +For example: + + $ ./Configure -des -Dusedevel + $ make && make test + +=head2 Creating and sending the patch + +Git can automatically create the patch email for perl5-porters: + + $ git format-patch origin + +This creates a single '0001...' email message file. If you have +configured your perl git repository for sending email direct to +perl5-porters, you can send it with this command: + + $ git send-email 0001-Updating-ExtUtils-ParseXS-to-0.33_02.patch + +=head1 Special tips + +=head2 Configuring git to send email + +In your ~/git/perl repository, set the destination email: + + $ git config sendemail.to [email protected] + +You may need to set some configuration for your particular email/ISP setup. +For example, to set global git config to send email via a gmail account: + + $ git config --global sendemail.smtpserver smtp.gmail.com + $ git config --global sendemail.smtpssl 1 + $ git config --global sendemail.smtpuser [email protected] + +With this setup, you will be prompted for your gmail password when you +run 'git send-email'. + +=head2 Fixing a branch and regenerating a patch + +DANGER -- ADVANCED GIT HERE + +If something breaks in the test or after committing you realize you need to +tweak the branch, you can go ahead and make changes and commit them to the +branch as normal. + +Then, before regenerating the patch, squash them into a single patch using +interactive rebase: + + $ git rebase -i origin + +In the editor, you will have the option to choose how commits are rebased. +Leave the first entry as 'pick' and make all subsequent entries 'squash'. +After you leave the editor, a new editor window will open and you will have +the opportunity to combine all commit messages. Generally, you'll want to keep +the initial Changes list and just delete the other commit messages. + +Afterwards, regenerate and send the patch as described above. + +=cut + Added: ExtUtils-ParseXS/trunk/devtools/release_instructions.pod ============================================================================== --- (empty file) +++ ExtUtils-ParseXS/trunk/devtools/release_instructions.pod Sat Jun 27 19:34:09 2009 @@ -0,0 +1,58 @@ +=head1 Release instructions for ExtUtils::ParseXS + +=head2 Prerequisites + +Recent ExtUtils::ParseXS releases have been packaged using the CPDK tool +by Eric Wilhelm. This distribution is not yet on CPAN, but can be +installed from its repository: + + $ svn co http://svn.scratchcomputing.com/CPDK/trunk/ CPDK + $ cd CPDK + $ cpan . + +=head2 Packaging and shipping + +Update ExtUtils::ParseXS and make sure there are no local changes or conflicts. + + $ svn up + + $ svn st + +See what the last tag was: + + $ svn_taglist | tail + ... + 0.31_02 + +Pull the logs since that tag and update the Changes file if necessary + + $ svn_logsincetag 0.31_02 | less + ... + + $ vim Changes + +If everything is good, just datestamp the version section at the top of +Changes (e.g. use "r! date" then "kJ" in vim.) + + $ svn ci -m "Changes - prep for release" + +And we should now be ready for automated shipping: + + $ perl Build.PL + $ Build distmeta + $ publish-module + +At the moment, for anyone but Eric Wilhelm, this will fail during +the 'scp_relay' stage, but the tarball exists and can be uploaded +to PAUSE using other means. + +=head2 After shipping + +Now the release is out and tagged. Start a new version number + + $ ./devtools/bump_version.pl + + $ svn ci -m "Changes, lib/***.pm - bump version" + +=cut +
