From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: [PATCH] Allow to override sync source
Date: Thu, 14 May 2009 22:38:16 +0200 [thread overview]
Message-ID: <4A0C8138.6000508@web.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]
In order to allow sync'ing the kmod dir against arbitrary kernels trees,
extend the sync script to accept alternative paths and adjust the
Makefile accordingly.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Makefile | 3 ++-
sync | 14 +++++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 1e0420e..dad5f0b 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ ORIGMODDIR = $(patsubst %/build,%/kernel,$(KERNELDIR))
rpmrelease = devel
+KVM_VERSION = kvm-devel
LINUX = ./linux-2.6
ifeq ($(EXT_CONFIG_KVM_TRACE),y)
@@ -38,7 +39,7 @@ include $(MAKEFILE_PRE)
.PHONY: sync
sync:
- ./sync $(KVM_VERSION)
+ ./sync -v $(KVM_VERSION) -l $(LINUX)
install:
mkdir -p $(DESTDIR)/$(INSTALLDIR)
diff --git a/sync b/sync
index 4a89296..2e53a31 100755
--- a/sync
+++ b/sync
@@ -1,6 +1,7 @@
#!/usr/bin/python
import sys, os, glob, os.path, shutil, re
+from optparse import OptionParser
glob = glob.glob
@@ -8,12 +9,19 @@ def cmd(c):
if os.system(c) != 0:
raise Exception('command execution failed: ' + c)
-version = 'kvm-devel'
-if len(sys.argv) >= 2:
- version = sys.argv[1]
+parser = OptionParser(usage='usage: %prog [-v version][-l linuxkernel]')
+parser.add_option('-v', action='store', type='string', dest='version')
+parser.add_option('-l', action='store', type='string', dest='linux')
+(options, args) = parser.parse_args()
+version = 'kvm-devel'
linux = 'linux-2.6'
+if options.version:
+ version = options.version
+if options.linux:
+ linux = options.linux
+
_re_cache = {}
def re_cache(regexp):
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next reply other threads:[~2009-05-14 20:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 20:38 Jan Kiszka [this message]
2009-05-17 19:31 ` [PATCH] Allow to override sync source Avi Kivity
2009-05-18 9:01 ` [PATCH v2] " Jan Kiszka
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=4A0C8138.6000508@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.