[nautilus-actions] Fixing check-headers.sh



commit 1734118a1e2e29d978b1411782e135064b696306
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri May 2 00:06:49 2014 +0200

    Fixing check-headers.sh

 maintainer/check-headers.sh |   43 +++++++++++++++++++++++++------------------
 maintainer/run-distcheck.sh |    2 +-
 2 files changed, 26 insertions(+), 19 deletions(-)
---
diff --git a/maintainer/check-headers.sh b/maintainer/check-headers.sh
index 2d49ccc..0ed521b 100755
--- a/maintainer/check-headers.sh
+++ b/maintainer/check-headers.sh
@@ -100,7 +100,8 @@ function msg_help
    --[no]help                print this message, and exit [${opt_help_def}]
    --[no]version             print script version, and exit [${opt_version_def}]
    --[no]dummy               dummy execution [${opt_dummy_def}]
-   --[no]verbose             runs verbosely [${opt_verbose_def}]"
+   --[no]verbose             runs verbosely [${opt_verbose_def}]
+   --builddir=<builddir>     build directory [${opt_builddir_def}]"
 }
 
 function msg_version
@@ -124,6 +125,18 @@ opt_version_def="no"
 opt_verbose=
 opt_verbose_def="no"
 
+# check that we are running from the top of srcdir
+maintainer_dir=$(cd ${0%/*}; pwd)
+top_srcdir="${maintainer_dir%/*}"
+if [ ! -f "${top_srcdir}/configure.ac" ]; then
+       msgerr "this script is only meant to be run by the maintainer,"
+       msgerr "and current working directory should be the top source directory."
+       let errs+=1
+       exit
+fi
+opt_builddir=
+opt_builddir_def="${top_srcdir}/_build"
+
 # a first loop over command line arguments to detect verbose mode
 while :
 do
@@ -200,14 +213,18 @@ do
                # these options take a mandatory argument
                # since, we didn't find it in 'option', so it should be
                # next word in the command line
-               #--b | --bu | --bui | --buil | --build | --buildd | --builddi | --builddir)
-               #       optarg=$1
-               #       shift
-               #       ;;
+               --b | --bu | --bui | --buil | --build | --buildd | --builddi | --builddir)
+                       optarg="$1"
+                       shift
+                       ;;
        esac
 
        # now process options and their argument
        case ${option} in
+               --b | --bu | --bui | --buil | --build | --buildd | --builddi | --builddir)
+                       [ "${opt_verbose}" = "yes" ] && msg "setting opt_builddir to '${optarg}'"
+                       opt_builddir="${optarg}"
+                       ;;
                --d | --du | --dum | --dumm | --dummy)
                        [ "${opt_verbose}" = "yes" ] && msg "setting opt_dummy to 'yes'"
                        opt_dummy="yes"
@@ -269,17 +286,7 @@ opt_help=${opt_help:-${opt_help_def}}
 opt_dummy=${opt_dummy:-${opt_dummy_def}}
 opt_verbose=${opt_verbose:-${opt_verbose_def}}
 opt_version=${opt_version:-${opt_version_def}}
-
-# check that we are running from the top of srcdir
-maintainer_dir=$(cd ${0%/*}; pwd)
-top_srcdir="${maintainer_dir%/*}"
-if [ ! -f "${top_srcdir}/configure.ac" ]; then
-       msgerr "this script is only meant to be run by the maintainer,"
-       msgerr "and current working directory should be the top source directory."
-       let errs+=1
-       exit
-fi
-builddir="${top_srcdir}/_build"
+opt_builddir=${opt_builddir:-${opt_builddir_def}}
 
 if [ "${opt_help}" = "yes" -o ${nbopt} -eq 0 ]; then
        msg_help
@@ -315,8 +322,8 @@ for f in $(git ls-files src | grep '\.h$' | grep -v '^src/test'); do
 #include <${f}>
 int main( int argc, char **argv ){ return( 0 ); }
 !
-       make -C ${builddir}/maintainer check-header 1>/dev/null 2>&1 &&
-               ${builddir}/maintainer/check-header 1>/dev/null 2>&1
+       make -C "${opt_builddir}/${maintainer_dir##*/}" check-header 1>/dev/null 2>&1 &&
+               "${opt_builddir}/${maintainer_dir##*/}/check-header" 1>/dev/null 2>&1
        [ $? -eq 0 ] && echo "OK" || { echo "NOT OK"; let errs+=1; }
 done
 
diff --git a/maintainer/run-distcheck.sh b/maintainer/run-distcheck.sh
index f61585f..c19d838 100755
--- a/maintainer/run-distcheck.sh
+++ b/maintainer/run-distcheck.sh
@@ -52,6 +52,6 @@ find ${top_srcdir}/docs/nact \( -type d -o -type l \) -name 'stylesheet-images'
 
 ${maintainer_dir}/run-autogen.sh --enable-deprecated --enable-gtk-doc --enable-html-manuals &&
        ${maintainer_dir}/check-po.sh -nodummy &&
-       ${maintainer_dir}/check-headers.sh -nodummy -builddir=${builddir} &&
+       ${maintainer_dir}/check-headers.sh -nodummy -builddir="${builddir}" &&
        desktop-file-validate ${installdir}/share/applications/nact.desktop &&
        make -C ${builddir} distcheck


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]