コード例 #1
0
    def test(self, config = None):
        self.set(config)
        ret = False
        if not self.__config:
            return False

        cmds = self.__config.test
        for cmd in cmds:
            ret = LocalOperation.run(cmd, path = self.__path)
            if not ret:
                break

        return ret
コード例 #2
0
    def install(self, config = None, save = True):
        self.set(config)
        Log.info(Status["STAT_INSTALLING_PKG"] % self.__config.name)
        ret = False
        if not self.__config:
            return False

        cmds = self.__config.install
        for cmd in cmds:
            Log.info(Status["STAT_RUN_CMD"] % cmd)
            ret = LocalOperation.run(cmd, path = self.__path)
            if not ret:
                break

        if ret and not self.__save_src(save):
            ret = False

        return ret
コード例 #3
0
    def remove(self, config=None, path=None):
        self.set(config, path)
        ret = True
        if not self.__config:
            return False

        # if self.find(self.__config.name, show = False):         #pkg exist
        #     Log.info(Status["STAT_PACKAGE_EXIST"] % self.__config.name)
        #     return False

        cmds = self.__config.remove
        for cmd in cmds:
            ret = LocalOperation.run(cmd, path = self.__path)
            if not ret:
                break

        if ret and not self.__remove_src():
            ret = False

        return ret