From 0443ba2f060a28cd1184a4393b261570af99277f Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Wed, 31 Mar 2021 11:03:08 +0800 Subject: [PATCH] add pararm for updating all --- core/update_obs_repos.py | 7 +++++-- openeuler_obs.py | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/update_obs_repos.py b/core/update_obs_repos.py index b40d11f..3c376e7 100755 --- a/core/update_obs_repos.py +++ b/core/update_obs_repos.py @@ -197,7 +197,10 @@ class RPMManager(object): old_rpms_list = None new_rpms_list = self.get_new_rpms_by_pkg(pkg) new_rpms_list.sort() - if old_rpms_list != new_rpms_list and new_rpms_list: + if self.kwargs["all"] and new_rpms_list: + self.copy_new_rpms_to_repo(pkg, new_rpms_list) + self.backup_old_rpms_by_pkg(pkg, old_rpms_list) + elif old_rpms_list != new_rpms_list and new_rpms_list: try: self.copy_new_rpms_to_repo(pkg, new_rpms_list) self.backup_old_rpms_by_pkg(pkg, old_rpms_list) @@ -275,7 +278,7 @@ if __name__ == "__main__": "repo_server_port": "22233", "gitee_user": "xxxxxxxxx", "gitee_pwd": "xxxxxxxxx", - "pkglist": ["zip", "zsh"] + "pkglist": ["zip", "zsh"], } test = RPMManager(**kw) test.update_pkgs() diff --git a/openeuler_obs.py b/openeuler_obs.py index bcb7e6c..4053ca1 100644 --- a/openeuler_obs.py +++ b/openeuler_obs.py @@ -85,6 +85,9 @@ par.add_argument("-cps", "--check_pkg_service", default=False, help="check if there are any problems with the content of the _service file in the rpm package", required=False) par.add_argument("-prid", "--pr_id", default=False, help="use the pr_id to get this pullrequest", required=False) + +par.add_argument("-a", "--_all", default=False, help="update all obs repo rpms", required=False) + args = par.parse_args() #apply kw = { @@ -116,6 +119,8 @@ kw = { "check_codes": args.check_codes, "check_pkg_service": args.check_pkg_service, "pr_id": args.pr_id, + + "all": args._all } run = Runner(**kw) -- Gitee