Commits

Shlomi Fish committed 368b391

Add the bump-version-number.pl script.

Comments (0)

Files changed (3)

     - Add a patch to implement the no_defdtd option in recent libxml2's:
         - https://rt.cpan.org/Ticket/Display.html?id=70878
         - Thanks to zzgrim@gmail.com .
+    - Add scripts/bump-version-number.pl to modify the version number globally.
+        - Currently the version numbers of the modules under lib/ where 1.73.
 
 1.87            Sat Aug 27 14:05:37 IDT 2011
     - Fix t/49callbacks_returning_undef.t to not read /etc/passed which may
 perl-libxml-sax.h
 ppport.h
 README
+scripts/bump-version-number.pl
 scripts/fast-eumm.pl
 scripts/prints-to-comments.pl
 scripts/Test.pm-to-Test-More.pl

scripts/bump-version-number.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find::Object;
+use IO::All;
+
+my $tree = File::Find::Object->new({}, 'lib/');
+
+my $version_n = shift(@ARGV);
+
+if (!defined($version_n))
+{
+    die "Specify version number as an argument! bump-version-number.pl '0.0.1'";
+}
+
+sub process_file
+{
+    # The filename.
+    my ($r) = @_;
+
+    my @lines = io->file($r)->getlines();
+    foreach (@lines)
+    {
+        s#(\$VERSION = '|^Version )\d+\.\d+(?:\.\d+)?('|)#$1 . $version_n . $2#e;
+    }
+    io->file($r)->print(
+        @lines
+    );
+}
+
+process_file('LibXML.pm');
+
+while (my $r = $tree->next()) {
+    if ($r =~ m{/\.svn\z})
+    {
+        $tree->prune();
+    }
+    elsif ($r =~ m{\.pm\z})
+    {
+        process_file($r);
+    }
+}
+