[Libreoffice-commits] .: 3 commits - bin/tinbuild Makefile.in set_soenv.in

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Dec 1 02:15:41 PST 2010


 Makefile.in  |   27 ++++++--
 bin/tinbuild |  183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 set_soenv.in |    3 
 3 files changed, 204 insertions(+), 9 deletions(-)

New commits:
commit 05cd2ecc2cb4a24b4894c73c0b4dee61bc82376c
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Dec 1 11:11:44 2010 +0100

    tinbuild: Update to match the new bootstrap-based build.

diff --git a/bin/tinbuild b/bin/tinbuild
index f752a8f..1e6ec20 100755
--- a/bin/tinbuild
+++ b/bin/tinbuild
@@ -27,8 +27,7 @@ getCommitters ()
 {
 	from_date="$1"
 
-	( git log '--pretty=tformat:%ce' --after="$from_date" ;
-	  bin/g -s log '--pretty=tformat:%ce' --after="$from_date" ) | sort | uniq
+	./g -s log '--pretty=tformat:%ce' --after="$from_date" | sort | uniq
 }
 
 reportError ()
@@ -36,7 +35,8 @@ reportError ()
 	error_kind="$1"
 	shift
 
-	commit=`git log '--pretty=format:%h %cn - %s' -n1`
+	rough_time="$2"
+	shift
 
 	to_mail=
 	if test "$SEND_MAIL" -eq 1; then
@@ -50,12 +50,12 @@ reportError ()
 			       else
 			          to_mail=`getCommitters "$last_success"`
 			       fi
-			       message="last commit: $commit" ;;
+			       message="last succes: $rough_time" ;;
 		esac
 	fi
 
 	echo "$*" 1>&2
