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 0CF2E13877A for ; Tue, 26 Aug 2014 19:38:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A14FCE08A6; Tue, 26 Aug 2014 19:38:53 +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 47EC3E08A6 for ; Tue, 26 Aug 2014 19:38:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 391F233F883 for ; Tue, 26 Aug 2014 19:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D9C9F3ED2 for ; Tue, 26 Aug 2014 19:38:50 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1409074165.45c2514156d641c00b9bbefa8ac018d34b8c2024.twitch153@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/config_modules/makeconf/ X-VCS-Repository: proj/layman X-VCS-Files: layman/config_modules/makeconf/makeconf.py X-VCS-Directories: layman/config_modules/makeconf/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: 45c2514156d641c00b9bbefa8ac018d34b8c2024 X-VCS-Branch: master Date: Tue, 26 Aug 2014 19:38:50 +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: 563390bc-3fc4-4c86-ab95-d3a322f97ce4 X-Archives-Hash: 7f8b4578c90faceabda5248d1f245001 commit: 45c2514156d641c00b9bbefa8ac018d34b8c2024 Author: Devan Franchini gentoo org> AuthorDate: Mon Aug 25 00:34:19 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Tue Aug 26 17:29:25 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=45c25141 makeconf.py: Ensures disable/enable compatibility To reflect the ability to disable or enable an overlay, makeconf.py needed to be able to go from the old style make.conf file to the new style automatically when layman wrote to the make.conf. --- layman/config_modules/makeconf/makeconf.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/layman/config_modules/makeconf/makeconf.py b/layman/config_modules/makeconf/makeconf.py index 140e694..6a6890c 100644 --- a/layman/config_modules/makeconf/makeconf.py +++ b/layman/config_modules/makeconf/makeconf.py @@ -235,20 +235,23 @@ class ConfigHandler: if i.strip()] for i in (disabled_overlays, enabled_overlays, overlays): - for o in i: + for o in (i or []): if o[:len(self.storage)] == self.storage: oname = os.path.basename(o) if oname in self.db.keys(): if i == disabled_overlays: - self.disabled.append(path([self.storage, oname])) + self.disabled.append(path([self.storage, + oname])) self.overlays.append(self.db[oname]) else: # These are additional overlays that we dont know - # anything about. The user probably added them manually + # know anything about. The user probably added + # them manually. self.extra.append(o) else: - # These are additional overlays that we dont know anything - # about. The user probably added them manually + # These are additional overlays that we dont know + # anything about. The user probably added them + # manually. self.extra.append(o) else: @@ -346,6 +349,10 @@ class ConfigHandler: overlays += '\n'.join(self.extra) overlays += '"' + if not re.search('ENABLED=', self.data): + self.data = '\n'.join((enabled_overlays, disabled_overlays, + overlays)) + enabled_content = self.my_enabled_re.sub(enabled_overlays, self.data) disabled_content = self.my_disabled_re.sub(disabled_overlays, enabled_content) content = self.my_portdir_re.sub(overlays, disabled_content)