Preventing unnecessary package builds for prerelease projects. 44/82644/1
authorJunghyun Kim <jh0822.kim@samsung.com>
Thu, 4 Aug 2016 23:07:40 +0000 (08:07 +0900)
committerJunghyun Kim <jh0822.kim@samsung.com>
Thu, 4 Aug 2016 23:07:40 +0000 (08:07 +0900)
For normal OBS projects, if the result binary for package PKG_A is not changed,
packages depending on PKG_A are not build due to build-compare package.

However, for prerelease projects, if a build is triggers for package PKG_A,
all packages depends on PKG_A are built in prerelease projects.

REASON
To perform build-compare, we need two rpms: oldrpm and newrpm.
However, for prerelease projects, there is no oldrpm since there is no rpms built for the prerelease project.

SOLUTION
Sym-link rpm files from the linked projects.
For example,
ln -s /srv/obs/build/Tizen:Mobile/arm-wayland/armv7l/libnl2/*.rpm /srv/obs/build/home:prerelease:Tizen:Mobile:submit:tizen:20160729.002907/arm-wayland/armv7l/libnl2

To do this, we have to change two things.
1. jenkins-script
To perform this functionality as an option, this functionality is performed only if "CopyLinkedPackages: yes" is in project config.
To do this, we have to change "job_submit.py" in jenkins-script.
"job_submit.py" adds "CopyLinkedPackages: yes" at the end of project config for prerelease projects.

2. bs_sched (OBS)
If "CopyLinkedPackages: yes" is found in project config, make a symbolic link for the package before this package is built.

Change-Id: I54ab531a8b8b73f1b7ea95cf0cd76c596954cc9a
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
job_submit.py

index 8f4dc9d..4eb3df7 100755 (executable)
@@ -306,6 +306,9 @@ def change_release_name(build, project, git_tag):
             else:
                 config = config + '#Add RpmbuildStage option into prjconf\n' + '%s\n' % (rpmbuildstage)
 
+    # Add "CopyLinkedPackages: yes" for prerelease projects.
+    config = config + "CopyLinkedPackages: yes\n";
+
     # set project config
     build.set_project_config(project, config)