Skip to content

Commit

Permalink
[misc] drop the micro from the version
Browse files Browse the repository at this point in the history
* Closes #439
  • Loading branch information
pbatard committed Feb 8, 2015
1 parent 61d2efc commit 1c322ab
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 163 deletions.
27 changes: 11 additions & 16 deletions _chver.sh
Expand Up @@ -5,12 +5,11 @@
type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }

if [ ! -n "$1" ]; then
echo "you must provide a version number (eg. 1.0.2)"
echo "you must provide a version number (eg. 2.1)"
exit 1
else
MAJOR=`echo $1 | sed "s/\(.*\)[.].*[.].*/\1/"`
MINOR=`echo $1 | sed "s/.*[.]\(.*\)[.].*/\1/"`
MICRO=`echo $1 | sed "s/.*[.].*[.]\(.*\)/\1/"`
MAJOR=`echo $1 | sed "s/\(.*\)[.].*/\1/"`
MINOR=`echo $1 | sed "s/.*[.]\(.*\)/\1/"`
fi
case $MAJOR in *[!0-9]*)
echo "$MAJOR is not a number"
Expand All @@ -20,22 +19,18 @@ case $MINOR in *[!0-9]*)
echo "$MINOR is not a number"
exit 1
esac
case $MICRO in *[!0-9]*)
echo "$MICRO is not a number"
exit 1
esac
echo "changing version to $MAJOR.$MINOR.$MICRO"
sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR.$MICRO]\2/" configure.ac
echo "changing version to $MAJOR.$MINOR"
sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR]\2/" configure.ac
cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*.*,.*,.*,\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/
s/^[ \t]*PRODUCTVERSION[ \t]*.*,.*,.*,\(.*\)/ PRODUCTVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "FileVersion", "@@MAJOR@@.@@MINOR@@.@@MICRO@@.\2"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "ProductVersion", "@@MAJOR@@.@@MINOR@@.@@MICRO@@.\2"/
s/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.@@MICRO@@.\3"\4/
s/^[ \t]*FILEVERSION[ \t]*.*,.*,\(.*\),\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,\1,\2/
s/^[ \t]*PRODUCTVERSION[ \t]*.*,.*,\(.*\),\(.*\)/ PRODUCTVERSION @@MAJOR@@,@@MINOR@@,\1,\2/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*".*\..*\.\(.*\)"/\1VALUE "FileVersion", "@@MAJOR@@.@@MINOR@@.\2"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*".*\..*\.\(.*\)"/\1VALUE "ProductVersion", "@@MAJOR@@.@@MINOR@@.\2"/
s/^\(.*\)"Rufus \.*\.\.*\.\(.*\)\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.\2.\3"\4/
_EOF

# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" -e "s/@@MICRO@@/$MICRO/g" cmd.sed
sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" cmd.sed
sed -i -f cmd.sed src/rufus.rc
sed -i 's/$/\r/' src/rufus.rc
rm cmd.sed
Expand Down
12 changes: 6 additions & 6 deletions _pre-commit.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Bumps the nano version according to the number of commits on this branch
# Bumps the micro version according to the number of commits on this branch
#
# To have git run this script on commit, create a "pre-commit" text file in
# .git/hooks/ with the following content:
Expand All @@ -15,22 +15,22 @@ type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1
VER=`git log --oneline | wc -l`
# adjust so that we match the github commit count
TAGVER=`expr $VER + 1`
# there may be a better way to prevent improper nano on amend. For now the detection
# there may be a better way to prevent improper micro on amend. For now the detection
# of a .amend file in the current directory will do
if [ -f ./.amend ]; then
TAGVER=`expr $TAGVER - 1`
git tag -d "b$TAGVER"
rm ./.amend;
fi
echo "setting nano to $TAGVER"
echo "setting micro to $TAGVER"
echo $TAGVER > .tag

cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ FILEVERSION \1,\2,\3,@@TAGVER@@/
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),\(.*\),.*/ PRODUCTVERSION \1,\2,\3,@@TAGVER@@/
s/^[ \t]*FILEVERSION[ \t]*\(.*\),\(.*\),.*,\(.*\)/ FILEVERSION \1,\2,@@TAGVER@@,\3/
s/^[ \t]*PRODUCTVERSION[ \t]*\(.*\),\(.*\),.*,\(.*\)/ PRODUCTVERSION \1,\2,@@TAGVER@@,\3/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*"\(.*\)\..*"/\1VALUE "FileVersion", "\2.@@TAGVER@@"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*"\(.*\)\..*"/\1VALUE "ProductVersion", "\2.@@TAGVER@@"/
s/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus \2.@@TAGVER@@"\4/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@TAGVER@@"\3/
_EOF

# First run sed to substitute our variable in the sed command file
Expand Down
20 changes: 10 additions & 10 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for rufus 2.0.0.
# Generated by GNU Autoconf 2.69 for rufus 2.0.
#
# Report bugs to <https://github.com/pbatard/rufus/issues>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='2.0.0'
PACKAGE_STRING='rufus 2.0.0'
PACKAGE_VERSION='2.0'
PACKAGE_STRING='rufus 2.0'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='http://rufus.akeo.ie'

Expand Down Expand Up @@ -1226,7 +1226,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rufus 2.0.0 to adapt to many kinds of systems.
\`configure' configures rufus 2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1292,7 +1292,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rufus 2.0.0:";;
short | recursive ) echo "Configuration of rufus 2.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1382,7 +1382,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rufus configure 2.0.0
rufus configure 2.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1437,7 +1437,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 2.0.0, which was
It was created by rufus $as_me 2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2300,7 +2300,7 @@ fi
# Define the identity of the package.
PACKAGE='rufus'
VERSION='2.0.0'
VERSION='2.0'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -4371,7 +4371,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rufus $as_me 2.0.0, which was
This file was extended by rufus $as_me 2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4425,7 +4425,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
rufus config.status 2.0.0
rufus config.status 2.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
@@ -1,4 +1,4 @@
AC_INIT([rufus], [2.0.0], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AC_INIT([rufus], [2.0], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -38,7 +38,7 @@ if test "x$alpha_enabled" != "xno" ; then
CFLAGS+=" -DALPHA"
SUFFIX=_ALPHA
fi
AC_ARG_ENABLE([beta],[AS_HELP_STRING([--enable-beta], [build a BETA release (default=no)])], [beta_enabled=$enableval], [beta_enabled='no'])
AC_ARG_ENABLE([beta],[AS_HELP_STRING([--enable-beta], [build a BETA release (default=no)])], [beta_enabled=$enableval], [beta_enabled='no'])
if test "x$beta_enabled" != "xno" ; then
CFLAGS+=" -DBETA"
SUFFIX=_BETA
Expand Down

0 comments on commit 1c322ab

Please sign in to comment.