From 9723c0e4f5307171901016340c0cda997db6169d Mon Sep 17 00:00:00 2001 From: Yonghee Han Date: Thu, 9 Mar 2017 15:04:06 +0900 Subject: [PATCH] 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 --- job_submit.py | 3 +++ job_submitobs.py | 3 +++ 2 files changed, 6 insertions(+) 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 "\ -- 2.7.4