[netcf-devel] [PATCH 1/3] find ifup/ifdown in configure.ac and use in drv-debian

Daniel P. Berrange berrange at redhat.com
Mon Apr 30 08:25:36 UTC 2012


On Sat, Apr 28, 2012 at 01:24:09AM +0000, serge at hallyn.com wrote:
> From: Serge Hallyn <serge.hallyn at canonical.com>
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at canonical.com>
> ---
>  configure.ac     |   15 +++++++++++++++
>  src/drv_debian.c |    4 ++--
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index c1060f3..6705a0d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -106,6 +106,21 @@ then
>      PKG_CHECK_MODULES([LIBNL], [libnl-1])
>  fi
>  
> +if test "x$with_driver" = "xdebian"; then
> +	dnl Check for ifup and ifdown in debian
> +	AC_PATH_PROG(IFDOWN, ifdown, false, $PATH$PATHSEPARATOR/sbin)
> +	if test "$IFDOWN" = "false"; then
> +	   AC_MSG_ERROR([ifdown not found])
> +	fi
> +	AC_DEFINE_UNQUOTED([IFDOWN], "$IFDOWN", [path to ifdown binary])
> +
> +	AC_PATH_PROG(IFUP, ifup, false, $PATH$PATHSEPARATOR/sbin)
> +	if test "$IFUP" = "false"; then
> +	   AC_MSG_ERROR([ifup not found])
> +	fi
> +	AC_DEFINE_UNQUOTED([IFUP], "$IFUP", [path to ifup binary])
> +fi
> +
>  NETCF_LIBDEPS=$(echo $LIBAUGEAS_LIBS $LIBEXSLT_LIBS $LIBXSLT_LIBS $LIBXML_LIBS $LIBNL_LIBS)
>  AC_SUBST([NETCF_LIBDEPS])
>  
> diff --git a/src/drv_debian.c b/src/drv_debian.c
> index d28eda0..23c5551 100644
> --- a/src/drv_debian.c
> +++ b/src/drv_debian.c
> @@ -1042,7 +1042,7 @@ const char *drv_mac_string(struct netcf_if *nif) {
>   */
>  
>  int drv_if_up(struct netcf_if *nif) {
> -    static const char *const ifup = "ifup";
> +    static const char *const ifup = IFUP;
>      struct netcf *ncf = nif->ncf;
>      int result = -1;
>  
> @@ -1054,7 +1054,7 @@ int drv_if_up(struct netcf_if *nif) {
>  }
>  
>  int drv_if_down(struct netcf_if *nif) {
> -    static const char *const ifdown = "ifdown";
> +    static const char *const ifdown = IFDOWN;
>      struct netcf *ncf = nif->ncf;
>      int result = -1;

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the netcf-devel mailing list