From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753231AbcFOQEf (ORCPT ); Wed, 15 Jun 2016 12:04:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:40923 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbcFOQEd (ORCPT ); Wed, 15 Jun 2016 12:04:33 -0400 Date: Wed, 15 Jun 2016 18:04:26 +0200 From: "Luis R. Rodriguez" To: Julia Lawall Cc: "Luis R. Rodriguez" , Gilles.Muller@lip6.fr, nicolas.palix@imag.fr, mmarek@suse.com, linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Subject: Re: [PATCH 2/4] scripts: add reqs python library Message-ID: <20160615160426.GQ11948@wotan.suse.de> References: <1465942217-14452-1-git-send-email-mcgrof@kernel.org> <1465942217-14452-3-git-send-email-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2016 at 08:06:33AM +0200, Julia Lawall wrote: > > > On Tue, 14 Jun 2016, Luis R. Rodriguez wrote: > > > This library can be used in other python scripts to require > > specific binary version requirements. It will be used first > > with coccinelle's python bindings to enable coccinelle SmPL > > files to specify version requirements per cocci file if it > > has any. > > > > Signed-off-by: Luis R. Rodriguez > > --- > > MAINTAINERS | 1 + > > scripts/lib/__init__.py | 1 + > > scripts/lib/reqs.py | 211 ++++++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 213 insertions(+) > > create mode 100644 scripts/lib/__init__.py > > create mode 100644 scripts/lib/reqs.py > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index f83e19a2dd97..fdebbb513c1b 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -6521,6 +6521,7 @@ F: scripts/Makefile.* > > F: scripts/basic/ > > F: scripts/mk* > > F: scripts/package/ > > +F: scripts/lib/ > > > > KERNEL JANITORS > > L: kernel-janitors@vger.kernel.org > > diff --git a/scripts/lib/__init__.py b/scripts/lib/__init__.py > > new file mode 100644 > > index 000000000000..1bb8bf6d7fd4 > > --- /dev/null > > +++ b/scripts/lib/__init__.py > > @@ -0,0 +1 @@ > > +# empty > > diff --git a/scripts/lib/reqs.py b/scripts/lib/reqs.py > > new file mode 100644 > > index 000000000000..1325fd21a87a > > --- /dev/null > > +++ b/scripts/lib/reqs.py > > @@ -0,0 +1,211 @@ > > +import subprocess, os, sys, re > > +""" > > +Often enough Python code can grow to depend on binaries > > +on a system, you may also require only specific versions > > +of these. This small library helps with this. It also has > > +helpers for packages which we know to handle already. > > +""" > > + > > +class ReqError(Exception): > > + pass > > +class ExecutionError(ReqError): > > + def __init__(self, errcode): > > + self.error_code = errcode > > + > > +class Req: > > + "To be used for verifying binay package dependencies on Python code" > > binay -> binary Fixed, thanks. Luis From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcgrof@kernel.org (Luis R. Rodriguez) Date: Wed, 15 Jun 2016 18:04:26 +0200 Subject: [Cocci] [PATCH 2/4] scripts: add reqs python library In-Reply-To: References: <1465942217-14452-1-git-send-email-mcgrof@kernel.org> <1465942217-14452-3-git-send-email-mcgrof@kernel.org> Message-ID: <20160615160426.GQ11948@wotan.suse.de> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr On Wed, Jun 15, 2016 at 08:06:33AM +0200, Julia Lawall wrote: > > > On Tue, 14 Jun 2016, Luis R. Rodriguez wrote: > > > This library can be used in other python scripts to require > > specific binary version requirements. It will be used first > > with coccinelle's python bindings to enable coccinelle SmPL > > files to specify version requirements per cocci file if it > > has any. > > > > Signed-off-by: Luis R. Rodriguez > > --- > > MAINTAINERS | 1 + > > scripts/lib/__init__.py | 1 + > > scripts/lib/reqs.py | 211 ++++++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 213 insertions(+) > > create mode 100644 scripts/lib/__init__.py > > create mode 100644 scripts/lib/reqs.py > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index f83e19a2dd97..fdebbb513c1b 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -6521,6 +6521,7 @@ F: scripts/Makefile.* > > F: scripts/basic/ > > F: scripts/mk* > > F: scripts/package/ > > +F: scripts/lib/ > > > > KERNEL JANITORS > > L: kernel-janitors at vger.kernel.org > > diff --git a/scripts/lib/__init__.py b/scripts/lib/__init__.py > > new file mode 100644 > > index 000000000000..1bb8bf6d7fd4 > > --- /dev/null > > +++ b/scripts/lib/__init__.py > > @@ -0,0 +1 @@ > > +# empty > > diff --git a/scripts/lib/reqs.py b/scripts/lib/reqs.py > > new file mode 100644 > > index 000000000000..1325fd21a87a > > --- /dev/null > > +++ b/scripts/lib/reqs.py > > @@ -0,0 +1,211 @@ > > +import subprocess, os, sys, re > > +""" > > +Often enough Python code can grow to depend on binaries > > +on a system, you may also require only specific versions > > +of these. This small library helps with this. It also has > > +helpers for packages which we know to handle already. > > +""" > > + > > +class ReqError(Exception): > > + pass > > +class ExecutionError(ReqError): > > + def __init__(self, errcode): > > + self.error_code = errcode > > + > > +class Req: > > + "To be used for verifying binay package dependencies on Python code" > > binay -> binary Fixed, thanks. Luis