[netcf-devel] [PATCH 2/2] maint: use gnulib's configmake instead of hard-coded names

Laine Stump laine at laine.org
Thu Jan 30 14:08:22 UTC 2014


On 01/24/2014 01:08 AM, Eric Blake wrote:
> Resolve a FIXME from an earlier commit; rather than hard-coding
> use of /usr/libexec, we should be installing/using files relative
> to the ${libexecdir} location chosen during configure.
>
> * bootstrap.conf (gnulib_modules): Add configmake.
> * configure.ac (NETCF_TRANSACTION): Redefine appropriately.
> * src/drv_redhat.c (includes): Pull in new header.
> * gnulib/lib/Makefile.am (CLEANFILES): Adjust to new module.
> * src/drv_debian.c (NETCF_TRANSACTION): Avoid redefining an
> existing macro.
> * src/drv_suse.c (NETCF_TRANSACTION): Likewise.
>
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  bootstrap.conf         | 3 ++-
>  configure.ac           | 4 +---
>  gnulib/lib/Makefile.am | 3 ++-
>  src/drv_debian.c       | 4 +++-
>  src/drv_redhat.c       | 1 +
>  src/drv_suse.c         | 1 +
>  6 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/bootstrap.conf b/bootstrap.conf
> index 4736009..4503015 100644
> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -1,6 +1,6 @@
>  # Bootstrap configuration.
>
> -# Copyright (C) 2010-2013 Red Hat, Inc.
> +# Copyright (C) 2010-2014 Red Hat, Inc.
>
>  # This library is free software; you can redistribute it and/or
>  # modify it under the terms of the GNU Lesser General Public
> @@ -22,6 +22,7 @@ gnulib_modules='
>  arpa_inet
>  c-ctype
>  close
> +configmake
>  getopt-posix
>  inet_ntop
>  inet_pton
> diff --git a/configure.ac b/configure.ac
> index b8d3764..6c722f7 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -93,10 +93,8 @@ AM_CONDITIONAL([NETCF_DRIVER_SUSE], test "x$with_driver" = "xsuse")
>  AM_CONDITIONAL([NETCF_DRIVER_MSWINDOWS], test "x$with_driver" = "xmswindows")
>
>  if test "x$with_driver" = "xredhat"; then
> -    # FIXME: This should be defined relative to $libexecdir,
> -    # but that requires gnulib configmake to do correctly.
>      AC_DEFINE_UNQUOTED([NETCF_TRANSACTION],
> -                       ["/usr/libexec/netcf-transaction.sh"],
> +                       [LIBEXECDIR "/netcf-transaction.sh"],
>                         [Location of the netcf-transaction shell script])
>  fi
>
> diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
> index f05f145..4009220 100644
> --- a/gnulib/lib/Makefile.am
> +++ b/gnulib/lib/Makefile.am
> @@ -1,6 +1,6 @@
>  ## Makefile for gnulib/lib				-*-Makefile-*-
>
> -## Copyright (C) 2011-	2012 Red Hat, Inc.
> +## Copyright (C) 2011-2012, 2014 Red Hat, Inc.
>  ## See COPYING.LIB for the License of this software
>
>  # Keep automake happy by priming variables that gnulib only appends to
> @@ -9,6 +9,7 @@ EXTRA_DIST=
>  MOSTLYCLEANDIRS=
>  MOSTLYCLEANFILES=
>  noinst_LTLIBRARIES=
> +CLEANFILES=
>
>  include gnulib.mk
>
> diff --git a/src/drv_debian.c b/src/drv_debian.c
> index 370eccd..0bb2d85 100644
> --- a/src/drv_debian.c
> +++ b/src/drv_debian.c
> @@ -1,7 +1,7 @@
>  /*
>   * drv_debian.c: the debian backend for netcf
>   *
> - * Copyright (C) 2009-2013 Red Hat Inc.
> + * Copyright (C) 2009-2014 Red Hat Inc.
>   *
>   * This library is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU Lesser General Public
> @@ -49,7 +49,9 @@
>
>  #include <libexslt/exslt.h>
>
> +#undef NETCF_TRANSACTION
>  #define NETCF_TRANSACTION "/bin/false"
> +#endif

Oops. Got an extra #endif in there :-)

ACK with that fixed.

Thanks!

>
>  static const char *const network_interfaces_path =
>      "/files/etc/network/interfaces";
> diff --git a/src/drv_redhat.c b/src/drv_redhat.c
> index e9d25cb..3697473 100644
> --- a/src/drv_redhat.c
> +++ b/src/drv_redhat.c
> @@ -32,6 +32,7 @@
>  #include <unistd.h>
>  #include <sys/stat.h>
>
> +#include "configmake.h"
>  #include "safe-alloc.h"
>  #include "ref.h"
>  #include "list.h"
> diff --git a/src/drv_suse.c b/src/drv_suse.c
> index e346c27..666d802 100644
> --- a/src/drv_suse.c
> +++ b/src/drv_suse.c
> @@ -57,6 +57,7 @@
>
>  #define NETRULE_PATH "/etc/udev/rules.d/70-persistent-net.rules"
>
> +#undef NETCF_TRANSACTION
>  #define NETCF_TRANSACTION "/bin/false"
>
>  static const char *const aug_files =



More information about the netcf-devel mailing list