On Sat, 8 Nov 2008, Dan Nicholson wrote:

On Fri, Nov 7, 2008 at 12:49 AM, Peter Breitenlohner <[EMAIL PROTECTED]>
wrote:

Attached are five tiny patches. Could one of you you please apply them.

In my original message I had overlooked xmh with the same problem, patch is
attached.

In order to guard against races with parallel jobs, can you change to
`mkdir -p'? ...

Sorry, I missed this aspect (simply repeated what was already done for other
modules).
I should have said: Yes, of course. I overlooked this aspect ....

How about simply ignoring errors resulting from mkdir, i.e., using
       -test -d app-defaults || mkdir app-defaults
That might produce spurious errors (ignored) for parallel jobs, but if mkdir
really fails (e.g., a regular file of that name already exists) the next
command 'cp $< $@' will fail.

Yeah, that'd be fine, too.

There is actually a much better way to avoid race conditions: whenever there
are several app-default files, make them depend on a phony target that
ensures the existence of ./app-defaults.  Attached is a patch implementing
this for xedit (where my original patch has already been applied).

Here a list of all app modules with that problem (more than one .ad
file):
        bitmap
        editres
        xcalc
        xclock
        xditview
        xedit
        xlogo
        xmessage

BTW: The only module with an .ad file still in the top-level directory is
oclock, but in that case there is no name conflict on case insensitive
filesystems.

Regards
Peter Breitenlohner <[EMAIL PROTECTED]>
From a228bb1f92980c4c3b654fab188c4798b4b73dee Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <[EMAIL PROTECTED]>
Date: Sat, 8 Nov 2008 18:47:06 +0100
Subject: [PATCH] enabled VPATH build

---
 Makefile.am |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f930a3c..9387cb3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,6 +73,7 @@ APPDEFAULTFILES = \
 SUFFIXES = .ad
 
 .ad:
+       test -d app-defaults || mkdir app-defaults
        cp $< $@
 
 appdefault_DATA = $(APPDEFAULTFILES)
-- 
1.6.0.3

From 0687ace9392c5801929d81380ac03bd851514971 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <[EMAIL PROTECTED]>
Date: Sun, 9 Nov 2008 14:24:10 +0100
Subject: [PATCH] avoid race condition for parallel jobs

---
 Makefile.am |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1a32798..7c13340 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,20 +167,25 @@ APPDEFAULTFILES = \
         app-defaults/Xedit-color \
        app-defaults/Xedit
 
+$(APPDEFAULTFILES): appsubdir
+
+.PHONY: appsubdir
+
+# Ensure ./app-defaults exists, avoiding race condition for parallel jobs
+appsubdir:
+       test -d app-defaults || mkdir app-defaults
+
 if USE_XPRINT
 app-defaults/Xedit.ad: 
-       test -d app-defaults || mkdir app-defaults
        cp $(top_srcdir)/app-defaults/Xedit-xprint.ad app-defaults/Xedit.ad
 else
 app-defaults/Xedit.ad:
-       test -d app-defaults || mkdir app-defaults
        cp $(top_srcdir)/app-defaults/Xedit-noxprint.ad app-defaults/Xedit.ad
 endif
 
 SUFFIXES = .ad 
 
 .ad:
-       test -d app-defaults || mkdir app-defaults
        cp $< $@
 
 appdefaultdir = @appdefaultdir@
-- 
1.6.0.3

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to