qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Lin Ma <lma@suse.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] Makefile: avoid leaving the temporary QEMU_PKGVERSION header file
Date: Wed, 15 Feb 2017 11:17:23 +0800	[thread overview]
Message-ID: <20170215031723.GB26331@lemon.lan> (raw)
In-Reply-To: <20170215024030.23895-1-lma@suse.com>

On Wed, 02/15 10:40, Lin Ma wrote:
> By commit 67a1de0d, When we perform 'git pull && make && sudo make install',
> In 'make' stage a qemu-version.h.tmp will be generated. If the content of
> qemu-version.h.tmp and qemu-version.h aren't consistent, The qemu-version.h.tmp
> will be renamed to qemu-version.h. Because of the target FORCE, The same action
> will be do again in 'make install' stage.
> 
> In 'make install' stage, If there is no qemu-version.h.tmp exists and we run
> 'make install' with sudo, The owner and group of new qemu-version.h.tmp will be
> privileged user/group. When we run 'make' next time, qemu-version.h.tmp can't
> be overwritten because of permission issue.
> 
> This patch removed qemu-version.h.tmp after build to fix this issue.
> 
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
>  Makefile | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index b993741..830fa5a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -299,7 +299,11 @@ qemu-version.h: FORCE
>  				printf '""\n'; \
>  			fi; \
>  		fi) > $@.tmp)
> -	$(call quiet-command, cmp -s $@ $@.tmp || mv $@.tmp $@)
> +	$(call quiet-command, if ! cmp -s $@ $@.tmp; then \
> +	  mv $@.tmp $@; \
> +	 else \
> +	  rm $@.tmp; \
> +	 fi)
>  
>  config-host.h: config-host.h-timestamp
>  config-host.h-timestamp: config-host.mak
> -- 
> 2.9.2
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

      reply	other threads:[~2017-02-15  3:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  2:40 [Qemu-devel] [PATCH v3] Makefile: avoid leaving the temporary QEMU_PKGVERSION header file Lin Ma
2017-02-15  3:17 ` Fam Zheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170215031723.GB26331@lemon.lan \
    --to=famz@redhat.com \
    --cc=lma@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).