From 1c6d8596295d99037724b32b1757668c63cb01da Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 9 Apr 2013 14:51:24 +0300 Subject: [PATCH] Reorder files in maint/ subdirectory. Signed-off-by: Slava Zanko --- Makefile.am | 6 +- autogen.sh | 4 +- m4.include/mc-version.m4 | 2 +- maint/{ => docs}/README | 0 maint/{ => docs}/RELEASE_PROCEDURE | 0 maint/{ => docs}/systems.txt | 0 maint/{ => utils}/autopoint | 0 maint/{ => utils}/doctest | 2 +- .../find-dup-includes/find-in-one-file.pl | 0 maint/{ => utils}/find-dup-includes/runme.sh | 6 +- maint/{ => utils}/sync-transifex/.gitignore | 0 maint/{ => utils}/sync-transifex/README.txt | 0 .../sync-transifex/config.d/mc.hint/po4a.cfg | 0 .../sync-transifex/config.d/mc.hint/tx.config | 0 .../sync-transifex/config.d/po/po-ignore.list | 0 .../sync-transifex/config.d/po/tx.config | 0 maint/{ => utils}/sync-transifex/functions | 2 +- .../sync-transifex/mc.hint-fromTransifex.sh | 4 +- .../sync-transifex/mc.hint-toTransifex.sh | 4 +- .../sync-transifex/po-fromTransifex.sh | 4 +- .../sync-transifex/po-toTransifex.sh | 4 +- maint/{ => utils}/unrefglobals.pl | 0 maint/utils/version.sh | 79 +++++++++++++++++++ maint/version.sh | 47 ----------- 24 files changed, 98 insertions(+), 66 deletions(-) rename maint/{ => docs}/README (100%) rename maint/{ => docs}/RELEASE_PROCEDURE (100%) rename maint/{ => docs}/systems.txt (100%) rename maint/{ => utils}/autopoint (100%) rename maint/{ => utils}/doctest (97%) rename maint/{ => utils}/find-dup-includes/find-in-one-file.pl (100%) rename maint/{ => utils}/find-dup-includes/runme.sh (86%) rename maint/{ => utils}/sync-transifex/.gitignore (100%) rename maint/{ => utils}/sync-transifex/README.txt (100%) rename maint/{ => utils}/sync-transifex/config.d/mc.hint/po4a.cfg (100%) rename maint/{ => utils}/sync-transifex/config.d/mc.hint/tx.config (100%) rename maint/{ => utils}/sync-transifex/config.d/po/po-ignore.list (100%) rename maint/{ => utils}/sync-transifex/config.d/po/tx.config (100%) rename maint/{ => utils}/sync-transifex/functions (97%) rename maint/{ => utils}/sync-transifex/mc.hint-fromTransifex.sh (89%) rename maint/{ => utils}/sync-transifex/mc.hint-toTransifex.sh (89%) rename maint/{ => utils}/sync-transifex/po-fromTransifex.sh (92%) rename maint/{ => utils}/sync-transifex/po-toTransifex.sh (90%) rename maint/{ => utils}/unrefglobals.pl (100%) create mode 100755 maint/utils/version.sh delete mode 100755 maint/version.sh diff --git a/Makefile.am b/Makefile.am index 1433b9132..d971d339d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,11 +20,11 @@ CONFIG_STATUS_DEPENDENCIES = $(top_srcdir)/version.h .PHONY: update-version update-version: - @if test -x $(top_srcdir)/maint/version.sh; then \ - $(top_srcdir)/maint/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \ + @if test -x $(top_srcdir)/maint/utils/version.sh; then \ + $(top_srcdir)/maint/utils/version.sh "$(top_srcdir)" 2>&1 >/dev/null; \ else \ 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; \ fi; \ fi diff --git a/autogen.sh b/autogen.sh index 7c3ed501b..071533ce6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -23,7 +23,7 @@ set -e $AUTOPOINT --version >/dev/null 2>&1 if test $? -ne 0; then - AUTOPOINT=maint/autopoint + AUTOPOINT=maint/utils/autopoint fi cd "$srcdir" @@ -84,7 +84,7 @@ test -f configure || \ { echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; } ) || exit 1 -$srcdir/maint/version.sh "$srcdir" +$srcdir/maint/utils/version.sh "$srcdir" if test -x $srcdir/configure.mc; then $srcdir/configure.mc "$@" diff --git a/m4.include/mc-version.m4 b/m4.include/mc-version.m4 index b687c06fa..a01ed297c 100644 --- a/m4.include/mc-version.m4 +++ b/m4.include/mc-version.m4 @@ -9,7 +9,7 @@ dnl @copyright Free Software Foundation, Inc. AC_DEFUN([MC_VERSION],[ if test ! -f ${srcdir}/version.h; then - ${srcdir}/maint/version.sh ${srcdir} + ${srcdir}/maint/utils/version.sh ${srcdir} fi if test -f ${srcdir}/version.h; then VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/version.h | sed 's/.*"\(.*\)"$/\1/') diff --git a/maint/README b/maint/docs/README similarity index 100% rename from maint/README rename to maint/docs/README diff --git a/maint/RELEASE_PROCEDURE b/maint/docs/RELEASE_PROCEDURE similarity index 100% rename from maint/RELEASE_PROCEDURE rename to maint/docs/RELEASE_PROCEDURE diff --git a/maint/systems.txt b/maint/docs/systems.txt similarity index 100% rename from maint/systems.txt rename to maint/docs/systems.txt diff --git a/maint/autopoint b/maint/utils/autopoint similarity index 100% rename from maint/autopoint rename to maint/utils/autopoint diff --git a/maint/doctest b/maint/utils/doctest similarity index 97% rename from maint/doctest rename to maint/utils/doctest index cb8384774..5ed5311e0 100755 --- a/maint/doctest +++ b/maint/utils/doctest @@ -27,7 +27,7 @@ #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) ******************* diff --git a/maint/find-dup-includes/find-in-one-file.pl b/maint/utils/find-dup-includes/find-in-one-file.pl similarity index 100% rename from maint/find-dup-includes/find-in-one-file.pl rename to maint/utils/find-dup-includes/find-in-one-file.pl diff --git a/maint/find-dup-includes/runme.sh b/maint/utils/find-dup-includes/runme.sh similarity index 86% rename from maint/find-dup-includes/runme.sh rename to maint/utils/find-dup-includes/runme.sh index cd7206d65..9e7c5802d 100755 --- a/maint/find-dup-includes/runme.sh +++ b/maint/utils/find-dup-includes/runme.sh @@ -27,7 +27,7 @@ set -e # You should have received a copy of the GNU General Public License # along with this program. If not, see . -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) ******************* @@ -38,8 +38,8 @@ findIncludeDupsInDir() { for i in $(find "${dir_name}" -name '*.[ch]'); do 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 - "${MC_SOURCE_ROOT_DIR}/maint/find-dup-includes/find-in-one-file.pl" "${i}" + [ $(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/utils/find-dup-includes/find-in-one-file.pl" "${i}" done } diff --git a/maint/sync-transifex/.gitignore b/maint/utils/sync-transifex/.gitignore similarity index 100% rename from maint/sync-transifex/.gitignore rename to maint/utils/sync-transifex/.gitignore diff --git a/maint/sync-transifex/README.txt b/maint/utils/sync-transifex/README.txt similarity index 100% rename from maint/sync-transifex/README.txt rename to maint/utils/sync-transifex/README.txt diff --git a/maint/sync-transifex/config.d/mc.hint/po4a.cfg b/maint/utils/sync-transifex/config.d/mc.hint/po4a.cfg similarity index 100% rename from maint/sync-transifex/config.d/mc.hint/po4a.cfg rename to maint/utils/sync-transifex/config.d/mc.hint/po4a.cfg diff --git a/maint/sync-transifex/config.d/mc.hint/tx.config b/maint/utils/sync-transifex/config.d/mc.hint/tx.config similarity index 100% rename from maint/sync-transifex/config.d/mc.hint/tx.config rename to maint/utils/sync-transifex/config.d/mc.hint/tx.config diff --git a/maint/sync-transifex/config.d/po/po-ignore.list b/maint/utils/sync-transifex/config.d/po/po-ignore.list similarity index 100% rename from maint/sync-transifex/config.d/po/po-ignore.list rename to maint/utils/sync-transifex/config.d/po/po-ignore.list diff --git a/maint/sync-transifex/config.d/po/tx.config b/maint/utils/sync-transifex/config.d/po/tx.config similarity index 100% rename from maint/sync-transifex/config.d/po/tx.config rename to maint/utils/sync-transifex/config.d/po/tx.config diff --git a/maint/sync-transifex/functions b/maint/utils/sync-transifex/functions similarity index 97% rename from maint/sync-transifex/functions rename to maint/utils/sync-transifex/functions index 7cdf5a09b..e6e63cb28 100644 --- a/maint/sync-transifex/functions +++ b/maint/utils/sync-transifex/functions @@ -50,7 +50,7 @@ getConfigFile() { sync_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}" } # ---------------------------------------------------------------------- diff --git a/maint/sync-transifex/mc.hint-fromTransifex.sh b/maint/utils/sync-transifex/mc.hint-fromTransifex.sh similarity index 89% rename from maint/sync-transifex/mc.hint-fromTransifex.sh rename to maint/utils/sync-transifex/mc.hint-fromTransifex.sh index 17946f4e0..c7a9d1ee8 100755 --- a/maint/sync-transifex/mc.hint-fromTransifex.sh +++ b/maint/utils/sync-transifex/mc.hint-fromTransifex.sh @@ -25,11 +25,11 @@ 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) ******************* -source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" +source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions" #*** file scope functions ********************************************** diff --git a/maint/sync-transifex/mc.hint-toTransifex.sh b/maint/utils/sync-transifex/mc.hint-toTransifex.sh similarity index 89% rename from maint/sync-transifex/mc.hint-toTransifex.sh rename to maint/utils/sync-transifex/mc.hint-toTransifex.sh index 25e0b8190..2fa9c0c30 100755 --- a/maint/sync-transifex/mc.hint-toTransifex.sh +++ b/maint/utils/sync-transifex/mc.hint-toTransifex.sh @@ -25,11 +25,11 @@ 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) ******************* -source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" +source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions" #*** file scope functions ********************************************** diff --git a/maint/sync-transifex/po-fromTransifex.sh b/maint/utils/sync-transifex/po-fromTransifex.sh similarity index 92% rename from maint/sync-transifex/po-fromTransifex.sh rename to maint/utils/sync-transifex/po-fromTransifex.sh index b55a95118..230e7e3e8 100755 --- a/maint/sync-transifex/po-fromTransifex.sh +++ b/maint/utils/sync-transifex/po-fromTransifex.sh @@ -25,11 +25,11 @@ 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) ******************* -source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" +source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions" #*** file scope functions ********************************************** diff --git a/maint/sync-transifex/po-toTransifex.sh b/maint/utils/sync-transifex/po-toTransifex.sh similarity index 90% rename from maint/sync-transifex/po-toTransifex.sh rename to maint/utils/sync-transifex/po-toTransifex.sh index 5ca1eb7d1..82f030032 100755 --- a/maint/sync-transifex/po-toTransifex.sh +++ b/maint/utils/sync-transifex/po-toTransifex.sh @@ -25,11 +25,11 @@ 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) ******************* -source "${MC_SOURCE_ROOT_DIR}/maint/sync-transifex/functions" +source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions" #*** file scope functions ********************************************** diff --git a/maint/unrefglobals.pl b/maint/utils/unrefglobals.pl similarity index 100% rename from maint/unrefglobals.pl rename to maint/utils/unrefglobals.pl diff --git a/maint/utils/version.sh b/maint/utils/version.sh new file mode 100755 index 000000000..e807eb124 --- /dev/null +++ b/maint/utils/version.sh @@ -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 , 2009, 2010, 2013 +# Stan. S. Krupoderov , 2009 +# Sergei Trofimovich , 2009 +# Oswald Buddenhagen , 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 . + +#*** 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}" <" + 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 diff --git a/maint/version.sh b/maint/version.sh deleted file mode 100755 index 3b046dab7..000000000 --- a/maint/version.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -if [ -z "$1" ] - then - echo "usage: $0 " - 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}" </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