1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
#! /bin/sh
#
# newversion - prepares the tree for a new version number in git
#
# Copyright (C) 2004 - 2025 Eggheads Development Team
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
MOD_CONFIGURE_ACS="src/mod/compress.mod/configure.ac src/mod/dns.mod/configure.ac"
DOCS="doc/sphinx_source/using/tcl-commands.rst \
doc/sphinx_source/using/text-sub.rst"
fix_version_h() {
sed -ie 's:^#define EGG_NUMVER.*$:#define EGG_NUMVER '${NEW_NUMVERSION}':' src/version.h
sed -ie 's:^#define EGG_STRINGVER.*$:#define EGG_STRINGVER '\"${NEW_EGGVERSION}\"':' src/version.h
}
if test ! -f src/main.c; then
echo "You are not in the Eggdrop root directory."
exit 1
fi
umask 022
OLD_EGGVERSION=$(grep AC_INIT configure.ac| sed -e 's/AC_INIT(\[Eggdrop\],\[//g' -e 's/\],\[bugs@eggheads.org\].*//g')
NEW_EGGVERSION=$(echo $OLD_EGGVERSION | cut -d. -f1-2).$(($(echo $OLD_EGGVERSION | cut -d. -f3) + 1))
#NEW_EGGVERSION="1.10.0"
NEW_NUMVERSION=$(($(grep '^#define EGG_NUMVER.*' src/version.h |cut -d " " -f 3|sed -e 's/..$/00/') + 100))
#NEW_NUMVERSION="1090000"
#Remove existing staged files
git reset HEAD -- .
echo ""
# Generate ChangeLog
###git log $(git rev-list -n 1 v${OLD_EGGVERSION})..HEAD --name-only --no-merges --pretty=format:"- - - - - - - - - - - - - - -%n%w(75)Commit %h (%ai) by %aN%n %s %n %b" > ChangeLog
TRIMVERSION=${NEW_EGGVERSION%rc*}
MAX=$(echo ${OLD_EGGVERSION}| cut -d "." -f 3)
MAJOR=$(echo ${OLD_EGGVERSION}| rev| cut -d "." -f2- |rev)
MAJOR=${MAJOR%rc*}
MINOR=0
while [ $MINOR -le $MAX ]; do
INCLUDE="${INCLUDE} -i v${MAJOR}.${MINOR}"
MINOR=$(expr $MINOR + 1)
done
git fetch origin
git fetch -t origin
#echo "Running misc/genchanges -l $INCLUDE -i develop -r origin full > ChangeLog"
#misc/genchanges -l $INCLUDE -i develop -r origin full > ChangeLog
#gzip -f ChangeLog
#git add ChangeLog.gz
#Generate doc/ChangesX.Y file
MINOR=1
INCLUDE=""
while [ $MINOR -le $MAX ]; do
INCLUDE="${INCLUDE} -i v${MAJOR}.${MINOR}"
MINOR=$(expr $MINOR + 1)
done
#echo "Running misc/genchanges -l -e v1.6.21 -e v1.8.0 $INCLUDE -i develop -v ${MAJOR}.${MINOR}rc1 -r origin short > doc/Changes1.8"
#misc/genchanges -l -e v1.6.21 -e v1.8.0 $INCLUDE -i develop -v ${MAJOR}.${MINOR}rc1 -r origin short > doc/Changes1.8
#git add doc/Changes1.8
#git commit -m "Generate ChangeLog/Changes files for ${NEW_EGGVERSION}" > /dev/null
# Remove patchlevel.
echo -n "Setting alpha patchlevel for a stable release..."
misc/setpatch alpha >/dev/null
echo " done."
# Fix version.h.
echo -n "Updating src/version.h..."
fix_version_h
echo " done."
# Fix configure.ac's.
echo -n "Fixing configure.ac files..."
for i in $MOD_CONFIGURE_ACS configure.ac; do
sed 's:'${OLD_EGGVERSION}':'${NEW_EGGVERSION}':g' $i > ${i}_
mv ${i}_ $i
done
echo " done."
echo -n "Fixing docs..."
sed -i 's:'${OLD_EGGVERSION}':'${NEW_EGGVERSION}':g' doc/sphinx_source/conf.py
for i in $DOCS; do
sed -i 's:'${OLD_EGGVERSION}':'${NEW_EGGVERSION}':g' $i
done
echo " done."
git commit -am "Update version strings to ${NEW_EGGVERSION}" > /dev/null
# Generate docs
echo -n "Generating docs (be patient)..."
misc/generatedocs > /dev/null 2>&1
git commit -am "Generate docs with ${NEW_EGGVERSION} version" > /dev/null
echo " done."
# Run autoconf
echo -n "Running autoconf..."
CURRENT_PWD=$PWD
autoconf
for i in $MOD_CONFIGURE_ACS; do
cd ${CURRENT_PWD}/`dirname $i` && autoconf
done
cd $CURRENT_PWD
git commit -am "Run autoconf" > /dev/null
echo " done."
echo ""
echo ""
echo "Summary:"
echo "--------"
echo ""
echo "version.h:"
grep "^#define.*" src/version.h
echo ""
echo "Docs version string:"
grep "^version = .*" doc/sphinx_source/conf.py
echo ""
echo "Complete."
echo ""
|