diff options
author | mertz | 2005-05-13 15:52:44 +0000 |
---|---|---|
committer | mertz | 2005-05-13 15:52:44 +0000 |
commit | 12bb4a87e13838cdcd898e7d52a91943597dbf34 (patch) | |
tree | 183f0ac46a6cb980d7736a782027bce4830e6b2a /Perl | |
parent | 390dc1f5ba02664019563e82582834260c82b641 (diff) | |
download | tkzinc-12bb4a87e13838cdcd898e7d52a91943597dbf34.zip tkzinc-12bb4a87e13838cdcd898e7d52a91943597dbf34.tar.gz tkzinc-12bb4a87e13838cdcd898e7d52a91943597dbf34.tar.bz2 tkzinc-12bb4a87e13838cdcd898e7d52a91943597dbf34.tar.xz |
- the exported directory is again correctly version-numbered
- the $VERSION in Tk::Zinc is computed automatically and updated.
Diffstat (limited to 'Perl')
-rwxr-xr-x | Perl/export2cpan | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Perl/export2cpan b/Perl/export2cpan index 766422e..830e243 100755 --- a/Perl/export2cpan +++ b/Perl/export2cpan @@ -47,7 +47,24 @@ sub version4cpan { close (FD); - return "$major.$minor$patchlevel"; + return sprintf ("%d.%d%02d", $major,$minor,$patchlevel); +} + +sub filesubst { + my ($fileIn, $fileOut, $key, $val) = @_; + + open(FDIN, "<$fileIn") or die "Could not open input file $fileIn"; + open(FDOUT, ">$fileOut") or die "Could not open output file $fileOut"; + + while (<FDIN>) { + if (/$key/) { + s/$key/$val/g; + } + print FDOUT $_; + } + + close(FDIN); + close(FDOUT); } my $VERSION; @@ -94,7 +111,7 @@ if ($FROM_CVS) { else { $VERSION = version4cpan; print "cd ..; ./configure\n"; - system ("cd ..; ./configure"); # for creating Zinc.pm and Makefile.pl from xxx.in files + system ("cd ..; ./configure"); # for creating Makefile.pl from xxx.in files } print "VERSION $VERSION\n"; @@ -137,8 +154,9 @@ foreach my $f (@files) { system("$CP $f $EXPORT_DIR/$VERSION_DIR"); } +# modifying the $VERSION of Zinc.pm with the correctly perl formated version scheme. +&filesubst ('Zinc.pm', "$EXPORT_DIR/$VERSION_DIR/Zinc.pm", '^\$VERSION *=.*;', "\$VERSION = $VERSION;"); -system("$CP Zinc.pm $EXPORT_DIR/$VERSION_DIR"); system("$CP Makefile.PL $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.c $EXPORT_DIR/$VERSION_DIR"); system("$CP ../generic/*.h $EXPORT_DIR/$VERSION_DIR"); |