Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] gcc-runtime: Avoid error when trying to remove nonexistent directories
@ 2013-05-02 12:19 Phil Blundell
  2013-05-02 12:54 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Blundell @ 2013-05-02 12:19 UTC (permalink / raw)
  To: openembedded-core

If we didn't build libgomp then we won't have installed anything into
${infodir} or ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude.  Check
whether those directories exist before trying to remove them, else we
will lose.

Signed-off-by: Phil Blundell <philb@gnu.org>
---
 meta/recipes-devtools/gcc/gcc-configure-runtime.inc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
index a9f77d9..977a98a 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
@@ -43,8 +43,12 @@ do_install () {
 		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
 	done
 	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
-	rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
-	rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+	fi
+	if [ -d ${D}${infodir} ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+	fi
 	chown -R root:root ${D}
 }
 
-- 
1.7.10.4






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

* Re: [PATCH] gcc-runtime: Avoid error when trying to remove nonexistent directories
  2013-05-02 12:19 [PATCH] gcc-runtime: Avoid error when trying to remove nonexistent directories Phil Blundell
@ 2013-05-02 12:54 ` Burton, Ross
  2013-05-02 13:13   ` Phil Blundell
  0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2013-05-02 12:54 UTC (permalink / raw)
  To: Phil Blundell; +Cc: openembedded-core

On 2 May 2013 13:19, Phil Blundell <pb@pbcl.net> wrote:
> If we didn't build libgomp then we won't have installed anything into
> ${infodir} or ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude.  Check
> whether those directories exist before trying to remove them, else we
> will lose.

Isn't it neater to use rm -rf?

Ross



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

* Re: [PATCH] gcc-runtime: Avoid error when trying to remove nonexistent directories
  2013-05-02 12:54 ` Burton, Ross
@ 2013-05-02 13:13   ` Phil Blundell
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Blundell @ 2013-05-02 13:13 UTC (permalink / raw)
  To: Burton, Ross; +Cc: openembedded-core

On Thu, 2013-05-02 at 13:54 +0100, Burton, Ross wrote:
> On 2 May 2013 13:19, Phil Blundell <pb@pbcl.net> wrote:
> > If we didn't build libgomp then we won't have installed anything into
> > ${infodir} or ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude.  Check
> > whether those directories exist before trying to remove them, else we
> > will lose.
> 
> Isn't it neater to use rm -rf?

The original code goes to some trouble to use "rmdir
--ignore-fail-on-non-empty", which I assume means that there are some
circumstances where those directories do contain other files that we
want to keep.  Using "rm -rf" would obviously blow the whole thing away.

p.





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

end of thread, other threads:[~2013-05-02 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 12:19 [PATCH] gcc-runtime: Avoid error when trying to remove nonexistent directories Phil Blundell
2013-05-02 12:54 ` Burton, Ross
2013-05-02 13:13   ` Phil Blundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox