All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix "make uninstall" so that it will remove files first
@ 2005-09-24  5:57 Jerone Young
  2005-09-24  7:41 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Jerone Young @ 2005-09-24  5:57 UTC (permalink / raw)
  To: xen-devel

If anyone knows a better way to check for a file in make please reply to
this patch. The problem here is that when /etc/xen does not exist "[ -d
$(D)/etc/xen ]" (otherwise know as "test") return 1 and make bails out.
So I have moved this as the last task as a temporary fix.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
# HG changeset patch
# User root@leaf9.ltc.austin.ibm.com
# Node ID 18994ae7c234f71d8ef994dcd12c6dcf1a748c42
# Parent  2f83ff9f6bd2a7987c297b84bfce1f8e22409cae
Change so that test for existance of /etc/xen is last. If the test fails
then the entire uninstall process fails and no file are removed.

diff -r 2f83ff9f6bd2 -r 18994ae7c234 Makefile
--- a/Makefile  Thu Sep 22 17:03:16 2005
+++ b/Makefile  Sat Sep 24 04:54:03 2005
@@ -164,7 +164,6 @@
 uninstall: DESTDIR=
 uninstall: D=$(DESTDIR)
 uninstall:
-       [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date
+%s`
        rm -rf $(D)/etc/init.d/xend*
        rm -rf $(D)/etc/hotplug/xen-backend.agent
        rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
@@ -185,6 +184,7 @@
        rm -rf $(D)/usr/share/xen
        rm -rf $(D)/usr/share/man/man1/xen*
        rm -rf $(D)/usr/share/man/man8/xen*
+       [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date
+%s`

 # Legacy targets for compatibility
 linux24:

-- 
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix "make uninstall" so that it will remove files first
  2005-09-24  5:57 [PATCH] fix "make uninstall" so that it will remove files first Jerone Young
@ 2005-09-24  7:41 ` Keir Fraser
  2005-09-25  9:12   ` Jerone Young
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2005-09-24  7:41 UTC (permalink / raw)
  To: Jerone Young; +Cc: xen-devel


On 24 Sep 2005, at 06:57, Jerone Young wrote:

> If anyone knows a better way to check for a file in make please reply 
> to
> this patch. The problem here is that when /etc/xen does not exist "[ -d
> $(D)/etc/xen ]" (otherwise know as "test") return 1 and make bails out.
> So I have moved this as the last task as a temporary fix.

How about appending '|| true' to that line?

  -- Keir

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix "make uninstall" so that it will remove files first
  2005-09-24  7:41 ` Keir Fraser
@ 2005-09-25  9:12   ` Jerone Young
  0 siblings, 0 replies; 3+ messages in thread
From: Jerone Young @ 2005-09-25  9:12 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Sat, 2005-09-24 at 08:41 +0100, Keir Fraser wrote:
> On 24 Sep 2005, at 06:57, Jerone Young wrote:
> 
> > If anyone knows a better way to check for a file in make please reply 
> > to
> > this patch. The problem here is that when /etc/xen does not exist "[ -d
> > $(D)/etc/xen ]" (otherwise know as "test") return 1 and make bails out.
> > So I have moved this as the last task as a temporary fix.
> 
> How about appending '|| true' to that line?

Thanks Keir...sometimes you just don't think about the simple answers.
Yeap that's all it needed.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

# HG changeset patch
# User root@leaf9.ltc.austin.ibm.com
# Node ID b1f8d07353a6f8a56eb9d72ec2d19f18fa8c8c34
# Parent  909172f2aa54035d5b918528eea0bcc4aaf15429
Fix so that make unistall will not fail if /etc/xen does not exist.

diff -r 909172f2aa54 -r b1f8d07353a6 Makefile
--- a/Makefile  Sat Sep 24 22:10:31 2005
+++ b/Makefile  Sun Sep 25 08:16:30 2005
@@ -164,7 +164,7 @@
 uninstall: DESTDIR=
 uninstall: D=$(DESTDIR)
 uninstall:
-       [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date
+%s`
+       [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen $(D)/etc/xen.old-`date
+%s` ||true
        rm -rf $(D)/etc/init.d/xend*
        rm -rf $(D)/etc/hotplug/xen-backend.agent
        rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*

-- 
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-25  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-24  5:57 [PATCH] fix "make uninstall" so that it will remove files first Jerone Young
2005-09-24  7:41 ` Keir Fraser
2005-09-25  9:12   ` Jerone Young

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.