from __future__ import print_function
-if not hasattr(__builtins__, "set"):
- from sets import Set as set
-
-from stat import *
-from random import *
+from stat import ST_GID, ST_MODE, ST_UID
+from random import random
import atexit, re, shutil, stat, sys
try:
confs = []
count = 0
-
+ config_root = '/'
self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
if "log-file" in self.options:
# Build list of extant configs
#
- for path in config_paths.split ():
+ for path in config_paths:
path = portage.normalize_path(path)
try:
mymode = os.stat(path).st_mode
# config file freezing support
frozen_files = set(self.options.get("frozen-files", "").split())
auto_zapped = []
+ protect_obj = ConfigProtect(
+ config_root, config_paths,
+ portage.util.shlex_split(
+ portage.settings.get('CONFIG_PROTECT_MASK', '')))
#
# Remove new configs identical to current
except OSError:
pass
return False
- elif unmodified or same_cvs or same_wsc or conf ['dir'] in portage.settings ['CONFIG_PROTECT_MASK'].split ():
+ elif unmodified or same_cvs or same_wsc or \
+ not protect_obj.isprotected(conf['current']):
self.replace(newconf, conf['current'])
self.post_process(conf['current'])
if newconf == mrgconf:
if len(sys.argv) > 1:
# for testing
- d.grind (" ".join(sys.argv[1:]))
+ d.grind(sys.argv[1:])
else:
- d.grind (portage.settings ['CONFIG_PROTECT'])
+ d.grind(portage.util.shlex_split(
+ portage.settings.get('CONFIG_PROTECT', '')))
from portage.dbapi.dep_expand import dep_expand
from portage.dep import flatten, paren_reduce, use_reduce
from portage.exception import InvalidAtom, InvalidData, InvalidDependString, PackageSetNotFound
-from portage.util import ConfigProtect, ensure_dirs
+from portage.util import ConfigProtect, ensure_dirs, shlex_split
from portage.dbapi.vartree import dblink, tar_contents
from portage.checksum import perform_md5
from portage.sets import load_default_config, SETPREFIX
def quickpkg_atom(options, infos, arg, eout):
+ settings = portage.settings
root = portage.settings["ROOT"]
trees = portage.db[root]
vartree = trees["vartree"]
protect = None
if not include_config:
confprot = ConfigProtect(root,
- portage.settings.get("CONFIG_PROTECT","").split(),
- portage.settings.get("CONFIG_PROTECT_MASK","").split())
+ shlex_split(settings.get("CONFIG_PROTECT", "")),
+ shlex_split(settings.get("CONFIG_PROTECT_MASK", "")))
def protect(filename):
if not confprot.isprotected(filename):
return False
trees[settings["ROOT"]]["vartree"].dbapi.match(
portage.const.PORTAGE_PACKAGE_ATOM))
- chk_updated_cfg_files("/", settings.get("CONFIG_PROTECT","").split())
+ chk_updated_cfg_files("/",
+ portage.util.shlex_split(settings.get("CONFIG_PROTECT", "")))
if myaction != "metadata":
postsync = os.path.join(settings["PORTAGE_CONFIGROOT"],
from portage.data import secpass
from portage.dbapi.dep_expand import dep_expand
from portage.util import normalize_path as normpath
-from portage.util import writemsg, writemsg_level, writemsg_stdout
+from portage.util import shlex_split, writemsg_level, writemsg_stdout
from portage.sets import SETPREFIX
from portage._global_updates import _global_updates
settings.regenerate()
settings.lock()
- config_protect = settings.get("CONFIG_PROTECT","").split()
+ config_protect = shlex_split(settings.get("CONFIG_PROTECT", ""))
infodirs = settings.get("INFOPATH","").split(":") + \
settings.get("INFODIR","").split(":")
from portage.localization import _
from portage.output import bold, colorize
from portage.update import grab_updates, parse_updates, update_config_files, update_dbentry
-from portage.util import grabfile, writemsg, writemsg_stdout, write_atomic
+from portage.util import grabfile, shlex_split, \
+ writemsg, writemsg_stdout, write_atomic
def _global_updates(trees, prev_mtimes):
"""
world_list[pos] = new_atom
world_modified = True
update_config_files(root,
- mysettings.get("CONFIG_PROTECT","").split(),
- mysettings.get("CONFIG_PROTECT_MASK","").split(),
+ shlex_split(mysettings.get("CONFIG_PROTECT", "")),
+ shlex_split(mysettings.get("CONFIG_PROTECT_MASK", "")),
myupd, match_callback=_world_repo_match)
for update_cmd in myupd: