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 D8629138CEE for ; Sun, 5 Jul 2015 15:37:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BC9EE08F4; Sun, 5 Jul 2015 15:37:24 +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 E2A64E08F4 for ; Sun, 5 Jul 2015 15:37:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C8303340912 for ; Sun, 5 Jul 2015 15:37:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0761F73C for ; Sun, 5 Jul 2015 15:37:21 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1436110787.367f271f463e16515aee0a31d59001cc4fac5008.blueness@gentoo> Subject: [gentoo-commits] proj/grss:master commit in: /, grs/ X-VCS-Repository: proj/grss X-VCS-Files: grs/WorldConf.py grsup X-VCS-Directories: grs/ / X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 367f271f463e16515aee0a31d59001cc4fac5008 X-VCS-Branch: master Date: Sun, 5 Jul 2015 15:37:21 +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: 64553db7-772e-4ea3-a9c0-a01488cd511d X-Archives-Hash: 0475f6f3086c2699a305504068084e15 commit: 367f271f463e16515aee0a31d59001cc4fac5008 Author: Anthony G. Basile gentoo org> AuthorDate: Sun Jul 5 15:39:47 2015 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sun Jul 5 15:39:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=367f271f grs/WorldConf.py: remove decorated package.env. grs/WorldConf.py | 46 ++++++---------------------------------------- grsup | 4 ++-- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/grs/WorldConf.py b/grs/WorldConf.py index 481d3a3..f20609b 100644 --- a/grs/WorldConf.py +++ b/grs/WorldConf.py @@ -20,22 +20,11 @@ class WorldConf(): """ try: for (f, v) in config[s].items(): - # a '+' at the beginging means append to the file - undecorated_f = re.sub('^\+', '', f) - - filepath = os.path.join(portage_confdir, undecorated_f) + filepath = os.path.join(portage_confdir, f) dirpath = os.path.dirname(filepath) os.makedirs(dirpath, mode=0o755, exist_ok=True) - if f == undecorated_f or not os.path.exists(filepath): - with open(filepath, 'w') as g: - g.write('%s\n' % v) - else: - with open(filepath, 'r+') as g: - for l in g.readlines(): - if v == l.strip(): - break - else: - g.write('%s\n' % v) + with open(filepath, 'w') as g: + g.write('%s\n' % v) except KeyError: pass @@ -78,39 +67,16 @@ class WorldConf(): slot = slotvar slot_atoms.append(re.sub('[/:]', '_', '%s:%s' % (p, slot))) - env_slot_atoms = [] for dirpath, dirnames, filenames in os.walk(CONST.PORTAGE_CONFIGDIR): # Only look at select files and directories. # TODO: This needs to be expanded. - skip = True - for p in ['env', 'package.accept_keywords', 'package.use', 'package.mask', 'package.unmask']: - if os.path.basename(dirpath) == p: - skip = False - if skip: + if not os.path.basename(dirpath) in ['env', 'package.env', \ + 'package.accept_keywords', 'package.use', 'package.mask', \ + 'package.unmask']: continue for f in filenames: fpath = os.path.realpath(os.path.join(dirpath, f)) if f in slot_atoms: os.remove(fpath) - if os.path.basename(dirpath) == 'env': - env_slot_atoms.append(f) continue - - fpath = os.path.join(CONST.PORTAGE_CONFIGDIR, 'package.env') - if os.path.isfile(fpath): - update = False - with open(fpath, 'r') as g: - lines = g.readlines() - mylines = copy.deepcopy(lines) - for l in lines: - for slot_atom in env_slot_atoms: - if re.search(re.escape(slot_atom), l): - try: - mylines.remove(l) - update = True - except ValueError: - pass - if update: - with open(fpath, 'w') as g: - g.writelines(mylines) diff --git a/grsup b/grsup index 69decfc..57029a7 100755 --- a/grsup +++ b/grsup @@ -18,7 +18,7 @@ from grs import WorldConf from _emerge.main import emerge_main, parse_opts from portage.exception import IsADirectory, ParseError, PermissionDenied -from portage import setting +from portage import settings def install_kernel(version = 'latest', logfile = CONST.LOGFILE): @@ -38,7 +38,7 @@ def install_kernel(version = 'latest', logfile = CONST.LOGFILE): def get_kernels(self): return self.kernels - baseurl = setting['PORTAGE_BINHOST'] + baseurl = settings['PORTAGE_BINHOST'] if baseurl == '': print('PORTAGE_BINHOST is not set. Install kernel manually.') return