Use the OBS_package name on Staging OBS project
authorYonghee Han <onstudy@samsung.com>
Tue, 14 Feb 2017 08:47:54 +0000 (17:47 +0900)
committerSoonKyu Park <sk7.park@samsung.com>
Thu, 23 Feb 2017 08:35:19 +0000 (17:35 +0900)
If a obs package has one spec file then there is use of OBS_package name in git-obs-mapping.xml
ex)
  To use : <project OBS_package="pkgmgr-server" name="platform/core/appfw/pkgmgr-server"/>

If packaging directory contains multiply specfiles, use attribution OBS_package to specify the specfile name

Change-Id: I95ec8c134d8e6c02f125f9edfdb157d2837977fe

job_submitobs.py

index 144193c..a915990 100755 (executable)
@@ -453,9 +453,15 @@ def main():
                 url = 'ssh://%s:%s' % (os.getenv('GERRIT_HOSTNAME'),
                                     os.getenv('GERRIT_SSHPORT'))
                 gerrit_project = os.getenv('GERRIT_PROJECT')
+                # get package name from xml files.
+                if obs_pkg:
+                   package = obs_pkg
+                else:
+                   #get package name from spec file name.
+                   package = spec.name
                 # create local package
-                print '\nCheckout %s/%s to local' % (obs_stg_prj, spec.name)
-                localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, spec.name, \
+                print '\nCheckout %s/%s to local' % (obs_stg_prj, package)
+                localpkg = obspkg.ObsPackage(tmpdir, obs_stg_prj, package, \
                         apiurl, apiuser, apipasswd)
                 commit_msg = 'Submitter: %s <%s>\nComments: %s\nGit project: '\
                         '%s\nTag: %s\nCommit: %s %s' % (tagger['author'], \
@@ -464,7 +470,7 @@ def main():
                 # upload _service to obs
                 try:
                     upload_obs_service(url, gerrit_project, tag,
-                            event['newrev'], obs_stg_prj, build, spec.name)
+                            event['newrev'], obs_stg_prj, build, package)
                 except UploadError, err:
                     print err
                     return 1