summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunghyun Kim <jh0822.kim@samsung.com>2016-08-29 19:46:59 +0900
committerJunghyun Kim <jh0822.kim@samsung.com>2016-08-29 19:46:59 +0900
commit0c30cba6cfa94bacd70fb8b94225cd5063df29d8 (patch)
tree1c4efd7c09ddc37944011f2ff557a01c5828e15c
parente9403a6c80ccafe3066558fbbac73e8b64d03278 (diff)
downloadkickstarter-0c30cba6cfa94bacd70fb8b94225cd5063df29d8.tar.gz
kickstarter-0c30cba6cfa94bacd70fb8b94225cd5063df29d8.tar.bz2
kickstarter-0c30cba6cfa94bacd70fb8b94225cd5063df29d8.zip
Use a sorted list of files in kickstarter to avoid unnecessary rebuilds.submit/tizen/20160831.230944accepted/tizen/common/20160901.143249
- PROBLEM We use OBS to build packages in Tizen. There is a mechanism not to rebuild when the result binary is the same. For example, there is a dependency graph: A->B->C. If A is modified, B would be built. If the result RPM of B is not changed, OBS does not trigger a build of C. To effectively use this mechanism, each packages make sure that the result binary should be the same if the input source is the same. There is a reason we found is that the file list given by python(os.walk(), os.listdir()), widely used executable(find), and system call(readdir()) is unordered. In this case, different OBS workers can make different results because of the file list in different order. The same thing happens in kickstarter. tools/kickstarter uses os.listdir() which returns an unordered list of files. - SOLUTION Use sorted(os.listdir()). We can obtain a sorted list of files when using sorted(). Change-Id: I9047ca08f748a938557ced46e350c24c378d439d Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
-rwxr-xr-xtools/kickstarter2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/kickstarter b/tools/kickstarter
index 7acc485..2739c78 100755
--- a/tools/kickstarter
+++ b/tools/kickstarter
@@ -69,7 +69,7 @@ def create_xml(image_meta, external_configs=[]):
if image_meta.has_key('ExternalConfigs') and image_meta['ExternalConfigs']:
external = external + image_meta['ExternalConfigs']
for path in external:
- for f in os.listdir(path):
+ for f in sorted(os.listdir(path)):
if f.endswith('.yaml'):
local = yamlload_safe('%s/%s' %(path, f))
conf = ks.parse(local)