-	echo "Last commit: $commit" 1>&2
+	echo "Last success: $rough_time" 1>&2
 	if test -n "$to_mail" ; then
 		subject="Tinderbox failure, $message"
 		(
@@ -72,10 +72,7 @@ Tinderbox info:
 
 Commits since the last success:
 
-  ===== build =====
-`git log '--pretty=tformat:%h  %s' --after="$last_success" | sed 's/^/  /'`
-
-`bin/g log '--pretty=tformat:%h  %s' --after="$last_success" | sed 's/^/  /'`
+`./g log '--pretty=tformat:%h  %s' --after="$last_success" | sed 's/^/  /'`
 
 The error is:
 
@@ -92,8 +89,7 @@ EOF
 
 gitHeads ()
 {
-	git rev-parse --verify HEAD
-	bin/g rev-parse --verify HEAD
+	./g rev-parse --verify HEAD
 }
 
 ## code
@@ -146,54 +142,34 @@ while true; do
 	fi
 	# try to build
 	if ! err_msg=$(./autogen.sh 2>&1); then
-		reportError committer `printf "autogen.sh / configure failed - error is:\n\n$err_msg"`
-	elif ! err_msg=$(./download 2>&1); then
-		reportError committer `printf "download failed - error is:\n\n$err_msg"`
+		reportError committer "$rough_checkout_date" `printf "autogen.sh / configure failed - error is:\n\n$err_msg"`
+	elif ! $NICE make clean >clean.log 2>&1 ; then
+		reportError committer "$rough_checkout_date" `printf "cleaning up failed - error is:\n\n"` "$(tail -n100 clean.log)"
 	elif ! $NICE make >build.log 2>&1 ; then
-		reportError committer `printf "building failed - error is:\n\n"` "$(tail -n100 build.log)"
-	elif ! $NICE make smoketest > smoketest.log 2>&1 ; then
-		reportError committer `printf "smoketest failed - error is:\n\n"` "$(tail -n100 smoketest.log)"
+		reportError committer "$rough_checkout_date" `printf "building failed - error is:\n\n"` "$(tail -n100 build.log)"
+#	elif ! $NICE make smoketest > smoketest.log 2>&1 ; then
+#		reportError committer "$rough_checkout_date" `printf "smoketest failed - error is:\n\n"` "$(tail -n100 smoketest.log)"
 	elif ! $NICE make dev-install >install.log 2>&1 ; then
-		reportError committer `printf "dev installation failed - error is:\n\n"` "$(tail -n100 install.log)"
+		reportError committer "$rough_checkout_date" `printf "dev installation failed - error is:\n\n"` "$(tail -n100 install.log)"
 	else
-		echo build done
-		cp build.log build/
-		cp smoketest.log build/
-		cp install.log build/
+		echo "Build done - checkout from $rough_checkout_date successful."
 		gitHeads > build/git-heads.txt
 
 		prev_success=$last_success
 		last_success=$rough_checkout_date
-		mv build "build-$last_success" ||
-		{
-			msg=
-			test -z "$prev_success" || msg="Leaving 'build-$prev_success' around, exiting now"
-			reportError owner `printf "Cannot move 'build' to 'build-$last_success'\n\n$msg"`
-		}
-
-		if test -n "$prev_success"; then
-			rm -rf "build-$prev_success"
-		fi
 	fi
 
-	if [ -d build ] ; then
-		mv build.log build/
-		mv smoketest.log build/
-		mv install.log build/
-		rm -rf build.failed
-		mv build build.failed
-	fi
+	for I in clean.log build.log smoketest.log install.log ; do
+		mv $I prev-$I 2>/dev/null
+	done
 
 	echo updating repo
 
 	# new commits?
 	while true; do
-		old_head=$(gitHeads) && err_msg=$(git pull -r 2>&1) && err_msg2=$(bin/g pull -r 2>&1) ||
+		old_head=$(gitHeads) && err_msg="$(./g pull -r 2>&1)" ||
 		{
-			msg=
-			test -z "$prev_success" || msg="Leaving 'build-$prev_success' around, exiting now"
-
-			reportError owner `printf "git repo broken - error is:\n\n$err_msg\n$err_msg2\n$msg"`
+			reportError owner "$rough_checkout_date" `printf "git repo broken - error is:\n\n$err_msg"`
 		}
 		new_head=$(gitHeads)
 		
commit e8e2d82894c059ad16c805acdf3182e0bc57d04d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Dec 1 10:47:46 2010 +0100

    Makefile.in: Introduce the 'install' target.
    
    You can use it like 'make install', or 'make install prefix=/path', to override
    what has been set by ./configure.

diff --git a/Makefile.in b/Makefile.in
index 8b28749..8eb3d31 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,19 +3,18 @@
 
 SHELL=/bin/sh
 
-all:
+all: dmake/dmake at EXEEXT@
 	@. ./*[Ee]nv.[Ss]et.sh && \
-        ./bootstrap && \
         cd instsetoo_native && \
         ../solenv/bin/build.pl -P at BUILD_NCPUS@ --all -- -P at BUILD_MAX_JOBS@
 
-distclean:
+install:
 	@. ./*[Ee]nv.[Ss]et.sh && \
-        dmake distclean
-
-clean:
-	@. ./*[Ee]nv.[Ss]et.sh && \
-        dmake clean
+	echo "Installing in $${prefix:- at prefix@}..."
+	ooinstall "$${prefix:- at prefix@}" && \
+	echo "" && \
+	echo "Installation finished, you can now execute:" && \
+	echo "$${prefix:- at prefix@}/program/soffice"
 
 dev-install:
 	@. ./*[Ee]nv.[Ss]et.sh && \
@@ -23,3 +22,15 @@ dev-install:
         echo "" && \
         echo "Developer installation finished, you can now execute:" && \
         echo "@abs_builddir@/install/program/soffice"
+
+distclean: dmake/dmake at EXEEXT@
+	@. ./*[Ee]nv.[Ss]et.sh && \
+        dmake distclean
+
+clean: dmake/dmake at EXEEXT@
+	@. ./*[Ee]nv.[Ss]et.sh && \
+        dmake clean
+
+dmake/dmake at EXEEXT@:
+	@. ./*[Ee]nv.[Ss]et.sh && \
+        ./bootstrap
diff --git a/set_soenv.in b/set_soenv.in
index ee227a3..c7d2729 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2160,7 +2160,8 @@ print "*********************************************************".
       "******************* $newline";
 
 print "To build, issue:\nmake\n\n";
-print "For the developer installation, issue:\nmake dev-install\n\n";
+print "To install when the build is finished, issue:\nmake install\n\n";
+print "If you want to develop LibreOffice, you might prefer:\nmake dev-install\n\n";
 
 $bootfile = "bootstrap";
 open( OUT, ">$bootfile" ) ||
commit c869898b1d064c548760ce1bca9affb56f223888
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Dec 1 08:55:47 2010 +0100

    tinbuild: Move it from the build repo to bootstrap.

diff --git a/bin/tinbuild b/bin/tinbuild
new file mode 100755
index 0000000..f752a8f
--- /dev/null
+++ b/bin/tinbuild
@@ -0,0 +1,207 @@
+#!/bin/sh
+
+export LC_ALL="C"
+
+## default config
+PAUSE_SECONDS=$((15*60))
+HTML_OUTPUT=0
+SEND_MAIL=0
+NICE=
+OWNER=
+MACHINE=`uname`
+
+## subroutines
+usage ()
+{
+	echo "Usage: $0 [options]"
+	echo "Options:"
+	echo "-w <N>     specify timeout in secs between subsequent pull requests"
+	echo "-i         when given: run with ionice -c3, can be combined with -n"
+	echo "-l         when given: write html build log"
+	echo "-m <owner> when given: mail errors to the committer, general errors to the <owner>"
+	echo "-n         when given: run with nice, can be combined with -i"
+	echo "-h         this help"
+}
+
+getCommitters ()
+{
+	from_date="$1"
+
+	( git log '--pretty=tformat:%ce' --after="$from_date" ;
+	  bin/g -s log '--pretty=tformat:%ce' --after="$from_date" ) | sort | uniq
+}
+
+reportError ()
+{
+	error_kind="$1"
+	shift
+
+	commit=`git log '--pretty=format:%h %cn - %s' -n1`
+
+	to_mail=
+	if test "$SEND_MAIL" -eq 1; then
+		case "$error_kind" in
+			owner) to_mail="$OWNER"
+			       message="box broken" ;;
+			*)     if test -z "$last_success" ; then
+			          # we need at least one successful build to
+				  # be reliable
+			          to_mail="$OWNER"
+			       else
+			          to_mail=`getCommitters "$last_success"`
+			       fi
+			       message="last commit: $commit" ;;
+		esac
+	fi
+
+	echo "$*" 1>&2
+	echo "Last commit: $commit" 1>&2
+	if test -n "$to_mail" ; then
+		subject="Tinderbox failure, $message"
+		(
+			cat <<EOF
+Hi folks,
+
+One of you broke the build of LibreOffice master with your commit :-(
+Please commit and push a fix ASAP!
+
+Tinderbox info:
+
+  `uname -a`
+`grep '\$ \.\/configure' config.log`
+
+Commits since the last success:
+
+  ===== build =====
+`git log '--pretty=tformat:%h  %s' --after="$last_success" | sed 's/^/  /'`
+
+`bin/g log '--pretty=tformat:%h  %s' --after="$last_success" | sed 's/^/  /'`
+
+The error is:
+
+$*
+EOF
+		) | mail -r "$OWNER" -s "$subject" $to_mail
+	else
+		echo "$*" 1>&2
+		if test "$error_kind" = "owner" ; then
+			exit 1
+		fi
+	fi
+}
+
+gitHeads ()
+{
+	git rev-parse --verify HEAD
+	bin/g rev-parse --verify HEAD
+}
+
+## code
+while getopts hilm:nw: opt ; do
+	case "$opt" in
+		w) PAUSE_SECONDS="$OPTARG" ;;
+		i) NICE="$NICE ionice -c3" ;;
+		l) HTML_OUTPUT=1 ;;
+		m) SEND_MAIL=1 ; OWNER="$OPTARG" ;;
+		n) NICE="$NICE nice" ;;
+		h) usage; exit ;;
+		?) usage; exit ;;
+	esac
+done
+
+# sanity checks
+which git > /dev/null 2>&1 || {
+    echo "You need git for this!"
+	exit 1
+}
+
+if test "$SEND_MAIL" -eq 1 ; then
+	if test -z "$OWNER" ; then
+		echo "Owner not set."
+		exit 1
+	fi
+	if test "$OWNER" = `echo ${OWNER} | sed 's/\@/_/g'` ; then
+		echo "The owner address '$OWNER' does not look like an email address."
+		exit 1
+	fi
+fi
+
+# for build.pl
+test $HTML_OUTPUT -eq 1 && export BUILD_HTML_OUTPUT=true
+
+# main
+prev_success=""
+last_success=""
+while true; do
+	err_msg=""
+
+	# cleanup
+	$NICE make clean-local
+
+	# FIXME we need a more exact way to determine a 'good' date; this is not accurate
+	if [ "X$MACHINE" == "XDarwin" ] ; then
+	    rough_checkout_date="`date -u '+%Y-%m-%d %H:%M:%S'`"
+	else
+	    rough_checkout_date="`date --utc --rfc-3339=seconds`"
+	fi
+	# try to build
+	if ! err_msg=$(./autogen.sh 2>&1); then
+		reportError committer `printf "autogen.sh / configure failed - error is:\n\n$err_msg"`
+	elif ! err_msg=$(./download 2>&1); then
+		reportError committer `printf "download failed - error is:\n\n$err_msg"`
+	elif ! $NICE make >build.log 2>&1 ; then
+		reportError committer `printf "building failed - error is:\n\n"` "$(tail -n100 build.log)"
+	elif ! $NICE make smoketest > smoketest.log 2>&1 ; then
+		reportError committer `printf "smoketest failed - error is:\n\n"` "$(tail -n100 smoketest.log)"
+	elif ! $NICE make dev-install >install.log 2>&1 ; then
+		reportError committer `printf "dev installation failed - error is:\n\n"` "$(tail -n100 install.log)"
+	else
+		echo build done
+		cp build.log build/
+		cp smoketest.log build/
+		cp install.log build/
+		gitHeads > build/git-heads.txt
+
+		prev_success=$last_success
+		last_success=$rough_checkout_date
+		mv build "build-$last_success" ||
+		{
+			msg=
+			test -z "$prev_success" || msg="Leaving 'build-$prev_success' around, exiting now"
+			reportError owner `printf "Cannot move 'build' to 'build-$last_success'\n\n$msg"`
+		}
+
+		if test -n "$prev_success"; then
+			rm -rf "build-$prev_success"
+		fi
+	fi
+
+	if [ -d build ] ; then
+		mv build.log build/
+		mv smoketest.log build/
+		mv install.log build/
+		rm -rf build.failed
+		mv build build.failed
+	fi
+
+	echo updating repo
+
+	# new commits?
+	while true; do
+		old_head=$(gitHeads) && err_msg=$(git pull -r 2>&1) && err_msg2=$(bin/g pull -r 2>&1) ||
+		{
+			msg=
+			test -z "$prev_success" || msg="Leaving 'build-$prev_success' around, exiting now"
+
+			reportError owner `printf "git repo broken - error is:\n\n$err_msg\n$err_msg2\n$msg"`
+		}
+		new_head=$(gitHeads)
+		
+		if test "$old_head" != "$new_head"; then
+			break
+		fi
+
+		echo "Waiting $PAUSE_SECONDS seconds."
+		sleep $PAUSE_SECONDS
+	done
+done


More information about the Libreoffice-commits mailing list