Rules for find a specfile 87/118187/1
authorYonghee Han <onstudy@samsung.com>
Thu, 9 Mar 2017 06:04:06 +0000 (15:04 +0900)
committerYonghee Han <onstudy@samsung.com>
Thu, 9 Mar 2017 06:04:10 +0000 (15:04 +0900)
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
job_submitobs.py

index 6f2d53c..3f1c665 100755 (executable)
@@ -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"\
index 3c8cfb1..9c35ab0 100755 (executable)
@@ -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 "\