Store build_date in .tizen.build-id section to avoid unnecessary rebuilds 54/86154/1 accepted/tizen/common/20160831.162039 accepted/tizen/ivi/20160901.065252 accepted/tizen/mobile/20160901.065030 accepted/tizen/tv/20160901.065129 accepted/tizen/wearable/20160901.065207 submit/tizen/20160831.052250
authorJunghyun Kim <jh0822.kim@samsung.com>
Tue, 30 Aug 2016 07:21:19 +0000 (16:21 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Wed, 31 Aug 2016 00:49:27 +0000 (09:49 +0900)
- PROBLEM
We use OBS to build packages in Tizen.
There is a mechanism not to rebuild if 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.

This package uses __DATE__ and __TIME__ which make the result binary
is different everytime it is built.
To efficiently utilize OBS build mechanism and to modify the package
as little as possible, I propose to store this macro in .tizen.build-id
section. OBS build-compare tool does not check *.build-id section
in the binary.

Change-Id: Ic3af17799ab4fe5f06cb85e5a261033d87391bac
Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
util/gif2rgb.c
util/gifbg.c
util/gifbuild.c
util/gifclrmp.c
util/gifcolor.c
util/gifecho.c
util/giffix.c
util/gifhisto.c
util/gifinto.c
util/giftext.c
util/gifwedge.c

index 1489435..c71d4fa 100644 (file)
@@ -36,8 +36,9 @@ with our utilities mainly interesting as test tools.
 
 #define PROGRAM_NAME   "gif2rgb"
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index e647269..eb15a50 100644 (file)
@@ -39,8 +39,9 @@ gifbg - generate a test-pattern GIF
 
 #define DEFAULT_DIR    "T"                        /* TOP (North) direction. */
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index e58ea15..70fea58 100644 (file)
@@ -16,8 +16,9 @@ gifbuild - dump GIF data in a textual format, or undump it to a GIF
 
 #define PROGRAM_NAME   "gifbuild"
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Eric Raymond,   "
index c44b95d..7d35d7c 100644 (file)
@@ -17,8 +17,9 @@ gifclrmap - extract colormaps from GIF images
 
 #define PROGRAM_NAME   "gifclrmp"
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index a97ed6b..1700b07 100644 (file)
@@ -18,8 +18,9 @@ gifcolor - generate color test-pattern GIFs
 #define LINE_LEN               40
 #define IMAGEWIDTH             LINE_LEN*GIF_FONT_WIDTH
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index d868c3f..9b748f8 100644 (file)
@@ -25,8 +25,9 @@ gifecho - generate a GIF from ASCII text
 #define DEFAULT_COLOR_GREEN    255
 #define DEFAULT_COLOR_BLUE     255
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index 370a110..907c3ef 100644 (file)
@@ -15,8 +15,9 @@ giffix - attempt to fix a truncated GIF
 
 #define PROGRAM_NAME   "giffix"
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index 2e6bd7b..e8e695f 100644 (file)
@@ -19,8 +19,9 @@ gifhisto - make a color histogram from image color frequencies
 #define DEFAULT_HISTO_HEIGHT   256
 #define HISTO_BITS_PER_PIXEL   2       /* Size of bitmap for histogram GIF. */
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index 31d3548..306c489 100644 (file)
@@ -27,8 +27,9 @@ gifinto - save GIF on stdin to file if size over set threshold
 #define        DEFAULT_OUT_NAME        "GifInto.Gif"
 #define DEFAULT_TMP_NAME       "TempInto.XXXXXX"
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index e010f40..864f2d5 100644 (file)
@@ -21,8 +21,9 @@ giftext - dump GIF pixels and metadata as text
 
 #define MAKE_PRINTABLE(c)  (isprint(c) ? (c) : ' ')
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "
index a8f587f..d8be2d9 100644 (file)
@@ -20,8 +20,9 @@ gifwedge - create a GIF test pattern
 
 #define DEFAULT_NUM_LEVELS     16     /* Number of colors to gen the image. */
 
+__attribute__((__section__(".tizen.build-id")))
 static char
-    *VersionStr =
+    VersionStr[] =
        PROGRAM_NAME
        VERSION_COOKIE
        "       Gershon Elber,  "