From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] Allow to override sync source Date: Thu, 14 May 2009 22:38:16 +0200 Message-ID: <4A0C8138.6000508@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig0D10FD98355D46FF892A94D6" Cc: kvm-devel To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:37308 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753144AbZENUiY (ORCPT ); Thu, 14 May 2009 16:38:24 -0400 Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig0D10FD98355D46FF892A94D6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable 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 --- 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 =3D $(patsubst %/build,%/kernel,$(KERNELDIR)= ) =20 rpmrelease =3D devel =20 +KVM_VERSION =3D kvm-devel LINUX =3D ./linux-2.6 =20 ifeq ($(EXT_CONFIG_KVM_TRACE),y) @@ -38,7 +39,7 @@ include $(MAKEFILE_PRE) .PHONY: sync =20 sync: - ./sync $(KVM_VERSION) + ./sync -v $(KVM_VERSION) -l $(LINUX) =20 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 =20 import sys, os, glob, os.path, shutil, re +from optparse import OptionParser =20 glob =3D glob.glob =20 @@ -8,12 +9,19 @@ def cmd(c): if os.system(c) !=3D 0: raise Exception('command execution failed: ' + c) =20 -version =3D 'kvm-devel' -if len(sys.argv) >=3D 2: - version =3D sys.argv[1] +parser =3D OptionParser(usage=3D'usage: %prog [-v version][-l linuxkerne= l]') +parser.add_option('-v', action=3D'store', type=3D'string', dest=3D'versi= on') +parser.add_option('-l', action=3D'store', type=3D'string', dest=3D'linux= ') +(options, args) =3D parser.parse_args() =20 +version =3D 'kvm-devel' linux =3D 'linux-2.6' =20 +if options.version: + version =3D options.version +if options.linux: + linux =3D options.linux + _re_cache =3D {} =20 def re_cache(regexp): --------------enig0D10FD98355D46FF892A94D6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkoMgT8ACgkQniDOoMHTA+mXngCfQdMZ3Bj5kteIbvtKVBBGnlk5 7HIAniMeGSTeDWbN7PiBOB7beRYk9vt3 =IGGg -----END PGP SIGNATURE----- --------------enig0D10FD98355D46FF892A94D6--