Exemplo n.º 1
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            # prefix applies to all paths, and repository has to be reinitialised to take new repositorypath in account
            # in the legacy-style configuration, repository is initialised in configuration file itself
            for dest in ["installpath", "buildpath", "sourcepath", "repository", "repositorypath"]:
                if not self.options._action_taken.get(dest, False):
                    if dest == "repository":
                        setattr(self.options, dest, DEFAULT_REPOSITORY)
                    elif dest == "repositorypath":
                        repositorypath = [mk_full_default_path(dest, prefix=self.options.prefix)]
                        setattr(self.options, dest, repositorypath)
                        self.go_cfg_constants[self.DEFAULTSECT]["DEFAULT_REPOSITORYPATH"] = repositorypath
                    else:
                        setattr(self.options, dest, mk_full_default_path(dest, prefix=self.options.prefix))
                    # LEGACY this line is here for oldstyle config reasons
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        if self.options.robot is not None:
            # paths specified to --robot have preference over --robot-paths
            # keep both values in sync if robot is enabled, which implies enabling dependency resolver
            self.options.robot_paths = self.options.robot + self.options.robot_paths
            self.options.robot = self.options.robot_paths
Exemplo n.º 2
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == 'repositorypath':
                        setattr(self.options, dest, new_def[changed_defaults['repository']])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated('Fake action taken to distinguish from default', '2.0')
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        # split supplied list of robot paths to obtain a list
        if self.options.robot:
            class RobotPath(ListOfStrings):
                SEPARATOR_LIST = os.pathsep
                # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined
                __str__ = ListOfStrings.__str__
            self.options.robot = RobotPath(self.options.robot)
Exemplo n.º 3
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            for dest in ["installpath", "buildpath", "sourcepath", "repositorypath"]:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == "repositorypath":
                        setattr(self.options, dest, new_def[changed_defaults["repository"]])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated("Fake action taken to distinguish from default", "2.0")
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        # split supplied list of robot paths to obtain a list
        if self.options.robot:

            class RobotPath(ListOfStrings):
                SEPARATOR_LIST = os.pathsep
                # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined
                __str__ = ListOfStrings.__str__

            self.options.robot = RobotPath(self.options.robot)
Exemplo n.º 4
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            # prefix applies to all paths, and repository has to be reinitialised to take new repositorypath in account
            # in the legacy-style configuration, repository is initialised in configuration file itself
            for dest in [
                    'installpath', 'buildpath', 'sourcepath', 'repository',
                    'repositorypath'
            ]:
                if not self.options._action_taken.get(dest, False):
                    if dest == 'repository':
                        setattr(self.options, dest, DEFAULT_REPOSITORY)
                    elif dest == 'repositorypath':
                        setattr(self.options, dest, [
                            mk_full_default_path(dest,
                                                 prefix=self.options.prefix)
                        ])
                    else:
                        setattr(
                            self.options, dest,
                            mk_full_default_path(dest,
                                                 prefix=self.options.prefix))
                    # LEGACY this line is here for oldstyle config reasons
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        if self.options.robot is not None:
            # paths specified to --robot have preference over --robot-paths
            # keep both values in sync if robot is enabled, which implies enabling dependency resolver
            self.options.robot_paths = self.options.robot + self.options.robot_paths
            self.options.robot = self.options.robot_paths
Exemplo n.º 5
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            # prefix applies to all paths, and repository has to be reinitialised to take new repositorypath into account
            # in the legacy-style configuration, repository is initialised in configuration file itself
            for dest in ['installpath', 'buildpath', 'sourcepath', 'repository', 'repositorypath']:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == 'repositorypath':
                        setattr(self.options, dest, new_def[changed_defaults['repository']])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated('Fake action taken to distinguish from default', '2.0')
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        # split supplied list of robot paths to obtain a list
        if self.options.robot:
            class RobotPath(ListOfStrings):
                SEPARATOR_LIST = os.pathsep
                # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined
                __str__ = ListOfStrings.__str__
            self.options.robot = RobotPath(self.options.robot)
Exemplo n.º 6
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            for dest in ["installpath", "buildpath", "sourcepath", "repositorypath"]:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == "repositorypath":
                        setattr(self.options, dest, new_def[changed_defaults["repository"]])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated("Fake action taken to distinguish from default", "2.0")
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()
Exemplo n.º 7
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == 'repositorypath':
                        setattr(self.options, dest, new_def[changed_defaults['repository']])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated('Fake action taken to distinguish from default', '2.0')
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()
Exemplo n.º 8
0
    def _postprocess_config(self):
        """Postprocessing of configuration options"""
        if self.options.prefix is not None:
            changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix)
            for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']:
                if not self.options._action_taken.get(dest, False):
                    new_def = changed_defaults[dest]
                    if dest == 'repositorypath':
                        setattr(self.options, dest, new_def[changed_defaults['repository']])
                    else:
                        setattr(self.options, dest, new_def)
                    # LEGACY this line is here for oldstyle reasons
                    self.log.deprecated('Fake action taken to distinguish from default', '2.0')
                    self.options._action_taken[dest] = True

        if self.options.pretend:
            self.options.installpath = get_pretend_installpath()

        # split supplied list of robot paths to obtain a list
        if self.options.robot:
            self.options.robot = self.options.robot.split(os.pathsep)