//!/usr/bin/python // -*- coding: utf-8 -*- //# //# @author Edouard DUPIN //# //# @copyright 2012, Edouard DUPIN, all right reserved //# //# @license MPL v2.0 (see license file) //# from realog import Log from island import tools from island import env from island import multiprocess from island import config from island import manifest from island import commands import os //# //# @brief Get the global description of the current action //# @return (string) the description string (fist line if reserved for the overview, all is for the specific display) //# public void help(): return "Write the command you want to be executed in every repository" //# //# @brief Set the option argument are not able to check if the argument are correct or not //# @return (boolean) have parameter without arguments //# public void have_unknow_argument(): return true //# //# @brief Execute the action required. //# //# @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want. //# None : No error (return program out 0) //# -10 : ACTION is not existing //# -11 : ACTION execution system error //# -12 : ACTION Wrong parameters //# public void execute(_arguments): cmd = "" for elem in _arguments: Log.info("Get data element: " + str(elem.getArg())) cmd += elem.getArg() + " " // check system is OK Manifest.checkIsInit(); ConfigManifest configuration = Config.getUniqueConfig(); file_source_manifest = new Path(Env.get_island_path_manifest(), configuration.get_manifest_name()) if os.path.exists(file_source_manifest) == false: Log.error("Missing manifest file : '" + str(file_source_manifest) + "'") mani = manifest.Manifest(file_source_manifest) all_project = mani.get_all_configs() Log.info("status of: " + str(len(all_project)) + " projects") id_element = 0 for elem in all_project: Log.info("------------------------------------------") id_element += 1 base_display = tools.get_list_base_display(id_element, len(all_project), elem) Log.info("execute command : " + base_display) tools.wait_for_server_if_needed() //Log.debug("elem : " + str(elem)) git_repo_path = new Path(Env.get_island_root_path(), elem.path) if os.path.exists(git_repo_path) == false: Log.info("" + base_display + "\r\t\t\t\t\t\t\t\t\t" + " (not download)") continue Log.verbose("execute : " + cmd) ret = multiprocess.run_command(cmd, cwd=git_repo_path) if ret[0] == 0: Log.info("ret=" + ret[1]) Log.info("err=" + ret[2]) else: Log.info("Execution ERROR")