From 8ee97b8859d9da805500c54761d4681c8ef26bb1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 25 Jan 2017 17:59:45 +0000 Subject: [PATCH] p2v: Move miniexpect library to common/miniexpect. No change, just code motion. --- Makefile.am | 2 +- common/miniexpect/Makefile.am | 32 +++++++++++++++++++++++++ {p2v => common/miniexpect}/miniexpect.c | 0 {p2v => common/miniexpect}/miniexpect.h | 0 configure.ac | 1 + docs/C_SOURCE_FILES | 4 ++-- docs/guestfs-hacking.pod | 6 +++++ p2v/Makefile.am | 6 ++--- po/POTFILES | 2 +- 9 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 common/miniexpect/Makefile.am rename {p2v => common/miniexpect}/miniexpect.c (100%) rename {p2v => common/miniexpect}/miniexpect.h (100%) diff --git a/Makefile.am b/Makefile.am index cd601200f..2f698bc54 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,7 +105,7 @@ SUBDIRS += fish # virt-tools in C. SUBDIRS += align cat diff df edit format inspector make-fs rescue if HAVE_P2V -SUBDIRS += p2v +SUBDIRS += common/miniexpect p2v endif # bash-completion diff --git a/common/miniexpect/Makefile.am b/common/miniexpect/Makefile.am new file mode 100644 index 000000000..def891b3c --- /dev/null +++ b/common/miniexpect/Makefile.am @@ -0,0 +1,32 @@ +# libguestfs virt-p2v +# Copyright (C) 2009-2017 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +include $(top_srcdir)/subdir-rules.mk + +# This directory contains a copy of the miniexpect library from +# http://git.annexia.org/?p=miniexpect.git;a=summary +# This is used in virt-p2v. +noinst_LTLIBRARIES = libminiexpect.la + +libminiexpect_la_SOURCES = \ + miniexpect.c \ + miniexpect.h +libminiexpect_la_CFLAGS = \ + $(WARN_CFLAGS) $(WERROR_CFLAGS) \ + $(PCRE_CFLAGS) +libminiexpect_la_LIBADD = \ + $(PCRE_LIBS) diff --git a/p2v/miniexpect.c b/common/miniexpect/miniexpect.c similarity index 100% rename from p2v/miniexpect.c rename to common/miniexpect/miniexpect.c diff --git a/p2v/miniexpect.h b/common/miniexpect/miniexpect.h similarity index 100% rename from p2v/miniexpect.h rename to common/miniexpect/miniexpect.h diff --git a/configure.ac b/configure.ac index e2e9c66f8..e94a47ebf 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,7 @@ AC_CONFIG_FILES([Makefile cat/Makefile common/errnostring/Makefile common/edit/Makefile + common/miniexpect/Makefile common/options/Makefile common/parallel/Makefile common/progress/Makefile diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES index a00fc22af..286723b73 100644 --- a/docs/C_SOURCE_FILES +++ b/docs/C_SOURCE_FILES @@ -13,6 +13,8 @@ cat/ls.c cat/tail.c common/edit/file-edit.c common/edit/file-edit.h +common/miniexpect/miniexpect.c +common/miniexpect/miniexpect.h common/options/config.c common/options/decrypt.c common/options/display-options.c @@ -348,8 +350,6 @@ p2v/inhibit.c p2v/kernel-cmdline.c p2v/kernel.c p2v/main.c -p2v/miniexpect.c -p2v/miniexpect.h p2v/p2v.h p2v/ssh.c p2v/utils.c diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod index b44e5f77c..8c643ca05 100644 --- a/docs/guestfs-hacking.pod +++ b/docs/guestfs-hacking.pod @@ -94,6 +94,12 @@ The communication protocol used between the library and the daemon running inside the appliance has to encode errnos as strings, which is handled by this library. +=item F + +A copy of the miniexpect library from +L. This is used +in virt-p2v. + =item F Common options parsing for guestfish, guestmount and some virt tools. diff --git a/p2v/Makefile.am b/p2v/Makefile.am index 86d905e8f..320d65a6a 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -69,8 +69,6 @@ virt-p2v.xz: virt-p2v noinst_PROGRAMS = virt-p2v -# Note that miniexpect comes from here: -# http://git.annexia.org/?p=miniexpect.git;a=summary virt_p2v_SOURCES = \ about-authors.c \ about-license.c \ @@ -83,8 +81,6 @@ virt_p2v_SOURCES = \ kernel.c \ kernel-cmdline.c \ main.c \ - miniexpect.c \ - miniexpect.h \ p2v.h \ ssh.c \ utils.c \ @@ -94,6 +90,7 @@ virt_p2v_CPPFLAGS = \ -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ -I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \ -I$(top_srcdir)/lib -I$(top_builddir)/lib \ + -I$(top_srcdir)/common/miniexpect -I$(top_builddir)/common/miniexpect \ -I$(srcdir)/../gnulib/lib -I../gnulib/lib virt_p2v_CFLAGS = \ @@ -106,6 +103,7 @@ virt_p2v_CFLAGS = \ virt_p2v_LDADD = \ $(top_builddir)/common/utils/libutils.la \ + $(top_builddir)/common/miniexpect/libminiexpect.la \ $(PCRE_LIBS) \ $(LIBXML2_LIBS) \ $(GTK_LIBS) \ diff --git a/po/POTFILES b/po/POTFILES index b12fb1800..5a1b22302 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -13,6 +13,7 @@ cat/tail.c common/edit/file-edit.c common/errnostring/errnostring-gperf.c common/errnostring/errnostring.c +common/miniexpect/miniexpect.c common/options/config.c common/options/decrypt.c common/options/display-options.c @@ -409,7 +410,6 @@ p2v/inhibit.c p2v/kernel-cmdline.c p2v/kernel.c p2v/main.c -p2v/miniexpect.c p2v/ssh.c p2v/utils.c p2v/whole-file.c