📄 mupdate
字号:
#!/bin/sh# mpatrol# A library for controlling and tracing dynamic memory allocations.# Copyright (C) 1997-2002 Graeme S. Roy <graeme.roy@analog.com>## This library is free software; you can redistribute it and/or# modify it under the terms of the GNU Library General Public# License as published by the Free Software Foundation; either# version 2 of the License, or (at your option) any later version.## This library is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# Library General Public License for more details.## You should have received a copy of the GNU Library General Public# License along with this library; if not, write to the Free# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,# MA 02111-1307, USA.# UNIX shell script to update the mpatrol library version and create a new# release archive - this file should be used for administrative purposes only# $Id: mupdate,v 1.19 2002/01/08 20:38:24 graeme Exp $# Read the old release version and release date from the VERSION file.if [ ! -f VERSION ]then echo "cannot locate VERSION file" >&2 exit 1firead oldcnt olddate <VERSIONoldver=`expr "$oldcnt" : '\([^.]*\)'`oldcnt=`expr "$oldcnt" : '[^.]*\.\(.*\)'`oldrev=`expr "$oldcnt" : '\([^.]*\)'`oldcnt=`expr "$oldcnt" : '[^.]*\.\(.*\)'`newver="$oldver"newrev="$oldrev"newcnt=`expr "$oldcnt" + 1`newdate=`date +"%d %B %Y %H:%M:%S %Z"`release="$newver.$newrev.$newcnt"# Change the mpatrol.h and version.h header files in order to update the# MPATROL_VERSION, MP_VERNUM and MP_VERSION preprocessor macros with the latest# version of the library.oldvernum=`printf %d%02d%02d $oldver $oldrev $oldcnt`newvernum=`printf %d%02d%02d $newver $newrev $newcnt`oldversion="$oldver\\.$oldrev\\.$oldcnt"newversion="$newver\\.$newrev\\.$newcnt"sed "s/MPATROL_VERSION $oldvernum/MPATROL_VERSION $newvernum/" \ src/mpatrol.h >src/mpatrol.h.newmv src/mpatrol.h.new src/mpatrol.hcvs commit -m "Updated to version $release" src/mpatrol.h >/dev/null 2>&1sed -e "s/MP_VERNUM $oldvernum/MP_VERNUM $newvernum/" \ -e "s/MP_VERSION \"mpatrol $oldversion\"/MP_VERSION \"mpatrol $newversion\"/" \ src/version.h >src/version.h.newmv src/version.h.new src/version.hcvs commit -m "Updated to version $release" src/version.h >/dev/null 2>&1# Change the version.c source file in order to update the release date strings.olddate1=`date -d"$olddate" +"(%y\\/%m\\/%d)"`olddate2=`date -d"$olddate" +"(%d\\.%m\\.%y)"`olddate3=`date -d"$olddate" +"(%d %B %Y)"`newdate1=`date -d"$newdate" +"(%y\\/%m\\/%d)"`newdate2=`date -d"$newdate" +"(%d\\.%m\\.%y)"`newdate3=`date -d"$newdate" +"(%d %B %Y)"`sed -e "s/MP_VERSION \" $olddate1\"/MP_VERSION \" $newdate1\"/" \ -e "s/MP_VERSION \" $olddate2\"/MP_VERSION \" $newdate2\"/" \ -e "s/MP_VERSION \" $olddate3\"/MP_VERSION \" $newdate3\"/" \ src/version.c >src/version.c.newmv src/version.c.new src/version.ccvs commit -m "Updated to version $release" src/version.c >/dev/null 2>&1# Update the ChangeLog and NEWS files with all the changes since the last# release.rcs2log -R -u 'graeme:Graeme Roy:graeme.roy@analog.com' >ChangeLog.new 2>/dev/nullcp ChangeLog.new NEWS.newcat ChangeLog >>ChangeLog.newcat NEWS >>NEWS.newvi ChangeLog.newcmp ChangeLog ChangeLog.new >/dev/null 2>&1if [ $? != 0 ]then mv ChangeLog.new ChangeLog cvs commit -m "Updated to version $release" ChangeLog >/dev/null 2>&1else rm -f ChangeLog.newfivi NEWS.newcmp NEWS NEWS.new >/dev/null 2>&1if [ $? != 0 ]then mv NEWS.new NEWS cvs commit -m "Updated to version $release" NEWS >/dev/null 2>&1else rm -f NEWS.newfi# Write the new release version and release date to the VERSION file.echo "$release $newdate" >VERSIONcvs commit -m "Updated to version $release" VERSION >/dev/null 2>&1# Tag the entire distribution.cvs tag REL_${newver}_${newrev}_${newcnt} >/dev/null 2>&1# Remove the CVS subdirectories and .cvsignore files.for dir in `find . -name CVS -print`do rm -rf "$dir"donefor file in `find . -name .cvsignore -print`do rm -f "$file"done# Build the documentation.cd docmake all >/dev/null 2>&1cd ../manmake all >/dev/null 2>&1cd ..# Create the CHECKSUMS file.rm -f CHECKSUMScat <<EOF >/tmp/mupdate.md5# Use the following command to check the integrity of this distribution:# md5sum --check CHECKSUMSEOFmd5sum `find . -type f -print` >>/tmp/mupdate.md5cp /tmp/mupdate.md5 CHECKSUMSrm -f /tmp/mupdate.md5# Create a new release archive.archive="mpatrol_$release.tar"cd ..tar cf "$archive" mpatrolgzip "$archive"echo "created $archive.gz" >&2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -