Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: libwww-perl/0.…
Fetching contributors…

Cannot retrieve contributors at this time

executable file 84 lines (65 sloc) 1.769 kb
#!/usr/local/bin/perl
=head1 VERSION
This is a self-modifying file. Whenever a version number in one of the
members increases, this program increases its own version number by
0.01. Members are enumerated below the __END__ token.
This implies that we get a new timestamp. If we make Makefile
dependent on this program, we get a new Makefile everytime one of the
versions changes. It is really not the cheapest solution, but maybe
the most trivial one.
Add a new module by writing its name on a line after the __END__ token.
Change the overall version number arbitrarily by changing it within
this file.
=head1 Author
Andreas Koenig <koenig@mind.de>
=cut
$VERSION=0.03;
use lib "lib";
while (<DATA>){
chop;
my($lib,$version)=split;
next unless $lib;
$lib{$lib}=$version || 0;
}
for $lib (sort keys %lib) {
push @m, "use $lib;";
push @n, "\$rewrite++ if \$$lib\::VERSION > $lib{$lib};\n";
push @o, "$lib \$$lib\::VERSION\n";
}
eval join "", @m;
die $@ if $@;
eval join "", @n;
die $@ if $@;
eval join "", "\$o = \"", @o, "\"";
die $@ if $@;
&rewrite if $rewrite;
printf "%.2f\n", $VERSION;
sub rewrite
{
$VERSION += 0.01;
open READ, "$0" or die "Can't read myself: $!";
$versions = "";
while (<READ>) {
s/(^\$VERSION=)\d+\.\d+/$1.$VERSION/e;
$versions .= $_;
last if /^__END__/;
}
close READ;
open WRITE, ">$0";
print WRITE $versions;
print WRITE $o;
close WRITE;
# Let's also update the version number in the README file
# XXX this does not work for me (aas@oslonett.no)
# $^I="~";
# @ARGV=qw(README);
# while (<>) {
# s/(lwp version)\\s+\\d+\\.\\d+([a-z]\d*)?/\$1 $VERSION/ig;
# }
}
__END__
HTTP::Date 1.07
LWP 0.03
LWP::Base64 1.06
LWP::Socket 1.06
URI::URL 3.03
Jump to Line
Something went wrong with that request. Please try again.