[libvirt] [PATCH] build: Use $(PYTHON) instead of python for the keycode map generator

Also prepend $(AM_V_GEN). --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..eef0669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - python $(srcdir)/util/virkeycode-mapgen.py <$(srcdir)/util/keymaps.csv >$@ + $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py <$(srcdir)/util/keymaps.csv >$@ $(srcdir)/util/virkeycode.c: $(srcdir)/util/virkeycode.h $(srcdir)/util/virkeymaps.h -- 1.7.4.1

On 07/22/2011 07:56 AM, Matthias Bolte wrote:
Also prepend $(AM_V_GEN). --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..eef0669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - python $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@ + $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@
ACK. Hmm, while you're at it, how about you also: chmod +x src/util/virkeycode-mapgen.py to match our style of .py files being executable (even if we run them via $(PYTHON)). -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Fri, Jul 22, 2011 at 08:06:00AM -0600, Eric Blake wrote:
On 07/22/2011 07:56 AM, Matthias Bolte wrote:
Also prepend $(AM_V_GEN). --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..eef0669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - python $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@ + $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@
ACK.
Ah right, I missed that !
Hmm, while you're at it, how about you also:
chmod +x src/util/virkeycode-mapgen.py
to match our style of .py files being executable (even if we run them via $(PYTHON)).
just wondering loud, if you change a file attribute like this will git automatically detect it and all to "commit" the change or is there some magic involved (yes I'm think thinking too much in terms of CVS !) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2011/7/22 Daniel Veillard <veillard@redhat.com>:
On Fri, Jul 22, 2011 at 08:06:00AM -0600, Eric Blake wrote:
On 07/22/2011 07:56 AM, Matthias Bolte wrote:
Also prepend $(AM_V_GEN). --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..eef0669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - python $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@ + $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@
ACK.
Ah right, I missed that !
Hmm, while you're at it, how about you also:
chmod +x src/util/virkeycode-mapgen.py
to match our style of .py files being executable (even if we run them via $(PYTHON)).
just wondering loud, if you change a file attribute like this will git automatically detect it and all to "commit" the change or is there some magic involved (yes I'm think thinking too much in terms of CVS !)
Daniel
git is smart and knows about the file mode an its changes, see the diff I squashed into the original patch diff --git a/src/util/virkeycode-mapgen.py b/src/util/virkeycode-mapgen.py old mode 100644 new mode 100755 index f0a4290..acf7364 --- a/src/util/virkeycode-mapgen.py +++ b/src/util/virkeycode-mapgen.py @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/python -- Matthias Bolte http://photron.blogspot.com

On 07/22/2011 08:17 AM, Daniel Veillard wrote:
chmod +x src/util/virkeycode-mapgen.py
to match our style of .py files being executable (even if we run them via $(PYTHON)).
just wondering loud, if you change a file attribute like this will git automatically detect it and all to "commit" the change or is there some magic involved (yes I'm think thinking too much in terms of CVS !)
Forget all the pain you ever had with CVS execute permissions :) Git makes it trivial - the x bit is tracked alongside every file, and you can even do a 0-line diff that changes only the file mode (remember, in git, every directory tree is an object, and directories record state information - so when you change +x bit, what you are really doing is recording a new tree object). -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2011/7/22 Eric Blake <eblake@redhat.com>:
On 07/22/2011 07:56 AM, Matthias Bolte wrote:
Also prepend $(AM_V_GEN). --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..eef0669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -90,7 +90,7 @@ EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \ $(srcdir)/util/virkeycode-mapgen.py - python $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@ + $(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py<$(srcdir)/util/keymaps.csv>$@
ACK.
Hmm, while you're at it, how about you also:
chmod +x src/util/virkeycode-mapgen.py
to match our style of .py files being executable (even if we run them via $(PYTHON)).
Good call. I also switched the shebang from /bin/python to the commonly use /usr/bin/python. I pushed the patch with the mentioned modifications. -- Matthias Bolte http://photron.blogspot.com
participants (3)
-
Daniel Veillard
-
Eric Blake
-
Matthias Bolte