public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/grss:master commit in: /, grs/
Date: Sun,  5 Jul 2015 15:37:21 +0000 (UTC)	[thread overview]
Message-ID: <1436110787.367f271f463e16515aee0a31d59001cc4fac5008.blueness@gentoo> (raw)

commit:     367f271f463e16515aee0a31d59001cc4fac5008
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  5 15:39:47 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> 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


             reply	other threads:[~2015-07-05 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-05 15:37 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-05 12:10 [gentoo-commits] proj/grss:master commit in: /, grs/ Anthony G. Basile

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=1436110787.367f271f463e16515aee0a31d59001cc4fac5008.blueness@gentoo \
    --to=blueness@gentoo.org \
    --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