Index: openacs-4/contrib/misc/renumber_info_files =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/misc/renumber_info_files,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/misc/renumber_info_files 20 Apr 2004 21:12:19 -0000 1.2 @@ -0,0 +1,116 @@ +#!/usr/bin/tclsh + +# update version numbers in .info files for core packages. +# +set help_p 0 +set verbose_p 0 +set args $argv + +set packages { + acs-lang + acs-admin + acs-api-browser + acs-bootstrap-installer + acs-content-repository + acs-core-docs + acs-kernel + acs-mail + acs-messaging + notifications + acs-reference + acs-subsite + acs-tcl + acs-templating + acs-service-contract + search + acs-automated-testing + acs-authentication + ref-timezones +} + + +if {![string match */packages [pwd]]} { + puts stderr "FATAL: must be in the packages directory to run this script" + exit +} + +while {[llength $args] > 0} { + set arg [lindex $args 0] + set args [lrange $args 1 end] + switch -glob -- $arg { + --help* - -h {set help_p 1} + --version { + set version [string trim [lindex $args 0]] + set args [lrange $args 1 end] + if {![regexp {^5\.[0-9]+\.[0-9]+([ad][0-9]+)?$} $version]} { + puts stderr "FATAL: illegal version $version" + exit 1 + } + } + --verbose - -v { + set verbose_p 1 + } + } +} + +if { $help_p } { + puts stdout "Usage: rev --version VERNUM" + exit +} + +if { $verbose_p } { + puts stdout "moving to version $version" +} + +foreach package $packages { + set file $package/$package.info + if {![file exists $file]} { + puts stderr "ABORTING: package .info file $file not found" + exit 1 + } + if {[catch {set fp [open $file r+]} errMsg]} { + puts stderr "ABORTING: package .info file $file could not be opened for reading and writing" + exit 1 + } + + # read the contents of the file. + set new [read $fp] + close $fp + + #--------------------------------------------------------------------- + # here's what we're looking for + #--------------------------------------------------------------------- + # + # + #--------------------------------------------------------------------- + # here's what we don't want to touch + #--------------------------------------------------------------------- + # + #--------------------------------------------------------------------- + + regsub {(} $new "" new + regsub {(