#!/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 {(