From: Yonghee Han Date: Thu, 9 Mar 2017 06:04:06 +0000 (+0900) Subject: Rules for find a specfile X-Git-Tag: submit/trunk/20190927.012743~513 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9723c0e4f5307171901016340c0cda997db6169d;p=services%2Fjenkins-scripts.git Rules for find a specfile First : must have a single specfile. If we have a multi specfile 1) first: search a basename specfile of git project 2) second: search a first specfile of sorted the multi specfiles. Change-Id: I2591f74f176ae60a9bbbfb359f65d3ff07942c82 --- diff --git a/job_submit.py b/job_submit.py index 6f2d53c..3f1c665 100755 --- a/job_submit.py +++ b/job_submit.py @@ -255,6 +255,9 @@ def find_specfile(prj_dir, packaging_dir, tag, event, tagger, pkg_name=None, deb os.path.basename(event['project'])) print 'Multiple specs with no pkg_name.spec. Try %s' % os.path.basename(spec) if not os.path.isfile(spec): + spec = sorted(specs)[0] + print 'Multiple sorted(specs)[0] %s' % os.path.basename(spec) + if not os.path.isfile(spec): msg = "The tag %s pushed, but packaging directory contains \n"\ "multiply spec files, backend service can not decide \n"\ "which spec file to use. Please use OBS_PACKAGE \n"\ diff --git a/job_submitobs.py b/job_submitobs.py index 3c8cfb1..9c35ab0 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -213,6 +213,9 @@ def find_specfile(prj_dir, packaging_dir, tag, event, tagger, pkg_name=None, deb os.path.basename(event['project'])) print 'Multiple specs with no pkg_name.spec. Try %s' % os.path.basename(spec) if not os.path.isfile(spec): + spec = sorted(specs)[0] + print 'Multiple sorted(specs)[0] %s' % os.path.basename(spec) + if not os.path.isfile(spec): msg = "The tag %s pushed, but packaging directory contains "\ "multiply spec files, backend service can not decide "\ "which spec file to use. Please use OBS_PACKAGE "\