[Skiboot] [PATCH] make_version: Fix check for '.version' file

Vaibhav Jain vaibhav at linux.vnet.ibm.com
Mon Nov 20 20:20:59 AEDT 2017


When building from the non-git tree and with '.version' file missing,
make_version shows this bash error message.

% make
...
cat: .version: No such file or directory
...
error You need to set SKIBOOT_VERSION environment variable

This patch fixes this issue by updating '.version' file check in
make_version script to test if it exists as a regular file and is
of non-zero size.

Fixes: 6a3cad272e4c("Add fallback to .version if not git and no SKIBOOT_VERSION")
Signed-off-by: Vaibhav Jain <vaibhav at linux.vnet.ibm.com>
---
 make_version.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/make_version.sh b/make_version.sh
index 15aed6be..c757e914 100755
--- a/make_version.sh
+++ b/make_version.sh
@@ -50,7 +50,7 @@ else
 	then
 		echo $SKIBOOT_VERSION
 	else
-		if [ ! -z "`cat .version`" ];
+		if [ -f ".version" -a -s ".version" ];
 		then
 			cat .version
 		else
-- 
2.14.3



More information about the Skiboot mailing list