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 1PorVq-0004ex-G6 for garchives@archives.gentoo.org; Mon, 14 Feb 2011 06:02:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7685E09C2; Mon, 14 Feb 2011 06:00:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8394CE09A4 for ; Mon, 14 Feb 2011 06:00:28 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 215CA1B4094 for ; Mon, 14 Feb 2011 06:00:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8CC5080073 for ; Mon, 14 Feb 2011 06:00:27 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/, layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/config.py layman/overlays/g_common.py layman/overlays/overlay.py X-VCS-Directories: layman/overlays/ layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c Date: Mon, 14 Feb 2011 06:00:27 +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: X-Archives-Hash: 02ea4bec591753d143852a813f15dad0 commit: 5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c Author: Brian Dolbec gmail com> AuthorDate: Sat Aug 7 15:33:52 2010 +0000 Commit: Brian Dolbec gmail com> CommitDate: Fri Feb 11 10:49:14 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D5c08a86e Apply tulcod's g-common support changes. --- layman/config.py | 1 + layman/overlays/g_common.py | 75 +++++++++++++++++++++++++++++++++++++= ++++++ layman/overlays/overlay.py | 2 + 3 files changed, 78 insertions(+), 0 deletions(-) diff --git a/layman/config.py b/layman/config.py index e62f535..ceafcc4 100644 --- a/layman/config.py +++ b/layman/config.py @@ -74,6 +74,7 @@ class BareConfig(object): 'cvs_command': '/usr/bin/cvs', 'darcs_command': '/usr/bin/darcs', 'git_command': '/usr/bin/git', + 'g-common_command': '/usr/bin/g-common', 'mercurial_command': '/usr/bin/hg', 'rsync_command': '/usr/bin/rsync', 'svn_command': '/usr/bin/svn', diff --git a/layman/overlays/g_common.py b/layman/overlays/g_common.py new file mode 100644 index 0000000..80d0742 --- /dev/null +++ b/layman/overlays/g_common.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +########################################################################= ######### +# LAYMAN G-COMMON OVERLAY HANDLER +########################################################################= ######### +# File: g_common.py +# +# Handles g-common-style repositories +# +# Copyright: +# (c) 2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public Lice= nse v2 +# +# Author(s): +# Auke Booij +# +''' G-common repository support.''' + +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D +# +# Dependencies +# +#-----------------------------------------------------------------------= -------- + +import os +from layman.utils import path +from layman.overlays.source import OverlaySource, require_supported + +#=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D +# +# Class GCommonOverlay +# +#-----------------------------------------------------------------------= -------- + +class GCommonOverlay(OverlaySource): + ''' Handles g-common-style repositories.''' + + type =3D 'g-common' + type_key =3D 'g-common' + + def __init__(self, parent, xml, config, _location, ignore =3D 0, qui= et =3D False): + super(GCommonOverlay, self).__init__(parent, xml, config, _locat= ion, ignore, quiet) + #split source into driver and remote uri.=20 + self.driver=3Dself.src[:self.src.find(' ')] + self.remote_uri=3Dself.src[self.src.find(' ')+1:] + + def add(self, base, quiet =3D False): + '''Add overlay.''' + + self.supported() + + os.makedirs(os.path.join(base,self.parent.name)) + return self.sync(base, quiet) + + def sync(self, base, quiet =3D False): + '''Sync overlay.''' + + self.supported() + + args =3D [os.path.join(base,self.parent.name), 'sync', self.driv= er, self.remote_uri] + returncode=3Dself.run_command(*args,cwd=3Dpath([base,self.parent= .name])) + if returncode: return returncode + args =3D [os.path.join(base,self.parent.name), 'generate-tree'] + return self.run_command(*args,cwd=3Dpath([base,self.parent.name]= )) + + def supported(self): + '''Overlay type supported?''' + + return require_supported( + [(self.command(), + 'g-common', + 'app-portage/g-common'), + ('/usr/share/g-common/drivers/'+self.dri= ver+'.cfg', + 'g-common for '+self.driver, + 'app-portage/g-'+self.driver),]) diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index 4036458..6f39ae8 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -40,6 +40,7 @@ from layman.utils import ensure_unicode from layman.overlays.bzr import BzrOverlay from layman.overlays.darcs import DarcsOverlay from layman.overlays.git import GitOverlay +from layman.overlays.g_common import GCommonOverlay from layman.overlays.mercurial import MercurialOverlay from layman.overlays.cvs import CvsOverlay from layman.overlays.svn import SvnOverlay @@ -54,6 +55,7 @@ from layman.overlays.tar import TarOverlay =20 OVERLAY_TYPES =3D dict((e.type_key, e) for e in ( GitOverlay, + GCommonOverlay, CvsOverlay, SvnOverlay, RsyncOverlay,