From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A0CFB13877A for ; Mon, 16 Jun 2014 03:37:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E3D78E0B97; Mon, 16 Jun 2014 03:37:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 590EBE0B94 for ; Mon, 16 Jun 2014 03:37:31 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 79FD033FDD1 for ; Mon, 16 Jun 2014 03:37:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 2D05D187EF for ; Mon, 16 Jun 2014 03:37:28 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1402607509.323362ad64d9b0477a662c0d58eeec89e7e3948e.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:gsoc2014 commit in: layman/overlays/ X-VCS-Repository: proj/layman X-VCS-Files: layman/overlays/bzr.py X-VCS-Directories: layman/overlays/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 323362ad64d9b0477a662c0d58eeec89e7e3948e X-VCS-Branch: gsoc2014 Date: Mon, 16 Jun 2014 03:37:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 083ca37e-7f07-419f-964f-af9afe90bf7a X-Archives-Hash: 0d42c703451b0c14cf4c4092b24c12d0 commit: 323362ad64d9b0477a662c0d58eeec89e7e3948e Author: Devan Franchini gentoo org> AuthorDate: Thu May 29 23:12:58 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Thu Jun 12 21:11:49 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=323362ad bzr.py: Adds update() function Also adds _fix_brz_source() function to be used by add() and update(). --- layman/overlays/bzr.py | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/layman/overlays/bzr.py b/layman/overlays/bzr.py index 9cfa8b5..20d2491 100644 --- a/layman/overlays/bzr.py +++ b/layman/overlays/bzr.py @@ -49,6 +49,16 @@ class BzrOverlay(OverlaySource): config, _location, ignore) self.subpath = None + def _fix_bzr_source(self, source): + ''' + Adds trailing slash to source URL if needed. + + @params source: source URL, string. + ''' + if source.endswith("/"): + return source + return source + '/' + def add(self, base): '''Add overlay.''' @@ -58,10 +68,7 @@ class BzrOverlay(OverlaySource): cfg_opts = self.config["bzr_addopts"] target = path([base, self.parent.name]) - if self.src.endswith("/"): - src = self.src - else: - src = self.src + '/' + src = self._fix_bzr_source(self.src) # bzr get SOURCE TARGET if len(cfg_opts): @@ -73,6 +80,27 @@ class BzrOverlay(OverlaySource): self.run_command(self.command(), args, cmd=self.type), cwd=target) + def update(self, base, src): + ''' + Updates overlay src-url. + + @params base: base location where all overlays are installed. + @params src: source URL. + ''' + + if not self.supported(): + return 1 + + target = path([base, self.parent.name]) + + # bzr bind SOURCE + args = ['bind', self._fix_bzr_source(src)] + if self.config['quiet']: + args.append('--quiet') + return self.postsync( + self.run_command(self.command(), args, cmd=self.type), + cwd=target) + def sync(self, base): '''Sync overlay.''' From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B845913877A for ; Mon, 16 Jun 2014 03:40:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCEFCE0B35; Mon, 16 Jun 2014 03:40:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 21859E0B35 for ; Mon, 16 Jun 2014 03:40:21 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 493DC33F7D6 for ; Mon, 16 Jun 2014 03:40:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id E2D07187EF for ; Mon, 16 Jun 2014 03:40:17 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1402607509.323362ad64d9b0477a662c0d58eeec89e7e3948e.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/ X-VCS-Repository: proj/layman X-VCS-Files: layman/overlays/bzr.py X-VCS-Directories: layman/overlays/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 323362ad64d9b0477a662c0d58eeec89e7e3948e X-VCS-Branch: master Date: Mon, 16 Jun 2014 03:40:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8f41528a-8b00-4db6-9a20-5911894dd394 X-Archives-Hash: 32ef1f163be048d298df7a70d9ee4e03 Message-ID: <20140616034017.vJEJPuh76g5vjfqqMKSUvw79Bx1W72hGLAkJr--ka0c@z> commit: 323362ad64d9b0477a662c0d58eeec89e7e3948e Author: Devan Franchini gentoo org> AuthorDate: Thu May 29 23:12:58 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Thu Jun 12 21:11:49 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=323362ad bzr.py: Adds update() function Also adds _fix_brz_source() function to be used by add() and update(). --- layman/overlays/bzr.py | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/layman/overlays/bzr.py b/layman/overlays/bzr.py index 9cfa8b5..20d2491 100644 --- a/layman/overlays/bzr.py +++ b/layman/overlays/bzr.py @@ -49,6 +49,16 @@ class BzrOverlay(OverlaySource): config, _location, ignore) self.subpath = None + def _fix_bzr_source(self, source): + ''' + Adds trailing slash to source URL if needed. + + @params source: source URL, string. + ''' + if source.endswith("/"): + return source + return source + '/' + def add(self, base): '''Add overlay.''' @@ -58,10 +68,7 @@ class BzrOverlay(OverlaySource): cfg_opts = self.config["bzr_addopts"] target = path([base, self.parent.name]) - if self.src.endswith("/"): - src = self.src - else: - src = self.src + '/' + src = self._fix_bzr_source(self.src) # bzr get SOURCE TARGET if len(cfg_opts): @@ -73,6 +80,27 @@ class BzrOverlay(OverlaySource): self.run_command(self.command(), args, cmd=self.type), cwd=target) + def update(self, base, src): + ''' + Updates overlay src-url. + + @params base: base location where all overlays are installed. + @params src: source URL. + ''' + + if not self.supported(): + return 1 + + target = path([base, self.parent.name]) + + # bzr bind SOURCE + args = ['bind', self._fix_bzr_source(src)] + if self.config['quiet']: + args.append('--quiet') + return self.postsync( + self.run_command(self.command(), args, cmd=self.type), + cwd=target) + def sync(self, base): '''Sync overlay.'''