Jim Meyering <[EMAIL PROTECTED]> wrote:

> "Daniel P. Berrange" <[EMAIL PROTECTED]> wrote:
>
>> On Tue, Oct 28, 2008 at 12:21:27PM +0100, Jim Meyering wrote:
>>> From: Jim Meyering <[EMAIL PROTECTED]>
>>>
>>> ---
>>>  qemud/remote_protocol.c |    1 -
>>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/qemud/remote_protocol.c b/qemud/remote_protocol.c
>>> index 5ef80e5..06b33d8 100644
>>> --- a/qemud/remote_protocol.c
>>> +++ b/qemud/remote_protocol.c
>>> @@ -3,7 +3,6 @@
>>>   * It was generated using rpcgen.
>>>   */
>>>
>>> -#include "remote_protocol.h"
>>>  #include <config.h>
>>>  #include "internal.h"
>>>  #include "socketcompat.h"
>>
>> You're removing it in this patch, but then adding it back in the same
>> place in a later patch ?  Or rather, this is added automatically by
>> rpcgen when you generate this file...
>
> Nominally, one must not include *anything* before <config.h>,
> but since this doesn't cause trouble on systems I tested, I won't
> worry about it, for now.
>
> Besides, I shouldn't be modifying manually a generated file.
> I'll tweak the build rule to mark the file as read-only,
> so that I don't do that again.

This makes it less likely that I will accidentally modify one
of these two generated files:

>From 39fbaef130e7027956194824fb6379d95a60bfbd Mon Sep 17 00:00:00 2001
From: Jim Meyering <[EMAIL PROTECTED]>
Date: Tue, 28 Oct 2008 13:46:06 +0100
Subject: [PATCH] make generated qemud/*.[ch] files read-only

* qemud/Makefile.am (.x.c): Rewrite not to write directly to $@,
and to make generated files read-only.
(.x.h): Likewise.
---
 qemud/Makefile.am |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/qemud/Makefile.am b/qemud/Makefile.am
index 56275f6..dd4c128 100644
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -34,18 +34,21 @@ EXTRA_DIST =                                                
\
 if RPCGEN
 SUFFIXES = .x
 .x.c:
-       rm -f $@
-       rpcgen -c -o $@ $<
+       rm -f $@ [EMAIL PROTECTED] [EMAIL PROTECTED]
+       rpcgen -c -o [EMAIL PROTECTED] $<
 if GLIBC_RPCGEN
-       mv $@ [EMAIL PROTECTED]
-       perl -w rpcgen_fix.pl < [EMAIL PROTECTED] > $@
+       perl -w rpcgen_fix.pl [EMAIL PROTECTED] > [EMAIL PROTECTED]
+       chmod 444 [EMAIL PROTECTED]
+       mv [EMAIL PROTECTED] $@
 endif

 .x.h:
-       rm -f $@
-       rpcgen -h -o $@ $<
+       rm -f $@ [EMAIL PROTECTED]
+       rpcgen -h -o [EMAIL PROTECTED] $<
 if GLIBC_RPCGEN
-       perl -i -p -e 's/\t/        /g' $@
+       perl -pi -e 's/\t/        /g' [EMAIL PROTECTED]
+       chmod 444 [EMAIL PROTECTED]
+       mv [EMAIL PROTECTED] $@
 endif
 endif

--
1.6.0.3.756.gb776d

--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to