[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] [PATCH RFC] tools: rework uninstall target



The original uninstall target in tools is a bit out-dated. The patch removes
code to delete things don't exist any more and add lines to delete things
should be deleted. Also rearrange lines to group similar things together.

To the best of my knowledge, libvhd and libfsimage are only distributed by Xen
so it is safe to delete them.

For things installed by 'python setup.py', we record a list of files installed
and use it when doing uninstall. This still leaves the directories there but
they won't affect the system.

The changes are verified by doing 'cd tools; ./configure --prefix=/tmp/tmpdir;
make install; make uninstall; find /tmp/tmpdir -type f'. All files are
removed. The only question is that do we remove too many things than
necessary.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/Makefile        |   39 ++++++++++++++++++++++++++-------------
 tools/pygrub/Makefile |    3 ++-
 tools/python/Makefile |    3 ++-
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8a30c83..8aeb811 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -74,34 +74,47 @@ install: subdirs-install
 .PHONY: uninstall
 uninstall: D=$(DESTDIR)
 uninstall:
-       rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
-       rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
-       rm -rf $(D)$(BINDIR)/xc_shadow
-       rm -rf $(D)$(BINDIR)/pygrub
-       rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
-       rm -rf $(D)$(BINDIR)/xsls
        rm -rf $(D)$(BINDIR)/xenstore* $(D)$(BINDIR)/xentrace*
        rm -rf $(D)$(BINDIR)/xen-detect $(D)$(BINDIR)/xencons
-       rm -rf $(D)$(BINDIR)/xenpvnetboot $(D)$(BINDIR)/qemu-*-xen
+       rm -rf $(D)$(BINDIR)/qemu-*-xen
+       rm -rf $(D)$(BINDIR)/remus
+       rm -rf $(D)$(BINDIR)/pygrub
        rm -rf $(D)$(INCLUDEDIR)/xenctrl* $(D)$(INCLUDEDIR)/xenguest.h
        rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
-       rm -rf $(D)$(INCLUDEDIR)/xenstore-compat/xs_lib.h 
$(D)$(INCLUDEDIR)/xenstore-compat/xs.h
+       rm -rf $(D)$(INCLUDEDIR)/xenstore-compat
        rm -rf $(D)$(INCLUDEDIR)/xenstore_lib.h $(D)$(INCLUDEDIR)/xenstore.h
        rm -rf $(D)$(INCLUDEDIR)/xen
        rm -rf $(D)$(INCLUDEDIR)/_libxl* $(D)$(INCLUDEDIR)/libxl*
        rm -rf $(D)$(INCLUDEDIR)/xenstat.h $(D)$(INCLUDEDIR)/xentoollog.h
-       rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
+       rm -rf $(D)$(INCLUDEDIR)/blktaplib.h
+       rm -rf $(D)$(INCLUDEDIR)/libxenvchan.h
+       rm -rf $(D)$(INCLUDEDIR)/fsimage*
+       rm -rf $(D)$(LIBDIR)/xen*
+       rm -rf $(D)$(LIBDIR)/libxen*
        rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
-       rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
        rm -rf $(D)$(LIBDIR)/xen/
-       rm -rf $(D)$(LIBEXEC)/xen*
-       rm -rf $(D)$(SBINDIR)/setmask
-       rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
+       rm -rf $(D)$(LIBDIR)/libblktap*
+       rm -rf $(D)$(LIBDIR)/fs/
+       rm -rf $(D)$(LIBDIR)/libfsimage*
+       rm -rf $(D)$(LIBDIR)/libvhd*
+       rm -rf $(D)$(SBINDIR)/xen*
+       rm -rf $(D)$(SBINDIR)/xm
+       rm -rf $(D)$(SBINDIR)/flask-*
+       rm -rf $(D)$(SBINDIR)/xl
+       rm -rf $(D)$(SBINDIR)/xsview
+       rm -rf $(D)$(SBINDIR)/tap-ctl $(D)$(SBINDIR)/tapdisk* 
$(D)$(SBINDIR)/blktapctrl
+       rm -rf $(D)$(SBINDIR)/vhd-*
+       rm -rf $(D)$(SBINDIR)/gdbsx $(D)$(SBINDIR)/gtracestat 
$(D)$(SBINDIR)/gtraceview $(D)$(SBINDIR)/kdd
+       rm -rf $(D)$(SBINDIR)/qcow2raw $(D)$(SBINDIR)/qcow-create 
$(D)$(SBINDIR)/img2qcow
+       rm -rf $(D)$(SBINDIR)/td-util
+       rm -rf $(D)$(SBINDIR)/lock-util
        rm -rf $(D)$(SHAREDIR)/doc/xen
        rm -rf $(D)$(SHAREDIR)/xen
        rm -rf $(D)$(SHAREDIR)/qemu-xen
        rm -rf $(D)$(MAN1DIR)/xen*
        rm -rf $(D)$(MAN8DIR)/xen*
+       if test -f python/installed-files.list; then cat 
python/installed-files.list | xargs -I '{}' rm -f '/{}'; fi
+       if test -f pygrub/installed-files.list; then cat 
pygrub/installed-files.list | xargs -I '{}' rm -f '/{}'; fi
 
 .PHONY: clean
 clean: subdirs-clean
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 039f7f7..e63ebbd 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -12,7 +12,8 @@ build:
 install: all
        CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
                $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
-               --install-scripts=$(PRIVATE_BINDIR) --force
+               --install-scripts=$(PRIVATE_BINDIR) --force \
+               --record installed-files.list
        $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
        set -e; if [ "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
                     "`readlink -f $(PRIVATE_BINDIR)`" ]; then \
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 9be1122..efc4fe3 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -21,7 +21,8 @@ build: genpath genwrap.py 
$(XEN_ROOT)/tools/libxl/libxl_types.idl \
 .PHONY: install
 install: install-dtd
        CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
-               $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
+               $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force \
+               --record installed-files.list
 
 install-dtd: all
        $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/xen
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.