From 3f823b2fb0a17832ade53e017ca7743a4fd85ee2 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 25 May 2005 08:19:52 +0000 Subject: Adapted following change in version number handling of Zinc.pm and MAkefile.PL --- win/package.tcl | 76 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 30 deletions(-) (limited to 'win/package.tcl') diff --git a/win/package.tcl b/win/package.tcl index 7585c01..cd2cbdb 100644 --- a/win/package.tcl +++ b/win/package.tcl @@ -8,6 +8,36 @@ set todo [lindex $argv 0] set root [file join [file dirname [info script]] ..] +# +# First get the configure variable values. +# +set fid [open [file join $root configure.in]] +while { ! [eof $fid] } { + set line [gets $fid] + if { [regexp {^MAJOR_VERSION=(.*)$} $line dummy major] } { + continue + } + if { [regexp {^MINOR_VERSION=(.*)$} $line dummy minor] } { + continue + } + if { [regexp {^PATCHLEVEL=(.*)$} $line dummy patchlevel] } { + continue + } + if { [regexp {^VERSION=(.*)$} $line dummy version] } { + continue + } + if { [regexp {^PACKAGE=(.*)$} $line dummy package] } { + continue + } + if { [regexp {^Tkzinc_LIB_FILE=(.*)$} $line dummy libFile] } { + continue + } + if { [regexp {^Tkzincstub_LIB_FILE=(.*)$} $line dummy stubLibFile] } { + continue + } +} +close $fid + if { $todo eq "subst" || $todo eq "" } { # # Substitute @variables@ in the .in registred files @@ -23,35 +53,6 @@ if { $todo eq "subst" || $todo eq "" } { { win Tkzinc.wxs } } - # - # First get the variable values. - # - set fid [open [file join $root configure.in]] - while { ! [eof $fid] } { - set line [gets $fid] - if { [regexp {^MAJOR_VERSION=(.*)$} $line dummy major] } { - continue - } - if { [regexp {^MINOR_VERSION=(.*)$} $line dummy minor] } { - continue - } - if { [regexp {^PATCHLEVEL=(.*)$} $line dummy patchlevel] } { - continue - } - if { [regexp {^VERSION=(.*)$} $line dummy version] } { - continue - } - if { [regexp {^PACKAGE=(.*)$} $line dummy package] } { - continue - } - if { [regexp {^Tkzinc_LIB_FILE=(.*)$} $line dummy libFile] } { - continue - } - if { [regexp {^Tkzincstub_LIB_FILE=(.*)$} $line dummy stubLibFile] } { - continue - } - } - close $fid set libFile "${package}${major}${minor}.dll" set stubLibFile "${package}stub${major}${minor}.dll" @@ -138,9 +139,24 @@ if { $todo eq "perl" || $todo eq "" } { } file mkdir $buildDir - foreach f {t Zinc.xs Zinc.pm Makefile.PL demos README Zinc} { + foreach f {t Zinc.xs demos README Zinc} { file copy -force [file join $root Perl $f] $buildDir } + # + # Add the version in Zinc.pm and Makefile.PL + foreach f {Zinc.pm Makefile.PL} { + set fid [open [file join $root Perl $f]] + set fod [open [file join $buildDir $f] w] + + while { ! [eof $fid] } { + set line [gets $fid] + regsub -all SEEexport2cpan $line [format "%d.%d%02d" $major $minor $patchlevel] line + puts $fod $line + } + + close $fid + close $fod + } foreach f [glob -nocomplain [file join $root generic *.c] [file join $root generic *.h] \ [file join $root win *.c] [file join $root debian changelog] \ [file join $root debian copyright]] { -- cgit v1.1