/usr/share/tcltk/xotcl1.6.7-lib/changeXOTclVersion.xotcl is in xotcl 1.6.7-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | #
# this is a maintenance program for XOTcl that allows us to change the
# version information across the whole distribution automatically.
#
# this program assumes that pwd is in xotcl-full-X.X* directory or subdir
#
set XOTCL_MAJOR_VERSION 1
set XOTCL_MINOR_VERSION 6
set XOTCL_RELEASE_LEVEL .6
# example settings:
# 1.0
#set XOTCL_MAJOR_VERSION 1
#set XOTCL_MINOR_VERSION 0
#set XOTCL_RELEASE_LEVEL .3
#
# 0.9.3
#set XOTCL_MAJOR_VERSION 0
#set XOTCL_MINOR_VERSION 9
#set XOTCL_RELEASE_LEVEL .3
#set XOTCL_MAJOR_VERSION 0
#set XOTCL_MINOR_VERSION 9
#set XOTCL_RELEASE_LEVEL .3
#set XOTCL_RELEASE_LEVEL .4
#set XOTCL_RELEASE_LEVEL .5
set XOTCL_VERSION $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION
set FULL_VERSION $XOTCL_VERSION$XOTCL_RELEASE_LEVEL
if {![regexp {((^.*/xotcl-)([0-9.]*))/?} [pwd] _ topdirname topdirprefix oldversion]} {
error "this program assumes that pwd is in xotcl-X.X* directory"
}
puts "Prior version is: $oldversion"
puts "New version is: $FULL_VERSION"
puts "Working in: $topdirname"
cd $topdirname
puts "... make clean first"
if {[file exists Makefile]} {
exec make clean
}
foreach file [exec find . -name configure.in] {
puts "... updating $file"
set F [open $file]; set c [read $F]; close $F
set newFile ""
foreach line [split $c \n] {
set newLine $line
if {[regexp {^XOTCL_MAJOR_VERSION=[0-9]} $line]} {
set line "XOTCL_MAJOR_VERSION=$XOTCL_MAJOR_VERSION"
} elseif {[regexp {^XOTCL_MINOR_VERSION=[0-9]} $line]} {
set line "XOTCL_MINOR_VERSION=$XOTCL_MINOR_VERSION"
} elseif {[regexp {^XOTCL_RELEASE_LEVEL=} $line]} {
set line "XOTCL_RELEASE_LEVEL=$XOTCL_RELEASE_LEVEL"
} elseif {[regexp {^define\(XOTclVersion, .*$} $line]} {
set line "define(XOTclVersion, $XOTCL_MAJOR_VERSION.$XOTCL_MINOR_VERSION$XOTCL_RELEASE_LEVEL)"
}
append newFile $line\n
}
set F [open $file w]; puts $F $newFile; close $F
}
set newtopdirname $topdirprefix$FULL_VERSION
if {$oldversion != $FULL_VERSION} {
puts "topdir: $topdirname->$newtopdirname"
file rename -force $topdirname $newtopdirname
}
cd $newtopdirname
foreach file [exec find . -name configure.in] {
set dir [file dirname $file]
set oldpwd [pwd]
cd $dir
exec autoconf
cd $oldpwd
}
# determine last configure command
cd $newtopdirname
if {[catch {set configurecmd [exec fgrep {$ ./configure} config.log]}]} {
set configurecmd "./configure"
} else {
regsub {^ +\$ } $configurecmd "" configurecmd
}
#puts $configurecmd
cd $newtopdirname/
puts "Configuring in [pwd]"
eval exec $configurecmd
puts "ok ... version is now $FULL_VERSION"
|