]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
authorDave Hart <hart@ntp.org>
Wed, 27 Jul 2011 06:27:52 +0000 (06:27 +0000)
committerDave Hart <hart@ntp.org>
Wed, 27 Jul 2011 06:27:52 +0000 (06:27 +0000)
bk: 4e2fafe8iUHVhyKtJIU2yvpUWnq-3g

ChangeLog
sntp/m4/ntp_locinfo.m4
sntp/scripts/Makefile.am
sntp/scripts/genLocInfo

index 36bdf7a6d350bc9fdab706b6c6de52dd40e62f97..e5fb538273af3c0636470d613744a055c4ec875d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'.
 (4.2.7p196) 2011/07/27 Released by Harlan Stenn <stenn@ntp.org>
 * DEFAULT INSTALLATION DIRECTORY CHANGES ON SOME OSes: to get the old
   behavior, pass --with-locfile=legacy to 'configure'
@@ -8,7 +9,7 @@
 * Move scripts/cvo.sh to sntp/scripts/cvo.sh .
 * Move scripts/genLocInfo to sntp/scripts/genLocInfo .
 * Give NTP_LOCINFO an optional path-to argument.
-* Remove hacks to get NTP_LOCINFO-related data to snmp/ .
+* Remove hacks to get NTP_LOCINFO-related data to sntp/ .
 * Move sntp/include/mansec2subst.sed to sntp/scripts/mansec2subst.sed .
 * If no "more specific" loc file is found for redhat* or fedora*,
   look for a loc/redhat file.
index 9a9674bc9d587f78e46accb00033409c1943a988..c9fd2284a57e3630694c2bcec980c203ac945179 100644 (file)
@@ -7,7 +7,7 @@ dnl - man section (1, 1m, 1M, 8)
 
 AC_DEFUN([NTP_LOCINFO], [
 
-# NTP_LOCINFO: calling AC_ARG_WITH
+AC_MSG_CHECKING([for install dir and man conventions])
 
 AC_ARG_WITH(
     [locfile],
@@ -19,17 +19,19 @@ AC_ARG_WITH(
     [with_locfile=legacy]
 )
 
-AC_MSG_CHECKING([for installation directory, man sections, and man format])
-
-( cd $ac_abs_confdir/$1 && scripts/genLocInfo -f "$with_locfile" ) > genLocInfo.i 2>genLocInfo.err
+( SENTINEL_DIR="$PWD" &&       \
+  cd $srcdir/$1 &&             \
+  scripts/genLocInfo -f "$with_locfile" -d "$SENTINEL_DIR" ) > genLocInfo.i 2> genLocInfo.err
 . ./genLocInfo.i
 
 case "$GENLOCINFO" in
  OK)
-    AC_MSG_RESULT([found in $GENLOCINFOFILE])
+    AC_MSG_RESULT([in file $GENLOCINFOFILE])
     rm genLocInfo.err genLocInfo.i
     ;;
- *) AC_MSG_ERROR([Problem with genLocInfo!])
+ *)
+    AC_MSG_RESULT([failed.])
+    AC_MSG_ERROR([Problem with genLocInfo!])
     ;;
 esac
 
index aa1dfbc4c4e86182e6e077f741bae8491c57c6f5..52406105d3a4edc2f9043bde4a022696ef6423d4 100644 (file)
@@ -1,10 +1,7 @@
 NULL=
 
-DISTCLEANFILES=        config.log
-
 EXTRA_DIST =                   \
        cvo.sh                  \
        genLocInfo              \
        mansec2subst.sed        \
        $(NULL)
-
index 3b3638ed27ebb351b67c50cddf6b40b52aba4f9d..0fccf32bcf71bf9f5ad44f7968d41b8e1806f8e3 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-args=`getopt f:v $*`
+args=`getopt d:f:v $*`
 set -- $args
 
 LF=
@@ -9,12 +9,18 @@ V=": "
 for i
 do
     case "$i" in
-     -f) locfile="$2" ; shift ;;
+     -d) sdir="$2" ; shift 2 ;;
+     -f) locfile="$2" ; shift 2 ;;
      -v) V= ; shift ;;
      --) shift ; break ;;
     esac
 done
 
+case "$sdir" in
+ '')
+    sdir=.
+esac
+
 case "$locfile" in
  */*)
     LF=$locfile
@@ -128,7 +134,7 @@ echo "GENLOCINFOFILE=$LF"
 
 ###
 
-rm genLocInfo.rc?
+rm -f $sdir/genLocInfo.rc?
 
 oIFS=$IFS
 IFS=","
@@ -144,7 +150,7 @@ do
        case "$x" in
         '') ;;
         *) echo "Unrecognized input: <$c,$d,$s,$x>" >&2
-           touch genLocInfo.rc1
+           touch $sdir/genLocInfo.rc1
            continue
            ;;
        esac
@@ -164,7 +170,7 @@ do
         *,libexec,*)  DB= ; DL=libexec ; DS= ;;
         *,sbin,*) DB= ; DL= ; DS=sbin ;;
         *) echo "Unrecognized input: <$c,$d,$s>" >&2
-           touch genLocInfo.rc1
+           touch $sdir/genLocInfo.rc1
            continue
            ;;
        esac
@@ -174,7 +180,7 @@ do
         *,*,1M) ;;
         *,*,8) ;;
         *) echo "Unrecognized input: <$c,$d,$s>" >&2
-           touch genLocInfo.rc1
+           touch $sdir/genLocInfo.rc1
            continue
            ;;
        esac
@@ -215,22 +221,22 @@ do
        echo "${C}_DS=`eval echo '$'${C}_DS`"
        echo "${C}_MS=`eval echo '$'${C}_MS`"
 
-       touch genLocInfo.rc0
+       touch $sdir/genLocInfo.rc0
     else
        break
     fi
 done < $LF
 IFS=$oIFS
 
-if test -f genLocInfo.rc1
+if test -f $sdir/genLocInfo.rc1
 then
-    rm genLocInfo.rc?
+    rm $sdir/genLocInfo.rc?
     exit 1
 fi
 
-if test -f genLocInfo.rc0
+if test -f $sdir/genLocInfo.rc0
 then
-    rm genLocInfo.rc?
+    rm $sdir/genLocInfo.rc?
     echo 'GENLOCINFO=OK'
     exit 0
 fi