Refactor inc_release script to allow reusing parts of it
No real changes, just extract the useful helpers from this script into another file.
This commit is contained in:
@@ -8,52 +8,7 @@
|
||||
# Licence: wxWindows licence
|
||||
##############################################################################
|
||||
|
||||
error() {
|
||||
echo "$progname: $*" >&2
|
||||
}
|
||||
|
||||
msg() {
|
||||
echo "$progname: $*"
|
||||
}
|
||||
|
||||
msgn() {
|
||||
echo -n "$progname: $*"
|
||||
}
|
||||
|
||||
msgc() {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
run_sed() {
|
||||
filename=$1
|
||||
shift
|
||||
cmd=
|
||||
while [ $# -gt 0 ]; do
|
||||
cmd="$cmd-e \"$1\" "
|
||||
shift
|
||||
done
|
||||
|
||||
msgn " processing $filename ... "
|
||||
eval "sed $cmd $filename" > $filename.$$
|
||||
if cmp -s $filename $filename.$$; then
|
||||
rm $filename.$$
|
||||
msgc "unchanged"
|
||||
else
|
||||
mv $filename.$$ $filename
|
||||
msgc "done"
|
||||
fi
|
||||
}
|
||||
|
||||
progname=`basename $0`
|
||||
|
||||
# we must be run from wx directory
|
||||
if [ ! -f wxwin.m4 ]; then
|
||||
error "must be ran from root wx directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# exit on any error
|
||||
set -e
|
||||
. `dirname $0`/run_sed_common.sh
|
||||
|
||||
# the primary source of information is wx/version.h
|
||||
ver_string=`grep '#define wxVERSION_STRING ' include/wx/version.h | sed 's/^.*"wxWidgets \(.*\)")/\1/'`
|
||||
|
Reference in New Issue
Block a user