From 124e53c438eb588b25262aa3e3c8744758cc2518 Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Mon, 14 Mar 2016 15:56:05 +0900 Subject: [PATCH] cleanup src.rpm files on Live repo. we don't used src.rpm files on prerelease project. Change-Id: Idf8f79631fc79473f625cff3cc833084b315b42b --- job_pre_release_obs.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/job_pre_release_obs.py b/job_pre_release_obs.py index 12444cd..215e8cc 100755 --- a/job_pre_release_obs.py +++ b/job_pre_release_obs.py @@ -252,6 +252,23 @@ def project_cleanup(backenddb, build, base_path, base_url, event_dict): print 'Removing the repo: %s' % path shutil.rmtree(path) +def project_src_rpm_cleanup(live_repo_base, project): + """ clean src.rpm files on project + Args: + live_repo_base (str): path to live repo base dir + project (str): project name + """ + + print "==========project_src_rpm_cleanup============" + live_path = os.path.join(live_repo_base, project.replace(':', ':/')) + print "live_path: %s" % (live_path) + + for root, dirs, files in os.walk(live_path): + for filename in files: + if 'src.rpm' in filename: + print 'rm %s' % (os.path.join(root, filename)) + os.remove(os.path.join(root, filename)) + def main(action): """Script entry point. Parameters: @@ -271,6 +288,10 @@ def main(action): project = content.get("project") or content.get("sourceproject") + # cleanup src.rpm files on Live repo + # we don't used src.rpm files on prerelease project. + project_src_rpm_cleanup(live_repo_base,project) + build = BuildService(obs_api, obs_user, obs_passwd) # Init backend database -- 2.7.4