From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SZPwC-0001gN-GR for garchives@archives.gentoo.org; Tue, 29 May 2012 17:10:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 88175E07E8; Tue, 29 May 2012 17:09:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 57A54E07E8 for ; Tue, 29 May 2012 17:09:36 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AA66D1B406B for ; Tue, 29 May 2012 17:09:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 23166E543A for ; Tue, 29 May 2012 17:09:33 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1338311302.583cc5d1d5d4c98754cde003d70a22bfe0a07f79.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/ebuildjob.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 583cc5d1d5d4c98754cde003d70a22bfe0a07f79 X-VCS-Branch: master Date: Tue, 29 May 2012 17:09:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 8c01ff0a-7f0d-406e-a100-1883d340e377 X-Archives-Hash: 81328fea50461ed437ad5d687b0ac077 commit: 583cc5d1d5d4c98754cde003d70a22bfe0a07f79 Author: Andre Erdmann mailerd de> AuthorDate: Tue May 29 17:08:22 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Tue May 29 17:08:22 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D583cc5d1 roverlay, ebuildjob: module that reads a package file and creates an ebui= ld for it new file: ebuildjob.py --- roverlay/ebuildjob.py | 65 +++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/roverlay/ebuildjob.py b/roverlay/ebuildjob.py new file mode 100644 index 0000000..0861b22 --- /dev/null +++ b/roverlay/ebuildjob.py @@ -0,0 +1,65 @@ +# R Overlay -- ebuild creation, "job" module +# Copyright 2006-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from roverlay import ebuildcreator.EbuildCreator +from roverlay import fileio.DescriptionReader +from roverlay import ebuild.Ebuild + +class EbuildJob: + + @classmethod + def __init__ ( self, package_file, dep_resolver=3DNone ): + self.package_file =3D package_file + self.dep_resolver =3D dep_resolver + # get description reader from args? + self.description_reader =3D DescriptionReader() + self.ebuild =3D Ebuild() + + self.status =3D 0 # todo + + + @classmethod + def status ( self, expected_status=3DNone ): + """Returns the current status of this job or a bool that indicates + whether to current status matches the expected one. + + arguments: + * expected_status -- if not None: check if this job's state is expecte= d_status + """ + if expected_status: + return self.status + else: + return bool ( self.status =3D=3D expected_status ) + + @classmethod + def get_ebuild ( self ): + """Returns the Ebuild that is created by this object. Note that you sh= ould + check the status with status ( $TODO::EBUILD_READY ) before trying to = use + the Ebuild. + """ + return self.ebuild + + + @classmethod + def run ( self ): + """Tells this EbuildJob to run. This means that it reads the package f= ile, + resolves dependencies (TODO) and creates an Ebuild object that is read= y + to be written into a file. + """ + + # check status + ## + + read_data =3D self.description_reader.readfile ( self.package_file ) + + if read_data is None + # set status accordingly + return None + + # transfer data from read_data to self.ebuild + # have to resolve deps here + # + + return None +