public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/, layman/
Date: Mon, 14 Feb 2011 06:00:27 +0000 (UTC)	[thread overview]
Message-ID: <5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c.dol-sen@gentoo> (raw)

commit:     5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c
Author:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Sat Aug  7 15:33:52 2010 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Feb 11 10:49:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=5c08a86e

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 License v2
+#
+# Author(s):
+#             Auke Booij <auke@tulcod.com>
+#
+''' G-common repository support.'''
+
+#===============================================================================
+#
+# Dependencies
+#
+#-------------------------------------------------------------------------------
+
+import os
+from   layman.utils             import path
+from   layman.overlays.source   import OverlaySource, require_supported
+
+#===============================================================================
+#
+# Class GCommonOverlay
+#
+#-------------------------------------------------------------------------------
+
+class GCommonOverlay(OverlaySource):
+    ''' Handles g-common-style repositories.'''
+
+    type = 'g-common'
+    type_key = 'g-common'
+
+    def __init__(self, parent, xml, config, _location, ignore = 0, quiet = False):
+        super(GCommonOverlay, self).__init__(parent, xml, config, _location, ignore, quiet)
+        #split source into driver and remote uri. 
+        self.driver=self.src[:self.src.find(' ')]
+        self.remote_uri=self.src[self.src.find(' ')+1:]
+
+    def add(self, base, quiet = False):
+        '''Add overlay.'''
+
+        self.supported()
+
+        os.makedirs(os.path.join(base,self.parent.name))
+        return self.sync(base, quiet)
+
+    def sync(self, base, quiet = False):
+        '''Sync overlay.'''
+
+        self.supported()
+
+        args = [os.path.join(base,self.parent.name), 'sync', self.driver, self.remote_uri]
+        returncode=self.run_command(*args,cwd=path([base,self.parent.name]))
+        if returncode: return returncode
+        args = [os.path.join(base,self.parent.name), 'generate-tree']
+        return self.run_command(*args,cwd=path([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.driver+'.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
 
 OVERLAY_TYPES = dict((e.type_key, e) for e in (
     GitOverlay,
+    GCommonOverlay,
     CvsOverlay,
     SvnOverlay,
     RsyncOverlay,



             reply	other threads:[~2011-02-14  6:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  6:00 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-14  6:00 [gentoo-commits] proj/layman:master commit in: layman/overlays/, layman/ Brian Dolbec
2011-02-14  6:00 Brian Dolbec
2011-02-14  6:00 Brian Dolbec
2011-02-14  6:00 Brian Dolbec
2011-04-27 10:58 Brian Dolbec
2011-04-27 10:58 Brian Dolbec
2011-07-29  6:11 Brian Dolbec
2011-07-30 16:53 Brian Dolbec
2011-08-06 18:29 Brian Dolbec
2011-08-07  2:29 Brian Dolbec
2011-08-11  3:24 Brian Dolbec
2011-08-21 16:42 Brian Dolbec
2011-08-24 14:02 Brian Dolbec
2011-09-24  6:07 Brian Dolbec
2014-06-16  3:37 [gentoo-commits] proj/layman:gsoc2014 " Brian Dolbec
2014-06-16  3:40 ` [gentoo-commits] proj/layman:master " Brian Dolbec
2014-06-16  3:40 Brian Dolbec
2014-06-16  3:40 Brian Dolbec
2020-04-24 20:59 Brian Dolbec

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=5c08a86e2c65c99a98bcfddf6f1f0d2b0c199a8c.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox