This repository has been archived on 2022-08-10. You can view files and clone it, but cannot push or open issues or pull requests.
chez-openbsd/newrelease

189 lines
6.3 KiB
Text
Raw Normal View History

2022-07-29 15:12:07 +02:00
#! /bin/csh -f
# newrelease
# Copyright 1984-2017 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if ($#argv != 2 && $#argv != 3) then
echo "Usage: newrelease <release-number> <machine type> [<workarea name>]"
exit 1
endif
# set R to release number
set R = $1
if ({(echo -n "$1" | grep '^[0-9]\.[0-9]$' >& /dev/null)}) then
# set MR to major release number
set MR = $R:r
# set mR to minor release number
set mR = $R:e
# set bR to build number
set bR = 0
# set ZR to release number w/o "."
set ZR = $MR$mR
# set underscoreR to release number w/ "_" in place of "."
set underscoreR = $MR"_"$mR
else if ({(echo -n "$1" | grep '^[0-9]\.[0-9]\.[0-9]$' >& /dev/null)}) then
# set MR to major release number
set tmp = $R:r
set MR = $tmp:r
# set mR to minor release number
set mR = $tmp:e
# set bR to build number
set bR = $R:e
# set ZR to release number w/o "."
set ZR = $MR$mR$bR
# set underscoreR to release number w/ "_" in place of "."
set underscoreR = $MR"_"$mR"_"$bR
else
echo "invalid release number $R"
exit 1
endif
# set M to machine type and W to workarea name
set M = $2
if ("$3" == "") then
set W = $M
else
set W = $3
endif
# clear running list of updated files
set maybeupdatedfiles = ()
./workarea $M $W
if ($status != 0) exit 1
cd $W
rm -f BUILDING
sed -e "s/Chez Scheme Version [^ ]*/Chez Scheme Version $R/" \
-e "s/Copyright 1984-.... /Copyright 1984-`date +%Y` /" \
../BUILDING > BUILDING
set maybeupdatedfiles = ($maybeupdatedfiles BUILDING)
rm -f NOTICE
sed -e "s/Chez Scheme Version [^ ]*/Chez Scheme Version $R/" \
-e "s/Copyright 1984-.... /Copyright 1984-`date +%Y` /" \
../NOTICE > NOTICE
set maybeupdatedfiles = ($maybeupdatedfiles NOTICE)
mkdir makefiles
sed -e "s/csv[0-9]\.[0-9]\(\.[0-9]\)*/csv$R/" ../makefiles/Mf-install.in > makefiles/Mf-install.in
sed -e "s/csug[0-9]\.[0-9]/csug$MR.$mR/" -e "s/csug[0-9]_[0-9]/csug$MR""_$mR/" ../makefiles/Makefile-csug.in > makefiles/Makefile-csug.in
set maybeupdatedfiles = ($maybeupdatedfiles makefiles/Mf-install.in makefiles/Makefile-csug.in)
rm -f scheme.1.in
sed -e "s/Chez Scheme Version [0-9]\.[0-9]\(\.[0-9]\)* .* [0-9][0-9]*/Chez Scheme Version $R `date +'%B %Y'`/" \
-e "s/Copyright .* Cisco Systems, Inc./Copyright `date +%Y` Cisco Systems, Inc./" \
../scheme.1.in > scheme.1.in
set maybeupdatedfiles = ($maybeupdatedfiles scheme.1.in)
rm -f c/Makefile.{,t}{i3,a6}nt
foreach fn (c/Makefile.{,t}{a6,i3}nt)
set maybeupdatedfiles = ($maybeupdatedfiles $fn)
sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" ../$fn > $fn
end
rm -f mats/Mf-{,t}{i3,a6}nt
foreach fn (mats/Mf-{,t}{a6,i3}nt)
set maybeupdatedfiles = ($maybeupdatedfiles $fn)
sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" ../$fn > $fn
end
sed -e "s/csv[0-9][.0-9][0-9]*/csv$ZR/g" ../workarea > workarea
chmod +x workarea
set maybeupdatedfiles = ($maybeupdatedfiles workarea)
set RCVERSION = "$MR,$mR,$bR,0"
sed -e "s/FILEVERSION .*/FILEVERSION $RCVERSION/"\
-e "s/PRODUCTVERSION .*/PRODUCTVERSION $RCVERSION/"\
-e 's/"FileDescription", .*/"FileDescription", "Chez Scheme Version '$R'"/'\
-e 's/"FileVersion", .*/"FileVersion", "'$R'"/'\
-e 's/"ProductVersion", .*/"ProductVersion", "'$R'"/'\
-e "s/Copyright 1984-..../Copyright 1984-`date +%Y`/g" ../c/scheme.rc > c/scheme.rc
set maybeupdatedfiles = ($maybeupdatedfiles c/scheme.rc)
rm -f s/7.ss
sed -e "s/nCopyright 1984-..../nCopyright 1984-`date +%Y`/g" ../s/7.ss > s/7.ss
set maybeupdatedfiles = ($maybeupdatedfiles s/7.ss)
rm -f s/cmacros.ss
set VNUM = `printf "%04x%02x%02x" $MR $mR $bR`
sed -e "s/scheme-version #x......../scheme-version #x$VNUM/" ../s/cmacros.ss > s/cmacros.ss
set maybeupdatedfiles = ($maybeupdatedfiles s/cmacros.ss)
mkdir release_notes
sed -e "s/thisversion{Version [^ ]*}/thisversion{Version $R}/" \
-e "s/pubmonth{.*}/pubmonth{`date +%B`}/" \
-e "s/pubyear{.*}/pubyear{`date +%Y`}/" \
../release_notes/release_notes.stex > release_notes/release_notes.stex
set maybeupdatedfiles = ($maybeupdatedfiles release_notes/release_notes.stex)
mkdir csug
sed -e "s/Revised\(.*\)for Chez Scheme Version [^ ]*\./Revised\1for Chez Scheme Version $R./" \
-e "s/\\copyright~.* Cisco Systems, Inc./\\copyright~`date +%Y` Cisco Systems, Inc./" \
../csug/copyright.stex > csug/copyright.stex
sed -e "s/Revised\(.*\)for Chez Scheme Version [^ ]*<br>/Revised\1for Chez Scheme Version $R<br>/" \
-e "s/Copyright &copy; .* Cisco Systems, Inc./Copyright \&copy; `date +%Y` Cisco Systems, Inc./" \
-e "s/\\def\\revisiondate{.*}/\\def\\revisiondate{`date +'%B %Y'`}/" \
../csug/csug.stex > csug/csug.stex
set maybeupdatedfiles = ($maybeupdatedfiles csug/copyright.stex csug/csug.stex)
rm -f bintar/Makefile
sed -e "s/^version = .*/version = $R/" \
-e "s/csv[0-9][0-9][0-9]*/csv$ZR/g" \
../bintar/Makefile > bintar/Makefile
set maybeupdatedfiles = ($maybeupdatedfiles bintar/Makefile)
rm -f rpm/Makefile
sed -e "s/^version = .*/version = $R/" ../rpm/Makefile > rpm/Makefile
set maybeupdatedfiles = ($maybeupdatedfiles rpm/Makefile)
rm -f pkg/Makefile
sed -e "s/^version = .*/version = $R/" \
-e "s/&copy; .* Cisco Systems/\&copy; `date +%Y` Cisco Systems/" \
../pkg/Makefile > pkg/Makefile
set maybeupdatedfiles = ($maybeupdatedfiles pkg/Makefile)
mkdir wininstall
sed -e "s/VERSION := .*/VERSION := $R/" ../wininstall/Makefile > wininstall/Makefile
set maybeupdatedfiles = ($maybeupdatedfiles wininstall/Makefile)
foreach fn (wininstall/{,t}{a6,i3}nt.wxs)
set maybeupdatedfiles = ($maybeupdatedfiles $fn)
sed -e "s/csv[0-9][0-9][0-9]*/csv$ZR/" ../$fn > $fn
end
set updatedfiles = ()
foreach x ($maybeupdatedfiles)
cmp -s ../$x $x || set updatedfiles = ($updatedfiles $x)
end
rm -f LOG
cat ../LOG > LOG
echo "" >> LOG
echo "$R changes:" >> LOG
echo "- updated version to $R" >> LOG
echo $updatedfiles | sed -e 's/^/ /' | fmt >> LOG
exit 0