From: Dave Hart Date: Wed, 27 Jul 2011 06:27:52 +0000 (+0000) Subject: [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'. X-Git-Tag: NTP_4_2_7P197~1^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e84ba925e1d1b32c027d1d1dfa629934688bbc53;p=thirdparty%2Fntp.git [Bug 1976] genLocInfo writes to srcdir break 'make distcheck'. bk: 4e2fafe8iUHVhyKtJIU2yvpUWnq-3g --- diff --git a/ChangeLog b/ChangeLog index 36bdf7a6d..e5fb53827 100644 --- 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 * 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. diff --git a/sntp/m4/ntp_locinfo.m4 b/sntp/m4/ntp_locinfo.m4 index 9a9674bc9..c9fd2284a 100644 --- a/sntp/m4/ntp_locinfo.m4 +++ b/sntp/m4/ntp_locinfo.m4 @@ -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 diff --git a/sntp/scripts/Makefile.am b/sntp/scripts/Makefile.am index aa1dfbc4c..52406105d 100644 --- a/sntp/scripts/Makefile.am +++ b/sntp/scripts/Makefile.am @@ -1,10 +1,7 @@ NULL= -DISTCLEANFILES= config.log - EXTRA_DIST = \ cvo.sh \ genLocInfo \ mansec2subst.sed \ $(NULL) - diff --git a/sntp/scripts/genLocInfo b/sntp/scripts/genLocInfo index 3b3638ed2..0fccf32bc 100755 --- a/sntp/scripts/genLocInfo +++ b/sntp/scripts/genLocInfo @@ -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