Reorder files in maint/ subdirectory.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2013-04-09 14:51:24 +03:00
parent 80c8d58003
commit 1c6d859629
24 changed files with 98 additions and 66 deletions

View File

@ -20,11 +20,11 @@ CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/version.h
.PHONY: update-version .PHONY: update-version
update-version: update-version:
@if test -x $(top_srcdir)/maint/version.sh; then \ @if test -x $(top_srcdir)/maint/utils/version.sh; then \
$(top_srcdir)/maint/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \ $(top_srcdir)/maint/utils/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \
else \ else \
if test ! -e $(top_srcdir)/version.h; then \ if test ! -e $(top_srcdir)/version.h; then \
echo "File not found: $(top_srcdir)/maint/version.sh"; \ echo "File not found: $(top_srcdir)/maint/utils/version.sh"; \
exit 1; \ exit 1; \
fi; \ fi; \
fi fi

View File

@ -23,7 +23,7 @@ set -e
$AUTOPOINT --version >/dev/null 2>&1 $AUTOPOINT --version >/dev/null 2>&1
if test $? -ne 0; then if test $? -ne 0; then
AUTOPOINT=maint/autopoint AUTOPOINT=maint/utils/autopoint
fi fi
cd "$srcdir" cd "$srcdir"
@ -84,7 +84,7 @@ test -f configure || \
{ echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; } { echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; }
) || exit 1 ) || exit 1
$srcdir/maint/version.sh "$srcdir" $srcdir/maint/utils/version.sh "$srcdir"
if test -x $srcdir/configure.mc; then if test -x $srcdir/configure.mc; then
$srcdir/configure.mc "$@" $srcdir/configure.mc "$@"

View File

@ -9,7 +9,7 @@ dnl @copyright Free Software Foundation, Inc.
AC_DEFUN([MC_VERSION],[ AC_DEFUN([MC_VERSION],[
if test ! -f ${srcdir}/version.h; then if test ! -f ${srcdir}/version.h; then
${srcdir}/maint/version.sh ${srcdir} ${srcdir}/maint/utils/version.sh ${srcdir}
fi fi
if test -f ${srcdir}/version.h; then if test -f ${srcdir}/version.h; then
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/') VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/')

View File

@ -27,7 +27,7 @@
#set -e #set -e
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(pwd))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************

View File

@ -27,7 +27,7 @@ set -e
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(pwd))))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************
@ -38,8 +38,8 @@ findIncludeDupsInDir() {
for i in $(find "${dir_name}" -name '*.[ch]'); do for i in $(find "${dir_name}" -name '*.[ch]'); do
file_name=$(echo $i | sed 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g') file_name=$(echo $i | sed 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g')
[ $(grep "^\s*${file_name}$" -c "${MC_SOURCE_ROOT_DIR}/maint/find-dup-includes/exclude-list.cfg") -ne 0 ] && continue [ $(grep "^\s*${file_name}$" -c "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/exclude-list.cfg") -ne 0 ] && continue
"${MC_SOURCE_ROOT_DIR}/maint/find-dup-includes/find-in-one-file.pl" "${i}" "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/find-in-one-file.pl" "${i}"
done done
} }

View File

@ -50,7 +50,7 @@ getConfigFile() {
sync_file_name=$1; shift sync_file_name=$1; shift
config_file_name=$1; shift config_file_name=$1; shift
echo "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/config.d/${sync_file_name}/${config_file_name}" echo "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/config.d/${sync_file_name}/${config_file_name}"
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------

View File

@ -25,11 +25,11 @@
set -e set -e
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
#*** file scope functions ********************************************** #*** file scope functions **********************************************

View File

@ -25,11 +25,11 @@
set -e set -e
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
#*** file scope functions ********************************************** #*** file scope functions **********************************************

View File

@ -25,11 +25,11 @@
set -e set -e
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(dirname $(pwd))))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
#*** file scope functions ********************************************** #*** file scope functions **********************************************

View File

@ -25,11 +25,11 @@
set -e set -e
MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(pwd)))} MC_SOURCE_ROOT_DIR=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(pwd))))}
#*** include section (source functions, for example) ******************* #*** include section (source functions, for example) *******************
source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
#*** file scope functions ********************************************** #*** file scope functions **********************************************

79
maint/utils/version.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/sh
# Midnight Commander - calculate current version
#
# Copyright (C) 2009, 2010, 2013
# The Free Software Foundation, Inc.
#
# Written by:
# Slava Zanko <slavazanko@gmail.com>, 2009, 2010, 2013
# Stan. S. Krupoderov <pashelper@gmail.com>, 2009
# Sergei Trofimovich <slyfox@inbox.ru>, 2009
# Oswald Buddenhagen <ossi@kde.org>, 2009
#
# This file is part of the Midnight Commander.
#
# The Midnight Commander 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 3 of the License,
# or (at your option) any later version.
#
# The Midnight Commander 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, see <http://www.gnu.org/licenses/>.
#*** include section (source functions, for example) *******************
#*** file scope functions **********************************************
mc_print_version(){
if [ ! -f "${VERSION_FILE}" \
-o "${PREV_MC_VERSION}" != "${CURR_MC_VERSION}" ]
then
cat >"${VERSION_FILE}" <<EOF
#ifndef MC_CURRENT_VERSION
/* This is an autogenerated file. Don't edit! */
#define MC_CURRENT_VERSION "${CURR_MC_VERSION}"
#endif
EOF
fi
exit
}
#*** main code *********************************************************
if [ -z "$1" ]
then
echo "usage: $0 <toplevel-source-dir>"
exit 1
fi
src_top_dir="$1"
VERSION_FILE="${src_top_dir}/version.h"
PREV_MC_VERSION="unknown"
CURR_MC_VERSION="${PREV_MC_VERSION}"
if [ -r "${VERSION_FILE}" ]
then
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
CURR_MC_VERSION="${PREV_MC_VERSION}"
fi
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
[ -z "${git_head}" ] && mc_print_version
# try to store sha1
CURR_MC_VERSION="${git_head}"
new_version=`git --git-dir "${src_top_dir}/.git" describe 2>/dev/null`
[ -z "${new_version}" ] && mc_print_version
# store pretty tagged version
CURR_MC_VERSION="${new_version}"
mc_print_version

View File

@ -1,47 +0,0 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "usage: $0 <toplevel-source-dir>"
exit 1
fi
src_top_dir="$1"
VERSION_FILE="${src_top_dir}/version.h"
PREV_MC_VERSION="unknown"
CURR_MC_VERSION="${PREV_MC_VERSION}"
if [ -r "${VERSION_FILE}" ]
then
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
CURR_MC_VERSION="${PREV_MC_VERSION}"
fi
mc_print_version(){
if [ ! -f "${VERSION_FILE}" \
-o "${PREV_MC_VERSION}" != "${CURR_MC_VERSION}" ]
then
cat >"${VERSION_FILE}" <<EOF
#ifndef MC_CURRENT_VERSION
/* This is an autogenerated file. Don't edit! */
#define MC_CURRENT_VERSION "${CURR_MC_VERSION}"
#endif
EOF
fi
exit
}
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
[ -z "${git_head}" ] && mc_print_version
# try to store sha1
CURR_MC_VERSION="${git_head}"
new_version=`git --git-dir "${src_top_dir}/.git" describe 2>/dev/null`
[ -z "${new_version}" ] && mc_print_version
# store pretty tagged version
CURR_MC_VERSION="${new_version}"
mc_print_version