set BUILD variable to NA(Not Available) when there is no .git
authorsunghan <sh924.chang@samsung.com>
Thu, 13 Apr 2017 05:23:56 +0000 (14:23 +0900)
committersunghan <sh924.chang@samsung.com>
Thu, 13 Apr 2017 05:29:46 +0000 (14:29 +0900)
If Tizen RT is tried to build without .git, below error is shown.
We should make Tizen RT can be built regardless of existing of .git.
No .version file found, creating one
GIT version information is not available
chmod: cannot access ‘.version’: No such file or directory
make: *** [/os/.version] Error 1

os/tools/version.sh

index 1cfeb2f..67d7093 100755 (executable)
@@ -135,12 +135,13 @@ if [ -z "${BUILD}" ]; then
        GITINFO=`git log 2>/dev/null | head -1`
        if [ -z "${GITINFO}" ]; then
                echo "GIT version information is not available"
-               exit 3
-       fi
-       BUILD=`echo ${GITINFO} | cut -d' ' -f2`
-       if [ -z "${BUILD}" ]; then
-               echo "GIT build information not found"
-               exit 4
+               BUILD=NA
+       else
+               BUILD=`echo ${GITINFO} | cut -d' ' -f2`
+               if [ -z "${BUILD}" ]; then
+                       echo "GIT build information not found"
+                       BUILD=NA
+               fi
        fi
 fi