[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Check for installer README.html to prevent build failure



Hello,

 lh_binary_includes attempts to sed binary/README.html if the debian
installer is enabled. However, the file is not guaranteed to exist and
if it doesn't it will cause the build to fail. This patch modifies
lh_binary_includes to check to see if the file exists before
attempting to modify it.

Cheers,

-- 
Cody A.W. Somerville
Software Systems Release Engineer
Foundations Team
Custom Engineering Solutions Group
Canonical OEM Services
Phone: +1-781-850-2087
Cell: +1-506-471-8402
Email: cody.somerville@canonical.com
diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes
index e37cc61..0b1e49e 100755
--- a/helpers/lh_binary_includes
+++ b/helpers/lh_binary_includes
@@ -154,9 +158,12 @@ then
 		DEBIAN_TOOLS_HTML=" <P>\n <tt>&nbsp;\n <A href="tools/">/tools/</a>\n </tt>\n\n\n\n\n\n"
 		DEBIAN_TOOLS_TXT="/tools/"
 	fi
-
-	sed -i -e "s|DEBIAN_NAME|${DEBIAN_NAME}|g" -e "s|DEBIAN_DATE|${DEBIAN_DATE}|g" -e "s|DEBIAN_TOOLS|${DEBIAN_TOOLS_HTML}|g" binary/README.html
-	sed -i -e "s|DEBIAN_NAME|${DEBIAN_NAME}|g" -e "s|DEBIAN_DATE|${DEBIAN_DATE}|g" -e "s|DEBIAN_TOOLS|${DEBIAN_TOOLS_TXT}|g" binary/README.txt
+	
+	if [ -f binary/README.html ]
+	then
+		sed -i -e "s|DEBIAN_NAME|${DEBIAN_NAME}|g" -e "s|DEBIAN_DATE|${DEBIAN_DATE}|g" -e "s|DEBIAN_TOOLS|${DEBIAN_TOOLS_HTML}|g" binary/README.html
+		sed -i -e "s|DEBIAN_NAME|${DEBIAN_NAME}|g" -e "s|DEBIAN_DATE|${DEBIAN_DATE}|g" -e "s|DEBIAN_TOOLS|${DEBIAN_TOOLS_TXT}|g" binary/README.txt
+	fi
 fi
 
 # Creating stage file

Reply to: