[Lsb-messages] /var/www/bzr/lsb/devel/devchk r2341: add a hack to build even if parts of devchk failed to build (bug 3710)

Mats Wichmann mats at linuxfoundation.org
Mon Jan 14 20:41:27 UTC 2013


------------------------------------------------------------
revno: 2341
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: devchk
timestamp: Mon 2013-01-14 13:41:27 -0700
message:
  add a hack to build even if parts of devchk failed to build (bug 3710)
added:
  ts/devchk/fixbuild
modified:
  ts/devchk/dodevchk
-------------- next part --------------
=== modified file 'ts/devchk/dodevchk'
--- a/ts/devchk/dodevchk	2013-01-11 16:08:10 +0000
+++ b/ts/devchk/dodevchk	2013-01-14 20:41:27 +0000
@@ -32,15 +32,21 @@
 	# rerun for more targeted errors
 	make -i > ${BLOG} 2>&1
 	printf "*** ERROR: devchk cc build failed, log in ${BLOG}\n"
-	# don't fool people with old output file
-	if [ -f ${RLOG} ]
-	then
-		rm ${RLOG}
-	fi
-else
+	printf "*** attempting partial fixup\n"
+	./fixbuild ${BLOG} > /dev/null
+	make > /dev/null
+fi
+if [ -f hdrchk ]
+then
 	# Execute devchk built with cc and save the output
 	printf "*** Running devchk with cc, output in ${RLOG}\n"
 	./hdrchk > ${RLOG} 2>&1
+else
+	# don't fool people with old output file
+	if [ -f ${RLOG} ]
+	then
+		rm ${RLOG}
+	fi
 fi
 
 
@@ -54,13 +60,19 @@
 then
 	CC=lsbcc CXX=lsbc++ LSB_PRODUCT=desktop make -i > ${BLOG} 2>&1
 	printf "*** ERROR: devchk lsbcc build failed, log in ${BLOG}\n"
-	# don't fool people with old output file
-	if [ -f ${RLOG} ]
-	then
-		rm ${RLOG}
-	fi
-else
+	printf "*** attempting partial fixup\n"
+	CC=lsbcc LSB_PRODUCT=desktop ./fixbuild ${BLOG} > /dev/null
+	CC=lsbcc CXX=lsbc++ LSB_PRODUCT=desktop make > /dev/null
+fi
+if [ -f hdrchk ]
+then
 	# Execute devchk built with lsbcc and save the output
 	printf "*** Running devchk with lsbcc, output in ${RLOG}\n"
 	./hdrchk > ${RLOG} 2>&1
+else
+	# don't fool people with old output file
+	if [ -f ${RLOG} ]
+	then
+		rm ${RLOG}
+	fi
 fi

=== added file 'ts/devchk/fixbuild'
--- a/ts/devchk/fixbuild	1970-01-01 00:00:00 +0000
+++ b/ts/devchk/fixbuild	2013-01-14 20:41:27 +0000
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# band-aid a devchk build that has failed:
+# for objects that didn't build, make a dummy file, build it, and use instead
+
+if [ $# -ne 1 ] 
+then
+    echo "Usage: fixbuild datafile"
+    exit 1
+fi
+grep "\+\+: error:" $1 |
+while read prog err file rest 
+do
+    z=`echo $file | sed -e 's/\.o://'`
+    echo "*** working around ${z}.c problems" >&2
+    cat > ${z}_tmp.c <<END
+/*
+ * $z test - temporary, do not keep
+ */
+#include "hdrchk.h"
+
+#ifdef TET_TEST
+void ${z}()
+{
+#else
+int ${z}()
+{
+#endif
+    Msg("%s.c did not compile cleanly, no results", $z);
+    return 0;
+}
+END
+
+    make ${z}_tmp.o && mv ${z}_tmp.o ${z}.o #&& rm ${z}_tmp.c
+done



More information about the lsb-messages mailing list