Example #1
0
    def run(self, config, args):
        to_remove = [os.path.join(config.home_dir, config.cache_file)]
        to_remove.append(config.prefix)
        to_remove.append(config.logs)
        if not args.keep_sources:
            to_remove.append(config.sources)
        if args.build_tools:
            to_remove.append(
                os.path.join(config.home_dir, config.build_tools_cache))
            to_remove.append(config.build_tools_prefix)
            to_remove.append(config.build_tools_sources)

        if args.force:
            self.wipe(to_remove)
            return

        options = ['yes', 'no']
        en_msg = "WARNING!!!\n" \
                "This command will delete cerbero's build cache"
        if not args.keep_sources:
            en_msg += ", the sources directory,"
        en_msg += " and the builds directory " \
                "to reset the build system to its initial state.\n" \
                "The following paths will be removed:\n%s\n" \
                "Do you want to continue?" % '\n'.join(to_remove)
        msg = _(en_msg)
        # Ask once
        if shell.prompt(msg, options) == options[0]:
            msg = _("Are you sure?")
            # Ask twice
            if shell.prompt(msg, options) == options[0]:
                # Start with the Apocalypse
                self.wipe(to_remove)
Example #2
0
    def run(self, config, args):
        to_remove = [os.path.join(CONFIG_DIR, config.cache_file)]
        to_remove.append(config.prefix)
        to_remove.append(config.sources)
        if (args.build_tools):
            to_remove.append(os.path.join(CONFIG_DIR, config.build_tools_cache))
            to_remove.append(config.build_tools_prefix)
            to_remove.append(config.build_tools_sources)

        if args.force:
            self.wipe(to_remove)
            return

        options = ['yes', 'no']
        msg = _("WARNING!!!\n"
                "This command will delete cerbero's build cache, "
                "the sources directory and the builds directory "
                "to reset the build system to its initial state.\n"
                "The following paths will be removed:\n%s\n"
                "Do you want to continue?" % '\n'.join(to_remove))
        # Ask once
        if shell.prompt(msg, options) == options[0]:
            msg = _("Are you sure?")
            # Ask twice
            if shell.prompt(msg, options) == options[0]:
                # Start with the Apocalypse
                self.wipe(to_remove)
Example #3
0
    def run(self, config, args):
        to_remove = [os.path.join(CONFIG_DIR, config.cache_file)]
        to_remove.append(config.prefix)
        to_remove.append(config.sources)

        if args.force:
            self.wipe(to_remove)
            return

        options = ['yes', 'no']
        msg = _("WARNING!!!\n"
                "This command will delete cerbero's build cache, "
                "the sources directory and the builds directory "
                "to reset the build system to its initial state.\n"
                "The following paths will be removed:\n%s\n"
                "Do you want to continue?" % '\n'.join(to_remove))
        # Ask once
        if shell.prompt(msg, options) == options[0]:
            msg = _("Are you sure?")
            # Ask twice
            if shell.prompt(msg, options) == options[0]:
                # Start with the Apocalypse
                self.wipe(to_remove)