[Libreoffice-commits] .: 24 commits - autogen.sh bin/create_bootstrap_links bin/git-new-workdir bin/git-ps1 bin/mkworkdir bin/repo-list bootstrap.1 configure.in download fetch_tarballs.sh g git-hooks/commit-msg git-hooks/post-merge git-hooks/pre-commit .gitignore m4/mac post_download.in set_soenv.in

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Tue Nov 30 18:26:51 PST 2010


 .gitignore                 |  230 ++++++++++++++++++++++++++++++++++++-
 autogen.sh                 |   21 ++-
 bin/create_bootstrap_links |   15 ++
 bin/git-new-workdir        |   82 +++++++++++++
 bin/git-ps1                |   52 ++++++++
 bin/mkworkdir              |  103 ++++++++++++++++
 bin/repo-list              |    1 
 bootstrap.1                |    2 
 configure.in               |  101 ++--------------
 download                   |  173 ++++++++++++++++++++++++++++
 fetch_tarballs.sh          |  165 --------------------------
 g                          |  278 +++++++++++++++++++++++++++++++++++++++++++++
 git-hooks/commit-msg       |   62 ++++++++++
 git-hooks/post-merge       |   12 +
 git-hooks/pre-commit       |  187 ++++++++++++++++++++++++++++++
 m4/mac/pkg.m4              |  154 ++++++++++++++++++++++++
 post_download.in           |  134 +++++++++++++++++++++
 set_soenv.in               |    6 
 18 files changed, 1514 insertions(+), 264 deletions(-)

New commits:
commit 163cffc3a3dd6542a72d8f434cbb0f4dc49d466d
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Nov 29 13:51:34 2010 +0100

    configure.in: Move the post_download creation up a bit.
    
    So that the message about what to do now (issue make and make dev-install) is
    the last thing the user sees.

diff --git a/configure.in b/configure.in
index 3f1839d..3b90114 100644
--- a/configure.in
+++ b/configure.in
@@ -8056,6 +8056,14 @@ AC_SUBST(BUILD_TYPE)
 # make sure config.guess is +x; we execute config.guess, so it has to be so;
 chmod +x ./config.guess
 
+dnl Setting up the post_download check script
+dnl Using autoconf here, so that the migration from the previous state
+dnl (checks for the additional Windows downloads were directly in
+dnl configure.in) is as easy as possible
+echo "setting up the post_download check script"
+autoconf post_download.in > post_download
+chmod +x post_download
+
 # Generate a configuration timestamp we can use for deps
 if test -f set_soenv; then
    mv -f set_soenv set_soenv.last
@@ -8096,8 +8104,3 @@ else
    fi
    echo
 fi
-
-dnl Setting up the post_download check script
-echo "setting up the post_download check script"
-autoconf post_download.in > post_download
-chmod +x post_download
commit 8cf2a26f230d33781b255bd26ae221495784c4cc
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Nov 29 11:05:10 2010 +0100

    download: Fix minor typos to make it work on Windows.

diff --git a/download b/download
index 9ab936f..a17a1e4 100755
--- a/download
+++ b/download
@@ -159,10 +159,6 @@ done
 rm $TARFILE_LOCATION/tmp/*-*
 cd $start_dir
 
-if [ -e post_download ] ; then
-    ./post_download
-fi
-
 if [ ! -z "$failed" ]; then
     echo
     echo ERROR: failed on:
@@ -172,3 +168,6 @@ if [ ! -z "$failed" ]; then
     exit 1
 fi
 
+[ -x "post_download" ] || { echo "'post_download' script not found, run ./autogen.sh." ; exit 1 ; }
+
+./post_download || exit 1
diff --git a/post_download.in b/post_download.in
index 674d6b1..b17f395 100644
--- a/post_download.in
+++ b/post_download.in
@@ -10,8 +10,7 @@ echo "********************************************************************"
 dnl ===================================================================
 dnl The following is a list of supported systems.
 dnl ===================================================================
-#defaults unless the os test overrides this:
-
+AC_CANONICAL_SYSTEM
 case "$build_os" in
     solaris*)
         _os=SunOS
commit d65fe6ede7083d80441b9d726f5f58a9a99d61c0
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Nov 28 23:07:09 2010 -0600

    make autogen ability to remember the last command line work on MacOS
    
    futhermore: the conf.log extraction method is no reliable. autoconf
    has changed and newer version don't put it there.
    furthermore, because of the post_download generation,
    the conf.log get crowded by a second autoconf...

diff --git a/autogen.sh b/autogen.sh
index c2572eb..27ea62a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,14 +9,19 @@ if test "z$1" = "z--clean"; then
     exit 1;
 fi
 
-requote_args ()
+function requote
 {
-    sed -r -e 's/.*configure //' -e 's/(["'"'"'])/\\\1/g' -e 's/=(([^"'"'"'-]|-[^-]| )*)( |$)/="\1" /g'
+        local q=\'
+        set -- "${@//\'/$q\'$q}"        # quote inner instances of '
+        set -- "${@/#/$q}"              # add ' to start of each param
+        set -- "${@/%/$q}"              # add ' to end of each param
+        echo "$*"
 }
 
+
 old_args=""
-if test $# -eq 0 && test -f config.log; then
-    old_args=`grep '\$ ./configure' config.log | requote_args`
+if test $# -eq 0 && test -f autogen.lastrun; then
+    old_args=$(cat autogen.lastrun)
     echo "re-using arguments from last configure: $old_args";
 fi
 
@@ -37,6 +42,7 @@ if test "x$NOCONFIGURE" = "x"; then
     if test -n "$old_args" ; then
         eval `echo ./configure $old_args`
     else
+        echo "$(requote "$@")" > autogen.lastrun
         ./configure "$@"
     fi
 else
commit 89ca464edcce7461502e9cf36fb70506bf85901f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Nov 28 17:45:45 2010 -0600

    fix issues when building with the build-repo

diff --git a/bootstrap.1 b/bootstrap.1
index 156f562..304f41c 100644
--- a/bootstrap.1
+++ b/bootstrap.1
@@ -80,5 +80,5 @@ chmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl"
 
 # fetch or update external tarballs
 if [ "$DO_FETCH_TARBALLS" = "yes" ]; then
-	$SRC_ROOT/fetch_tarballs.sh $SRC_ROOT/ooo.lst
+	$SRC_ROOT/download $SRC_ROOT/ooo.lst
 fi
diff --git a/download b/download
index 5482ac9..9ab936f 100755
--- a/download
+++ b/download
@@ -26,7 +26,10 @@
 #
 #*************************************************************************
 
-if [ ! -d clone ] ; then
+# we want to clone if we are in the bootstrap git repo and clone does not exist yet
+# we need to test for a .git in order not to clone after rsync if we are called in
+# the inner autogen of the buid-repo based build
+if [ ! -d clone -a -d .git ] ; then
     ./g clone
 fi
 if [ -z "$TARFILE_LOCATION" ]; then
commit 211a440abb3fd5eb35319b3272501ba020c92de4
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 14:17:58 2010 -0600

    adjust .gitignore

diff --git a/.gitignore b/.gitignore
index e232a50..c054c2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
 /*/unxmac??
 /*/unxmac??.pro
 /solver/*
+/instsetoo_native/*
 
 # autoconf generated stuff
 /aclocal.m4
@@ -44,6 +45,7 @@
 MathMLDTD
 Mesa
 UnoControls
+agg
 accessibility
 afms
 animations
commit b4c840c862cc242a95426f7bfa0a55e47152222c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 14:13:18 2010 -0600

    add a script to generate the links in bootstrap

diff --git a/bin/create_bootstrap_links b/bin/create_bootstrap_links
new file mode 100755
index 0000000..a42f7b8
--- /dev/null
+++ b/bin/create_bootstrap_links
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+BIN_DIR=$(dirname $0)
+REPOS=$(cat ${BIN_DIR?}/repo-list)
+cd ${BIN_DIR?}/..
+BOOTSTRAP_DIR=$(pwd)
+
+for repo in $REPOS ; do
+    for link in $(ls clone/${repo}) ; do
+        if [ ! -e "$link" ] ; then
+            echo "Creating missing link $link"
+            ln -s "clone/${repo}/$link" "$link"
+        fi
+    done
+done
commit dbb47cc3ff5799f2da403f93a4bbc6553ec1bda4
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 09:22:05 2010 -0600

    exile some download-dependent configure test into a post_download step
    
    on windows, the configure check that some dll/exe are present.
    these are in fact automatically downloaded by the ./download script.
    but that script is run _after_ ./configure.
    So the tests are postponed and run in a post_download script that is
    invoked at the end of the download script.

diff --git a/.gitignore b/.gitignore
index 2f876cb..e232a50 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@
 /makefile.mk
 /set_soenv
 /visibility.cxx
+/post_download
 
 # misc
 /set_soenv.last
diff --git a/configure.in b/configure.in
index c63df79..3f1839d 100644
--- a/configure.in
+++ b/configure.in
@@ -3402,6 +3402,10 @@ if test "$_os" = "WINNT"; then
       with_jdk_home=`cygpath -u "$with_jdk_home"`
    fi
 fi
+if test $_os = "WINNT"; then
+   WITH_VC_REDIST="TRUE"
+fi
+AC_SUBST(WITH_VC_REDIST)
 
 dnl ===================================================================
 dnl Checks for java
@@ -6261,91 +6265,6 @@ fi
 AC_SUBST(ZIP_HOME)
 
 dnl ===================================================================
-dnl Windows builds need dbghelp.dll in external/dbghelp/
-dnl ===================================================================
-if test "$_os" = "WINNT"; then
-   AC_MSG_CHECKING([for dbghelp.dll])
-   if test -x ./external/dbghelp/dbghelp.dll; then
-      AC_MSG_RESULT([found])
-   else
-      AC_MSG_ERROR([dbghelp.dll is missing in external/dbghelp/.
-Get it from the Microsoft site and put it into external/dbghelp.
-(Note: Microsoft seems to enjoy changing the exact location of this file. You
-may have to search Microsoft's website.) Last time it was seen at:
-<http://www.microsoft.com/downloads/release.asp?releaseid=30682>.])
-   fi
-fi
-
-dnl ===================================================================
-dnl Windows builds - use oowintool to copy CRT dlls and manifest
-dnl ===================================================================
-if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
-       if ./oowintool --msvc-copy-dlls ./external/msvcp ; then
-          :
-       else
-          AC_MSG_ERROR([oowintool failed to copy CRT])
-       fi
-fi
-
-dnl ===================================================================
-dnl Windows builds need gdiplus.dll in external/gdiplus/
-dnl ===================================================================
-if test "$_os" = "WINNT"; then
-   AC_MSG_CHECKING([for gdiplus.dll])
-   if test -x ./external/gdiplus/gdiplus.dll; then
-      AC_MSG_RESULT([found])
-   else
-      AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/.
-Get it from the Microsoft site and put it into external/gdiplus.
-You may have to search Microsoft's website. Last time it was seen at:
-<http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en>.])
-   fi
-fi
-
-dnl ===================================================================
-dnl Windows builds need vcredist_x86.exe and vcredist_x64.exe in external/vcredist/
-dnl ===================================================================
-if test "$_os" = "WINNT"; then
-   AC_MSG_CHECKING([for vcredist_x86.exe])
-   if test -e ./external/vcredist/vcredist_x86.exe; then
-      AC_MSG_RESULT([found])
-   else
-      AC_MSG_ERROR([vcredist_x86.exe is missing in external/vcredist/.
-Get the version corresponding to your Visual Studio from the Microsoft site
-and put it into external/vcredist.])
-   fi
-   AC_MSG_CHECKING([for vcredist_x64.exe])
-   if test -e ./external/vcredist/vcredist_x64.exe; then
-      AC_MSG_RESULT([found])
-   else
-      AC_MSG_ERROR([vcredist_x64.exe is missing in external/vcredist/.
-Get the version corresponding to your Visual Studio from the Microsoft site
-and put it into external/vcredist.])
-   fi
-   WITH_VC_REDIST="TRUE"
-fi
-AC_SUBST(WITH_VC_REDIST)
-
-dnl ===================================================================
-dnl Windows builds - attempt to auto-copy required instmsiX.exe into external/
-dnl ===================================================================
-if test "$_os" = "WINNT"; then
-       ./oowintool --msvc-copy-instmsi ./external/msi
-fi
-
-dnl ===================================================================
-dnl Windows builds with MSVS 2008/2010 need instmsiw.exe in external/msi
-dnl ===================================================================
-if test "$_os" = "WINNT"; then
-   AC_MSG_CHECKING([for instmsiw.exe])
-   if test -f ./external/msi/instmsiw.exe; then
-      AC_MSG_RESULT([found])
-   else
-      AC_MSG_ERROR([instmsiw.exe is missing in external/msi.])
-   fi
-fi
-
-dnl ===================================================================
 dnl Test which vclplugs have to be built.
 dnl ===================================================================
 AC_MSG_CHECKING([which VCLplugs shall be built])
@@ -8177,3 +8096,8 @@ else
    fi
    echo
 fi
+
+dnl Setting up the post_download check script
+echo "setting up the post_download check script"
+autoconf post_download.in > post_download
+chmod +x post_download
diff --git a/download b/download
index f238027..5482ac9 100755
--- a/download
+++ b/download
@@ -30,7 +30,7 @@ if [ ! -d clone ] ; then
     ./g clone
 fi
 if [ -z "$TARFILE_LOCATION" ]; then
-    . ./*.Set.sh
+    . ./*[Ee]nv.[Ss]et.sh
 fi
 
 if [ ! -d "$TARFILE_LOCATION" ]; then
@@ -156,6 +156,10 @@ done
 rm $TARFILE_LOCATION/tmp/*-*
 cd $start_dir
 
+if [ -e post_download ] ; then
+    ./post_download
+fi
+
 if [ ! -z "$failed" ]; then
     echo
     echo ERROR: failed on:
diff --git a/post_download.in b/post_download.in
new file mode 100644
index 0000000..674d6b1
--- /dev/null
+++ b/post_download.in
@@ -0,0 +1,135 @@
+AC_INIT([LibreOffice], [3.3],,, [http://documentfoundation.org/])
+AC_PREREQ(2.50)
+
+echo "********************************************************************"
+echo "*"
+echo "*   Running the post download checks."
+echo "*"
+echo "********************************************************************"
+
+dnl ===================================================================
+dnl The following is a list of supported systems.
+dnl ===================================================================
+#defaults unless the os test overrides this:
+
+case "$build_os" in
+    solaris*)
+        _os=SunOS
+        ;;
+    linux-gnu*|k*bsd*-gnu*)
+        _os=Linux
+        ;;
+    gnu)
+        _os=GNU
+        ;;
+    cygwin*) # Windows
+        _os=WINNT
+        ;;
+    darwin*) # Mac OS X
+        _os=Darwin
+        ;;
+    os2*)
+        _os=OS2
+        ;;
+    freebsd*)
+        _os=FreeBSD
+        ;;
+    osf)
+        _os=OSF1
+        ;;
+    *netbsd*)
+        _os=NetBSD
+        ;;
+    aix*)
+        _os=AIX
+        ;;
+    openbsd*)
+        _os=OpenBSD
+        ;;
+   *)
+   AC_MSG_ERROR([$_os operating system is not suitable to build LibreOffice!])
+   ;;
+esac
+
+dnl ===================================================================
+dnl Windows builds need dbghelp.dll in external/dbghelp/
+dnl ===================================================================
+if test "$_os" = "WINNT"; then
+   AC_MSG_CHECKING([for dbghelp.dll])
+   if test -x ./external/dbghelp/dbghelp.dll; then
+      AC_MSG_RESULT([found])
+   else
+      AC_MSG_ERROR([dbghelp.dll is missing in external/dbghelp/.
+Get it from the Microsoft site and put it into external/dbghelp.
+(Note: Microsoft seems to enjoy changing the exact location of this file. You
+may have to search Microsoft's website.) Last time it was seen at:
+<http://www.microsoft.com/downloads/release.asp?releaseid=30682>.])
+   fi
+fi
+
+dnl ===================================================================
+dnl Windows builds - use oowintool to copy CRT dlls and manifest
+dnl ===================================================================
+if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then
+   if ./oowintool --msvc-copy-dlls ./external/msvcp ; then
+       :
+    else
+       AC_MSG_ERROR([oowintool failed to copy CRT])
+    fi
+fi
+
+dnl ===================================================================
+dnl Windows builds need gdiplus.dll in external/gdiplus/
+dnl ===================================================================
+if test "$_os" = "WINNT"; then
+   AC_MSG_CHECKING([for gdiplus.dll])
+   if test -x ./external/gdiplus/gdiplus.dll; then
+      AC_MSG_RESULT([found])
+   else
+      AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/.
+Get it from the Microsoft site and put it into external/gdiplus.
+You may have to search Microsoft's website. Last time it was seen at:
+<http://www.microsoft.com/downloads/details.aspx?familyid=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en>.])
+   fi
+fi
+
+dnl ===================================================================
+dnl Windows builds need vcredist_x86.exe and vcredist_x64.exe in external/vcredist/
+dnl ===================================================================
+if test "$_os" = "WINNT"; then
+   AC_MSG_CHECKING([for vcredist_x86.exe])
+   if test -e ./external/vcredist/vcredist_x86.exe; then
+      AC_MSG_RESULT([found])
+   else
+      AC_MSG_ERROR([vcredist_x86.exe is missing in external/vcredist/.
+Get the version corresponding to your Visual Studio from the Microsoft site
+and put it into external/vcredist.])
+   fi
+   AC_MSG_CHECKING([for vcredist_x64.exe])
+   if test -e ./external/vcredist/vcredist_x64.exe; then
+      AC_MSG_RESULT([found])
+   else
+      AC_MSG_ERROR([vcredist_x64.exe is missing in external/vcredist/.
+Get the version corresponding to your Visual Studio from the Microsoft site
+and put it into external/vcredist.])
+   fi
+fi
+
+dnl ===================================================================
+dnl Windows builds - attempt to auto-copy required instmsiX.exe into external/
+dnl ===================================================================
+if test "$_os" = "WINNT"; then
+       ./oowintool --msvc-copy-instmsi ./external/msi
+fi
+
+dnl ===================================================================
+dnl Windows builds with MSVS 2008/2010 need instmsiw.exe in external/msi
+dnl ===================================================================
+if test "$_os" = "WINNT"; then
+   AC_MSG_CHECKING([for instmsiw.exe])
+   if test -f ./external/msi/instmsiw.exe; then
+      AC_MSG_RESULT([found])
+   else
+      AC_MSG_ERROR([instmsiw.exe is missing in external/msi.])
+   fi
+fi
commit 982527195a5f64e9585796f18c18de9e0f2b4b93
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Nov 25 00:13:14 2010 +0100

    git-hooks: Symlink the git hooks to the ones from git-hooks/

diff --git a/g b/g
index 246d9a4..05c0260 100755
--- a/g
+++ b/g
@@ -20,6 +20,19 @@ if [ ! -e ${CLONEDIR} ]; then mkdir -p $CLONEDIR; fi
 RAWBUILDDIR=`perl -e 'use Cwd "abs_path"; print abs_path(shift);' $0 | sed -e ' s/\/g$//'`
 if [ ! -e ${RAWBUILDDIR} ]; then mkdir -p $RAWBUILDDIR; fi
 
+# should we need to update the hooks
+function update_hooks()
+{
+    HOOKDIR="$1"
+    for H in `cd "$RAWBUILDDIR/git-hooks" ; echo *` ; do
+        HOOK=".git/hooks/$H"
+        if [ ! -x "$HOOK" -a ! -L "$HOOK" ] ; then
+            rm -f "$HOOK"
+            ln -s "$HOOKDIR/$H" "$HOOK"
+        fi
+    done
+}
+
 # extra params for some commands, like log
 EXTRA=
 COMMAND="$1"
@@ -116,13 +129,17 @@ if [ "$COMMAND" = "clone" ] ; then
     DIRS="artwork base calc components extensions extras filters
           help impress libs-core libs-extern libs-extern-sys libs-gui
           postprocess sdk testing ure writer"
+    # update hooks in the main repo too
+    ( cd "$RAWBUILDDIR" ; update_hooks "../../git-hooks" )
 fi
 for REPO in $DIRS ; do
     DIR="$CLONEDIR/$REPO"
     NAME="$REPO"
+    HOOKDIR="../../../../git-hooks"
     if [ "$REPO" = "bootstrap" ] ; then
         DIR="$RAWBUILDDIR"
         NAME="main repo"
+        HOOKDIR="../../git-hooks"
     fi
 
     if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
@@ -130,6 +147,7 @@ for REPO in $DIRS ; do
             # executed in a subshell
             if [ "$COMMAND" != "clone" ] ; then
                 cd "$DIR"
+                update_hooks "$HOOKDIR"
             else
                 cd "$CLONEDIR"
             fi
@@ -202,7 +220,10 @@ for REPO in $DIRS ; do
             RETURN=$?
 
             # now we can change the dir in case of clone as well
-            [ "$COMMAND" = "clone" ] && cd $DIR
+            if [ "$COMMAND" = "clone" ] ; then
+                cd $DIR
+                update_hooks "$HOOKDIR"
+            fi
 
             # update stamp if the repo changed
             NEWHEADREF=`git show-ref --head HEAD`
commit a3d2e98e9897d60d10ced86f851fc87d2705af74
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Nov 24 23:26:28 2010 +0100

    git-hooks: Copy them from the build repo.

diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg
new file mode 100755
index 0000000..d51a330
--- /dev/null
+++ b/git-hooks/commit-msg
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# An example hook script to check the commit log message.
+# Called by git-commit with one argument, the name of the file
+# that has the commit message.  The hook should exit with non-zero
+# status after issuing an appropriate message if it wants to stop the
+# commit.  The hook is allowed to edit the commit message file.
+#
+# To enable this hook, make this file executable.
+
+# Uncomment the below to add a Signed-off-by line to the message.
+# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
+# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
+
+# This example catches duplicate Signed-off-by lines.
+
+abort() {
+    cp $1 $1.save
+    cat >&2 <<EOF
+Commit aborted, your commit message was saved as '$1.save'.
+
+Reason: $2
+
+EOF
+    exit 1
+}
+
+test "" = "$(grep '^Signed-off-by: ' "$1" |
+	 sort | uniq -c | sed -e '/^[ 	]*1[ 	]/d')" || {
+	abort "$1" "Duplicate Signed-off-by lines."
+}
+
+# Check that the first line exists, and is not an asterisk
+
+if [ -z "`head -n 1 $1 | grep -v '^[ \t]*\*'`" ] ; then
+    abort "$1" "Please provide the general description on the first line."
+fi
+
+# ...and that it is not too long
+
+if [ "`head -n 1 $1 | wc -c`" -gt 79 ] ; then
+    abort "$1" "The first line is too long, please try to fit into 79 characters."
+fi
+
+# ...and that it does not continue on the second line
+if [ "`wc -l < $1`" -gt 1 -a -n "`head -n 2 $1 | tail -n 1 | sed 's/^#.*//'`" ] ; then
+    abort "$1" "The second line is not empty - maybe the first line continues there?"
+fi
+
+# Check that the message is not a ChangeLog-like one
+
+if [ -n "`head -n 1 $1 | grep '^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}.*<.*@.*>'`" ] ; then
+    abort "$1" "The commit message looks like ChangeLog, please use the git form."
+fi
+
+# Check for whitespace in front of *'s
+
+if [ -n "`grep '^[[:space:]]\+\*.*:' $1`" -a -z "`grep '^\*' $1`" ] ; then
+    abort "$1" "Please don't use whitespace in front of '* file: Description.' entries."
+fi
+
+exit 0
diff --git a/git-hooks/post-merge b/git-hooks/post-merge
new file mode 100755
index 0000000..25e62ed
--- /dev/null
+++ b/git-hooks/post-merge
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Do not warn if there were no real merge
+git rev-parse -q --verify HEAD^2 >/dev/null || exit
+
+echo
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+echo "! You probably used 'git pull' instead of 'git pull -r' !"
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+echo
+echo "You can still fix it - please do 'git pull -r' now."
+echo
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
new file mode 100755
index 0000000..253f2dd
--- /dev/null
+++ b/git-hooks/pre-commit
@@ -0,0 +1,187 @@
+#!/usr/bin/perl -w
+
+# A hook script to verify what is about to be committed.
+# Called by "git commit" with no arguments.  The hook should
+# exit with non-zero status after issuing an appropriate message
+# if it wants to stop the commit.
+
+use strict;
+use File::Temp qw/ :mktemp  /;
+use File::Copy;
+
+$ENV{LC_ALL} = "C";
+
+# attempt to fix whitespace in one file
+# $1 - file to fix
+# $2 - list of lines containing whitespace errors
+sub fix_whitespace($$) {
+    my ( $file, $lines ) = @_;
+
+    # usually we have nothing to do ;-)
+    return if ( keys( %{$lines} ) == 0 ||
+                $file eq "" ||
+                !( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pl|pm|pmk|py|sdi|sh|src|tab)/ ) );
+
+    open( IN, "$file" ) || die "Cannot open $file for reading";
+    my ( $out, $tmpfile ) = mkstemp( "/tmp/whitespace-fixing-XXXXXX" );
+
+    my $line_no = 1;
+    while ( my $line = <IN> ) {
+        if ( $lines->{$line_no} && $line =~ /^(.*[^ \t])[ \t]+$/ ) {
+            print $out "$1\n";
+        }
+        elsif ( $lines->{$line_no} && $line =~ /^[ \t]+$/ ) {
+            print $out "\n";
+        }
+        else {
+            print $out $line;
+        }
+        ++$line_no;
+    }
+    close( $out );
+    close( IN );
+
+    move( $tmpfile, $file ) or die "Cannot move '$tmpfile' to '$file'";
+
+    system( "git add $file" );
+    print "Fixed whitespace in '$file'\n";
+}
+
+# go through the patch and collect lines to fix
+sub check_and_fix_whitespace($)
+{
+    my ( $head ) = @_;
+
+    my $file = "";
+    my %lines = ();
+    my $line_no = 0;
+    my $line_max = -1;
+
+    open( IN, "git diff-index -p --no-prefix --cached $head -- |" ) || die "Cannot get git diff-index";
+    while ( my $line = <IN> ) {
+        if ( $line =~ /^\+\+\+ (.*)/ ) {
+            fix_whitespace( $file, \%lines );
+            $file = $1;
+            %lines = ();
+            $line_no = 0;
+            $line_max = -1;
+        }
+        elsif ( $line =~ /^@@ -[0-9]+,[0-9]+ \+([0-9]+),([0-9]+) @@/ ) {
+            $line_no = $1;
+            $line_max = $line_no + $2;
+        }
+        elsif ( ( $line_no < $line_max ) && ( $line =~ /^[ +]/ ) ) {
+            if ( $line =~ /^\+.*[ \t]$/ ) {
+                $lines{$line_no} = 1;
+            }
+            ++$line_no;
+        }
+    }
+    fix_whitespace( $file, \%lines );
+    close( IN );
+}
+
+# Do the work :-)
+
+# Initial commit: diff against an empty tree object
+my $against="4b825dc642cb6eb9a060e54bf8d69288fbee4904";
+if ( system( "git rev-parse --verify HEAD >/dev/null 2>&1" ) == 0 ) {
+    $against="HEAD"
+}
+
+# If you want to allow non-ascii filenames set this variable to true.
+my $allownonascii=`git config hooks.allownonascii`;
+
+# Cross platform projects tend to avoid non-ascii filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if ( $allownonascii ne "true" &&
+    # Note that the use of brackets around a tr range is ok here, (it's
+    # even required, for portability to Solaris 10's /usr/bin/tr), since
+    # the square bracket bytes happen to fall in the designated range.
+    `git diff --cached --name-only --diff-filter=A -z $against | \
+     LC_ALL=C tr -d '[ -~]\\0'` ne "" )
+{
+    print <<EOM;
+Error: Attempt to add a non-ascii file name."
+
+This can cause problems if you want to work"
+with people on other platforms."
+
+To be portable it is advisable to rename the file ..."
+
+If you know what you are doing you can disable this"
+check using:"
+
+  git config hooks.allownonascii true"
+
+EOM
+    exit( 1 );
+}
+
+# be strict about tabs - we don't want them at all, setup your editor
+# correctly ;-)
+my $err_ext = "";
+
+open( FILES, "git diff-index --cached --name-only $against |" ) || die "Cannot run git diff-index.";
+while ( my $file = <FILES> ) {
+    chomp( $file );
+    if ( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml)$/) {
+        open( F, "git diff-index -p --cached $against -- '$file' |" );
+        while ( my $line = <F> ) {
+            if ( $line =~ /^\+ *\t/ ) {
+                $err_ext .= "$file\n";
+                last;
+            }
+        }
+    }
+    close( F );
+}
+close( FILES );
+
+if ( $err_ext ne "" ) {
+    print <<EOM;
+Error: Your change in the following files introduces tabs in indentation:
+
+$err_ext
+Please setup your editor not to use tabs, fix the files, and try again.
+We have had enough trouble with tabs in the past :-(
+
+EOM
+    exit( 1 );
+}
+
+# check for old licenses
+my $check_licenses='^+.*\(Sun Industry Standards Source License Version\|GNU Lesser General Public License Version 2.1\)';
+my $err_licenses=`git diff-index --cached --name-only $against | while read FILE ; do \
+                      if git diff-index -p --cached $against -- "\$FILE" | grep -qs "$check_licenses" ; then \
+                          echo "\$FILE" \
+                      fi \
+                  done`;
+chomp( $err_licenses );
+if ( $err_licenses ne "" && $err_licenses ne "git-hooks/pre-commit" ) {
+    print <<EOM;
+Error: Your change in the following files introduces old licenses:
+
+$err_licenses
+
+Please check with the author(s) that they agree with upgrading the
+license to LGPL3, and change the license accondingly.
+
+EOM
+    exit( 1 );
+}
+
+# fix whitespace in code
+check_and_fix_whitespace( $against );
+
+# check the rest of the files
+my $filter_patches=`git diff-index --check --cached $against -- | sed '/\.\(diff\|patch\):/,/.*/d'`;
+chomp( $filter_patches );
+if ( $filter_patches ne "" ) {
+    print "WARNING:\n\n$filter_patches\n";
+}
+
+# all OK
+exit( 0 );
+# vi:set shiftwidth=4 expandtab:
commit 104bf3570b3a42925a8b7d326b9886cd35535f8c
Author: Sebastian Spaeth <Sebastian at SSpaeth.de>
Date:   Tue Nov 23 13:42:16 2010 +0100

    Expand documentation to mention debuglevels.
    
    Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>

diff --git a/configure.in b/configure.in
index 069b53a..c63df79 100644
--- a/configure.in
+++ b/configure.in
@@ -239,7 +239,9 @@ AC_ARG_ENABLE(werror,
 AC_ARG_ENABLE(debug,
     AS_HELP_STRING([--enable-debug],
         [Include debugging symbols from --enable-symbols plus extra debugging
-         code. Extra large build! (enables -g compiler flag and dmake debug=true)]),
+         code. Extra large build! (enables -g compiler flag and dmake debug=true)
+         If you need even more verbose output, build a module with 
+         "build -- debug=true dbglevel=2".]),
 ,)
 
 AC_ARG_ENABLE(dbgutil,
commit cb70764eebe12642a29cf3b0bc0172bdb9c53a02
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Mon Nov 22 03:11:56 2010 -0600

    oops: remove a debugging flags in g

diff --git a/g b/g
index 2d5e7d2..246d9a4 100755
--- a/g
+++ b/g
@@ -2,7 +2,7 @@
 #
 # Wrapper for git to handle more subdirs at the same time
 #
-set -x
+
 # no params, no action
 if [ "$#" -eq "0" ] ; then
     git
commit 89e883c37703f82e3c4b6eef31b7772c8c356955
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Mon Nov 22 03:11:23 2010 -0600

    simplify the determination of the bootstrap dir

diff --git a/bin/mkworkdir b/bin/mkworkdir
index 10630f8..9691ee1 100755
--- a/bin/mkworkdir
+++ b/bin/mkworkdir
@@ -57,18 +57,13 @@ done
 
 
 if [ -z "$BOOTSTRAP_DIR" ]; then
-    BOOTSTRAP_DIR=$(git rev-parse --git-dir 2>/dev/null) || die "Cannot use the current working directory as implicit source: Not a git repository"
-
-    case "$BOOTSTRAP_DIR" in
-	.git)
-	    BOOTSTRAP_DIR="$(pwd)"
-	    ;;
-	.)
-	    cd .. && BOOTSTRAP_DIR=$(pwd)
-	    ;;
-    esac
+    BOOTSTRAP_DIR=$(git rev-parse --show-toplevel 2>/dev/null) || die "Cannot use the current working directory as implicit source: Not a git repository"
+    if [ -n "$BOOTSTRAP_DIR" ] ; then
+	if [ "$(basename $(git config remote.origin.url))" != "bootstrap" ] ; then
+	    die "Cannot use the current working directory as implicit source: Not a bootstrap git repository"
+	fi
+    fi
 fi
-
 if [ -z "$DEST_DIR" ]; then
     echo "destination directory is missing."
     print_help $0
commit e4ecab49b0554f6917d233b2b934f3cf74f9c22c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 09:15:33 2010 -0600

    adjust gitignore to exclude built stuff in bootstrap

diff --git a/.gitignore b/.gitignore
index 7519241..2f876cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@
 /*/wntmsci??.pro
 /*/unxmac??
 /*/unxmac??.pro
+/solver/*
 
 # autoconf generated stuff
 /aclocal.m4
@@ -27,6 +28,13 @@
 /set_soenv
 /visibility.cxx
 
+# misc
+/set_soenv.last
+/set_soenv.stamp
+/warn
+/build.log
+
+
 /*.Set.sh
 
 /*/*.exe
commit 209f0ab32bbf76e5a9dcec554884b72a44f5883d
Author: Norbert Thiebaud <norbert at sqdata.com>
Date:   Sat Nov 20 23:06:14 2010 -0600

    add some utility scripts to create new workdir
    
    based on kohei blog on the subject, adapted for the 'bootstrap' build

diff --git a/bin/git-new-workdir b/bin/git-new-workdir
new file mode 100755
index 0000000..3ad2c0c
--- /dev/null
+++ b/bin/git-new-workdir
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+usage () {
+	echo "usage:" $@
+	exit 127
+}
+
+die () {
+	echo $@
+	exit 128
+}
+
+if test $# -lt 2 || test $# -gt 3
+then
+	usage "$0 <repository> <new_workdir> [<branch>]"
+fi
+
+orig_git=$1
+new_workdir=$2
+branch=$3
+
+# want to make sure that what is pointed to has a .git directory ...
+git_dir=$(cd "$orig_git" 2>/dev/null &&
+  git rev-parse --git-dir 2>/dev/null) ||
+  die "Not a git repository: \"$orig_git\""
+
+case "$git_dir" in
+.git)
+	git_dir="$orig_git/.git"
+	;;
+.)
+	git_dir=$orig_git
+	;;
+esac
+
+# don't link to a configured bare repository
+isbare=$(git --git-dir="$git_dir" config --bool --get core.bare)
+if test ztrue = z$isbare
+then
+	die "\"$git_dir\" has core.bare set to true," \
+		" remove from \"$git_dir/config\" to use $0"
+fi
+
+# don't link to a workdir
+if test -L "$git_dir/config"
+then
+	die "\"$orig_git\" is a working directory only, please specify" \
+		"a complete repository."
+fi
+
+# don't recreate a workdir over an existing repository
+if test -e "$new_workdir"
+then
+	die "destination directory '$new_workdir' already exists."
+fi
+
+# make sure the links use full paths
+git_dir=$(cd "$git_dir"; pwd)
+
+# create the workdir
+mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
+
+# create the links to the original repo.  explicitly exclude index, HEAD and
+# logs/HEAD from the list since they are purely related to the current working
+# directory, and should not be shared.
+for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
+do
+	case $x in
+	*/*)
+		mkdir -p "$(dirname "$new_workdir/.git/$x")"
+		;;
+	esac
+	ln -s "$git_dir/$x" "$new_workdir/.git/$x"
+done
+
+# now setup the workdir
+cd "$new_workdir"
+# copy the HEAD from the original repository as a default branch
+cp "$git_dir/HEAD" .git/HEAD
+# checkout the branch (either the same as HEAD from the original repository, or
+# the one that was asked for)
+git checkout -f $branch
diff --git a/bin/git-ps1 b/bin/git-ps1
new file mode 100755
index 0000000..8a09800
--- /dev/null
+++ b/bin/git-ps1
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+r=
+b=
+g="$(git rev-parse --git-dir 2>/dev/null)"
+
+if [ -n "$g" ]; then
+    if [ -d "$g/../.dotest" ]
+        then
+        if test -f "$g/../.dotest/rebasing"
+            then
+            r="|REBASE"
+        elif test -f "$g/../.dotest/applying"
+            then
+            r="|AM"
+        else
+            r="|AM/REBASE"
+        fi
+        b="$(git symbolic-ref HEAD 2>/dev/null)"
+    elif [ -f "$g/.dotest-merge/interactive" ]
+        then
+        r="|REBASE-i"
+        b="$(cat "$g/.dotest-merge/head-name")"
+    elif [ -d "$g/.dotest-merge" ]
+        then
+        r="|REBASE-m"
+        b="$(cat "$g/.dotest-merge/head-name")"
+    elif [ -f "$g/MERGE_HEAD" ]
+        then
+        r="|MERGING"
+        b="$(git symbolic-ref HEAD 2>/dev/null)"
+    else
+        if [ -f "$g/BISECT_LOG" ]
+            then
+            r="|BISECTING"
+        fi
+        if ! b="$(git symbolic-ref HEAD 2>/dev/null)"
+            then
+            if ! b="$(git describe --exact-match HEAD 2>/dev/null)"
+                then
+                b="$(cut -c1-7 "$g/HEAD")..."
+            fi
+        fi
+    fi
+
+    if [ -n "$1" ]; then
+        printf "$1" "${b##refs/heads/}$r"
+    else
+        printf "%s" "${b##refs/heads/}$r"
+    fi
+else
+    printf "not-in-git"
+fi
diff --git a/bin/mkworkdir b/bin/mkworkdir
new file mode 100755
index 0000000..10630f8
--- /dev/null
+++ b/bin/mkworkdir
@@ -0,0 +1,108 @@
+#!/usr/bin/env bash
+
+BASEDIR=$(dirname $0)
+GIT_NEW_WORKDIR=`which git-new-workdir 2>/dev/null`
+if [ -z $GIT_NEW_WORKDIR ] ; then
+   GIT_NEW_WORKDIR="$BASEDIR/git-new-workdir"
+fi
+
+print_help() {
+    echo "Usage: $1 [-s | --source bootstrap_reference_repo_path] [ -d | --workdir-base-path path] [ --as alias_name] [branch name]"
+    echo "--source is optional if you are currently in a bootstrap git repository, in which case that repository is used as source"
+    echo "--workdir-base-path is optional if you have defined LO_BASE_WORKDIR in your environement"
+    echo "--as is the name of the directory that will be the bootstrap of your new workdir ensemble. the default is the branch name used to create the workdir"
+    echo "the branch name is optional, the default is 'master'"
+}
+
+die() {
+    echo $1
+    exit 1
+}
+
+BOOTSTRAP_DIR=
+DEST_DIR=${LO_BASE_WORKDIR:-}
+BRANCH="master"
+
+while [ "${1:-}" != "" ] ; do
+      case $1 in
+	  -s | --source )
+	      shift
+	      BOOTSTRAP_DIR="$1"
+	      ;;
+	  -d | --workdir-base-path )
+	      shift
+	      DEST_DIR="$1"
+	      ;;
+	  --as )
+	      shift
+	      WKDIR_NAME="$1"
+	      ;;
+	  -h | --help )
+	      print_help $0
+	      exit 0
+	      ;;
+	  -* )
+	      die "invalid option $1"
+	      ;;
+	  *)
+	      if [ -z "$BRANCH" ] ; then
+		  BRANCH="$1"
+	      else
+		  die "Too many arguments"
+	      fi
+	      ;;
+      esac
+      shift
+done
+
+
+if [ -z "$BOOTSTRAP_DIR" ]; then
+    BOOTSTRAP_DIR=$(git rev-parse --git-dir 2>/dev/null) || die "Cannot use the current working directory as implicit source: Not a git repository"
+
+    case "$BOOTSTRAP_DIR" in
+	.git)
+	    BOOTSTRAP_DIR="$(pwd)"
+	    ;;
+	.)
+	    cd .. && BOOTSTRAP_DIR=$(pwd)
+	    ;;
+    esac
+fi
+
+if [ -z "$DEST_DIR" ]; then
+    echo "destination directory is missing."
+    print_help $0
+    exit 1
+fi
+
+if [ -z "$WKDIR_NAME" ]; then
+    WKDIR_NAME="$BRANCH"
+fi
+
+if [ -e "$DEST_DIR/$WKDIR_NAME" ]; then
+    die "$DEST_DIR/$WKDIR_NAME already exists."
+fi
+
+echo "===== bootstrap ====="
+$GIT_NEW_WORKDIR $BOOTSTRAP_DIR "$DEST_DIR/$WKDIR_NAME" $BRANCH
+
+echo "creating directory $DEST_DIR/$WKDIR_NAME/clone"
+mkdir -p "$DEST_DIR/$WKDIR_NAME/clone" || die "failed to create $DEST_DIR/$WKDIR_NAME/clone"
+
+REPOS=$(cat ${BASEDIR}/repo-list)
+
+cd "$DEST_DIR/$WKDIR_NAME"
+
+for repo in $REPOS; do
+    repo_path="${BOOTSTRAP_DIR}/clone/$repo"
+    echo "===== $repo ====="
+    $GIT_NEW_WORKDIR $repo_path "$DEST_DIR/$WKDIR_NAME/clone/$repo" $BRANCH
+    for link in $(ls ./clone/$repo) ; do
+        if [ ! -e "$link" ] ; then
+            echo "Creating link $link"
+            ln -s "./clone/$repo/$link" "$link"
+        fi
+    done
+
+done
+
diff --git a/bin/repo-list b/bin/repo-list
new file mode 100644
index 0000000..349fb7d
--- /dev/null
+++ b/bin/repo-list
@@ -0,0 +1 @@
+artwork base calc components extensions extras filters help impress libs-core libs-extern libs-extern-sys libs-gui postprocess sdk testing ure writer
commit e8e9bebc5038dd29905c7d33771ae505e6567444
Author: Norbert Thiebaud <norbert at sqdata.com>
Date:   Sat Nov 20 23:04:06 2010 -0600

    correct the instructions:./download and ./g clone are implicit with make

diff --git a/set_soenv.in b/set_soenv.in
index ffb2de9..ee227a3 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2159,7 +2159,6 @@ if ( $Warning ne "" )
 print "*********************************************************".
       "******************* $newline";
 
-print "\nTo download the build dependencies, issue:\n./g clone\n./download\n\n";
 print "To build, issue:\nmake\n\n";
 print "For the developer installation, issue:\nmake dev-install\n\n";
 
commit 88a728370ec02f9d6b673919524f51067058e886
Author: Norbert Thiebaud <norbert at sqdata.com>
Date:   Sat Nov 20 23:02:59 2010 -0600

    make the download step clone the 'others' git-repos if needed

diff --git a/download b/download
index e2f0340..f238027 100755
--- a/download
+++ b/download
@@ -26,6 +26,9 @@
 #
 #*************************************************************************
 
+if [ ! -d clone ] ; then
+    ./g clone
+fi
 if [ -z "$TARFILE_LOCATION" ]; then
     . ./*.Set.sh
 fi
commit 90da164313685d9ab0bf41f97a8c48d342c03cd1
Author: Norbert Thiebaud <norbert at sqdata.com>
Date:   Sat Nov 20 23:00:47 2010 -0600

    Make the determination of the remote repo url work on MacOS
    
    Use bash substitution, instead of a piped sed

diff --git a/g b/g
index e410422..2d5e7d2 100755
--- a/g
+++ b/g
@@ -2,7 +2,7 @@
 #
 # Wrapper for git to handle more subdirs at the same time
 #
-
+set -x
 # no params, no action
 if [ "$#" -eq "0" ] ; then
     git
@@ -187,7 +187,8 @@ for REPO in $DIRS ; do
                     fi
                     ;;
                 clone)
-                    EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${REPO}"
+                    EXTRA="$(git config remote.origin.url)"
+		    EXTRA=${EXTRA/bootstrap/${REPO}}
                     ;;
             esac
 
commit 75e59cd02641ffbc7691b7601076010af42b184e
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Nov 19 11:20:18 2010 +0100

    build: Fix ./g clone.

diff --git a/g b/g
index 7e3fd2a..e410422 100755
--- a/g
+++ b/g
@@ -117,10 +117,10 @@ if [ "$COMMAND" = "clone" ] ; then
           help impress libs-core libs-extern libs-extern-sys libs-gui
           postprocess sdk testing ure writer"
 fi
-for D in $DIRS ; do
-    DIR="$CLONEDIR/$D"
-    NAME="$D"
-    if [ "$D" = "bootstrap" ] ; then
+for REPO in $DIRS ; do
+    DIR="$CLONEDIR/$REPO"
+    NAME="$REPO"
+    if [ "$REPO" = "bootstrap" ] ; then
         DIR="$RAWBUILDDIR"
         NAME="main repo"
     fi
@@ -128,7 +128,11 @@ for D in $DIRS ; do
     if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
         (
             # executed in a subshell
-            [ "$COMMAND" != "clone" ] && cd "$DIR"
+            if [ "$COMMAND" != "clone" ] ; then
+                cd "$DIR"
+            else
+                cd "$CLONEDIR"
+            fi
 
             # relativize the absolutized params again if we want to operate
             # only on the files belonging to this exact repo
@@ -138,7 +142,7 @@ for D in $DIRS ; do
                 PWD=`pwd`
                 PWDLEN=`pwd | wc -c`
                 for I in "${FILES[@]}" ; do
-                    I="${I//@REPO@/${DIR}}"
+                    I="${I//@REPO@/${REPO}}"
                     unset FILES[$FILESNUM]
                     FILESNUM=$(($FILESNUM+1))
                     # filter out files that don't belong to this repo
@@ -183,9 +187,7 @@ for D in $DIRS ; do
                     fi
                     ;;
                 clone)
-                    if [ -z "$FILES" ]; then
-                        EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${DIR}"
-                    fi
+                    EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${REPO}"
                     ;;
             esac
 
@@ -211,7 +213,7 @@ for D in $DIRS ; do
                     for link in `ls` ; do
                         if [ ! -e "$RAWBUILDDIR/$link" ] ; then
                             echo "Creating missing link $link"
-                            ln -s "$CLONEDIR/$DIR/$link" "$RAWBUILDDIR/$link"
+                            ln -s "$DIR/$link" "$RAWBUILDDIR/$link"
                         fi
                     done
                     ;;
commit 57844cbd620515dd6177372b8f8a1eaabd0d9558
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Nov 16 15:34:09 2010 +0100

    build: Update the download location for the external tarballs.

diff --git a/download b/download
index 5a866ac..e2f0340 100755
--- a/download
+++ b/download
@@ -27,8 +27,7 @@
 #*************************************************************************
 
 if [ -z "$TARFILE_LOCATION" ]; then
-    echo "Error: No destination defined, you probably forgot to source the environment?"
-    exit 1
+    . ./*.Set.sh
 fi
 
 if [ ! -d "$TARFILE_LOCATION" ]; then
diff --git a/set_soenv.in b/set_soenv.in
index 09648f8..ffb2de9 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1018,7 +1018,7 @@ $SOURCE_ROOT_DIR      = join("/", @splitlist);
 
 # default TARFILE_LOCATION
 if ('@TARFILE_LOCATION@' eq "DEFAULT")
-{	$TARFILE_LOCATION="$SOURCE_ROOT_DIR/src";
+{	$TARFILE_LOCATION="$SRC_ROOT/src";
 }
 
 #
@@ -2150,7 +2150,7 @@ if (rename( $outfile, $tmp ) ne 1)
 print "$newline";
 print "*********************************************************".
       "*******************$newline*$newline";
-print "* LibreOffice $UPD configuration finished. $newline*$newline";
+print "* LibreOffice configuration finished. $newline*$newline";
 
 if ( $Warning ne "" )
 {  print "$Warning*$newline";
@@ -2159,7 +2159,8 @@ if ( $Warning ne "" )
 print "*********************************************************".
       "******************* $newline";
 
-print "\nTo build, issue:\nmake\n\n";
+print "\nTo download the build dependencies, issue:\n./g clone\n./download\n\n";
+print "To build, issue:\nmake\n\n";
 print "For the developer installation, issue:\nmake dev-install\n\n";
 
 $bootfile = "bootstrap";
commit fe225c2eb3236e186983d17c8f5dd83a6bdeb2ec
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Nov 16 15:22:02 2010 +0100

    build: Renamed fetch_tarballs.sh to download.

diff --git a/download b/download
new file mode 100755
index 0000000..5a866ac
--- /dev/null
+++ b/download
@@ -0,0 +1,165 @@
+#!/bin/sh
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+if [ -z "$TARFILE_LOCATION" ]; then
+    echo "Error: No destination defined, you probably forgot to source the environment?"
+    exit 1
+fi
+
+if [ ! -d "$TARFILE_LOCATION" ]; then
+    mkdir $TARFILE_LOCATION
+fi
+if [ ! -d "$TARFILE_LOCATION" ]; then
+    echo "Error: Cannot create $TARFILE_LOCATION."
+    exit 1
+fi
+
+FILELIST="$1"
+if [ -z "$FILELIST" ]; then
+    echo "No filelist provided, using the default ooo.lst."
+    FILELIST="ooo.lst"
+fi
+
+# check for wget and md5sum
+wget=
+md5sum=
+curl=
+
+for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
+    eval "$i --version" > /dev/null 2>&1
+    ret=$?
+    if [ $ret -eq 0 ]; then
+        wget=$i
+        echo found wget: $wget
+        break 2
+    fi
+done
+
+if [ -z "$wget" ]; then
+    for i in curl /usr/bin/curl /usr/local/bin/curl /usr/sfw/bin/curl /opt/sfw/bin/curl /opt/local/bin/curl; do
+    # mac curl returns "2" on --version 
+    #    eval "$i --version" > /dev/null 2>&1
+    #    ret=$?
+    #    if [ $ret -eq 0 ]; then
+        if [ -x $i ]; then
+            curl=$i
+            echo found curl: $curl
+            break 2
+        fi
+    done
+fi
+
+if [ -z "$wget" -a -z "$curl" ]; then
+    echo "ERROR: neither  wget nor curl found!"
+    exit
+fi
+
+for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
+    if [ "$i" = "md5" ]; then
+        eval "$i -x" > /dev/null 2>&1
+    else
+        eval "$i --version" > /dev/null 2>&1
+    fi
+    ret=$?
+    if [ $ret -eq 0 ]; then
+        md5sum=$i
+        echo found md5sum: $md5sum
+        break 2
+    fi
+done
+
+if [ "$md5sum" = "md5" ]; then
+    if md5 -r < /dev/null > /dev/null 2>/dev/null; then
+        md5special=-r
+    elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
+        md5special=-n
+    fi
+fi
+
+if [ -z "$md5sum" ]; then
+    echo "Warning: no md5sum: found!"
+fi
+
+start_dir=`pwd`
+logfile=$TARFILE_LOCATION/fetch.log
+date >> $logfile
+
+filelist=`cat $FILELIST`
+mkdir -p $TARFILE_LOCATION/tmp
+cd $TARFILE_LOCATION/tmp
+echo $$ > fetch-running
+for i in $filelist ; do
+#    echo $i
+    if [ "$i" != `echo $i | sed "s/^http:\///"` ]; then
+        tarurl=$i
+    # TODO: check for comment    
+    else
+        if [ "$tarurl" != "" ]; then
+            if [ ! -f "../$i" ]; then
+                echo $i
+                if [ ! -z "$wget" ]; then
+                    $wget -nv -N $tarurl/$i 2>&1 | tee -a $logfile
+                else
+                    echo fetching $i
+                    $curl $file_date_check -O $tarurl/$i 2>&1 | tee -a $logfile
+                fi
+                wret=$?
+                if [ $wret -ne 0 ]; then
+                    mv $i ${i}_broken
+                    failed="$failed $i"
+                    wret=0
+                fi
+                if [ -f $i -a -n "$md5sum" ]; then
+                    sum=`$md5sum $md5special $i | sed "s/ .*//"`
+                    sum2=`echo $i | sed "s/-.*//"`
+                    if [ "$sum" != "$sum2" ]; then
+                        echo checksum failure for $i 2>&1 | tee -a $logfile
+                        failed="$failed $i"
+                        mv $i ${i}_broken
+                    else
+                        mv $i ..
+                    fi
+                else
+                    mv $i ..
+                fi
+            fi
+        fi
+    fi
+done
+rm $TARFILE_LOCATION/tmp/*-*
+cd $start_dir
+
+if [ ! -z "$failed" ]; then
+    echo
+    echo ERROR: failed on:
+    for i in $failed ; do
+        echo $i
+    done
+    exit 1
+fi
+
diff --git a/fetch_tarballs.sh b/fetch_tarballs.sh
deleted file mode 100755
index 5a866ac..0000000
--- a/fetch_tarballs.sh
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/bin/sh
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-if [ -z "$TARFILE_LOCATION" ]; then
-    echo "Error: No destination defined, you probably forgot to source the environment?"
-    exit 1
-fi
-
-if [ ! -d "$TARFILE_LOCATION" ]; then
-    mkdir $TARFILE_LOCATION
-fi
-if [ ! -d "$TARFILE_LOCATION" ]; then
-    echo "Error: Cannot create $TARFILE_LOCATION."
-    exit 1
-fi
-
-FILELIST="$1"
-if [ -z "$FILELIST" ]; then
-    echo "No filelist provided, using the default ooo.lst."
-    FILELIST="ooo.lst"
-fi
-
-# check for wget and md5sum
-wget=
-md5sum=
-curl=
-
-for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
-    eval "$i --version" > /dev/null 2>&1
-    ret=$?
-    if [ $ret -eq 0 ]; then
-        wget=$i
-        echo found wget: $wget
-        break 2
-    fi
-done
-
-if [ -z "$wget" ]; then
-    for i in curl /usr/bin/curl /usr/local/bin/curl /usr/sfw/bin/curl /opt/sfw/bin/curl /opt/local/bin/curl; do
-    # mac curl returns "2" on --version 
-    #    eval "$i --version" > /dev/null 2>&1
-    #    ret=$?
-    #    if [ $ret -eq 0 ]; then
-        if [ -x $i ]; then
-            curl=$i
-            echo found curl: $curl
-            break 2
-        fi
-    done
-fi
-
-if [ -z "$wget" -a -z "$curl" ]; then
-    echo "ERROR: neither  wget nor curl found!"
-    exit
-fi
-
-for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
-    if [ "$i" = "md5" ]; then
-        eval "$i -x" > /dev/null 2>&1
-    else
-        eval "$i --version" > /dev/null 2>&1
-    fi
-    ret=$?
-    if [ $ret -eq 0 ]; then
-        md5sum=$i
-        echo found md5sum: $md5sum
-        break 2
-    fi
-done
-
-if [ "$md5sum" = "md5" ]; then
-    if md5 -r < /dev/null > /dev/null 2>/dev/null; then
-        md5special=-r
-    elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
-        md5special=-n
-    fi
-fi
-
-if [ -z "$md5sum" ]; then
-    echo "Warning: no md5sum: found!"
-fi
-
-start_dir=`pwd`
-logfile=$TARFILE_LOCATION/fetch.log
-date >> $logfile
-
-filelist=`cat $FILELIST`
-mkdir -p $TARFILE_LOCATION/tmp
-cd $TARFILE_LOCATION/tmp
-echo $$ > fetch-running
-for i in $filelist ; do
-#    echo $i
-    if [ "$i" != `echo $i | sed "s/^http:\///"` ]; then
-        tarurl=$i
-    # TODO: check for comment    
-    else
-        if [ "$tarurl" != "" ]; then
-            if [ ! -f "../$i" ]; then
-                echo $i
-                if [ ! -z "$wget" ]; then
-                    $wget -nv -N $tarurl/$i 2>&1 | tee -a $logfile
-                else
-                    echo fetching $i
-                    $curl $file_date_check -O $tarurl/$i 2>&1 | tee -a $logfile
-                fi
-                wret=$?
-                if [ $wret -ne 0 ]; then
-                    mv $i ${i}_broken
-                    failed="$failed $i"
-                    wret=0
-                fi
-                if [ -f $i -a -n "$md5sum" ]; then
-                    sum=`$md5sum $md5special $i | sed "s/ .*//"`
-                    sum2=`echo $i | sed "s/-.*//"`
-                    if [ "$sum" != "$sum2" ]; then
-                        echo checksum failure for $i 2>&1 | tee -a $logfile
-                        failed="$failed $i"
-                        mv $i ${i}_broken
-                    else
-                        mv $i ..
-                    fi
-                else
-                    mv $i ..
-                fi
-            fi
-        fi
-    fi
-done
-rm $TARFILE_LOCATION/tmp/*-*
-cd $start_dir
-
-if [ ! -z "$failed" ]; then
-    echo
-    echo ERROR: failed on:
-    for i in $failed ; do
-        echo $i
-    done
-    exit 1
-fi
-
commit 0c370948009529626e82ebc9697f3ca73dee17d8
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Nov 16 15:16:36 2010 +0100

    build: Make the 'g' wrapper in bootstrap really work.

diff --git a/g b/g
index ce43f72..7e3fd2a 100755
--- a/g
+++ b/g
@@ -111,18 +111,24 @@ while shift ; do
 done
 
 # do it!
-cd "$CLONEDIR"
-DIRS=". `ls`"
+DIRS="bootstrap `(cd $CLONEDIR ; ls)`"
 if [ "$COMMAND" = "clone" ] ; then
     DIRS="artwork base calc components extensions extras filters
           help impress libs-core libs-extern libs-extern-sys libs-gui
           postprocess sdk testing ure writer"
 fi
-for DIR in $DIRS ; do
+for D in $DIRS ; do
+    DIR="$CLONEDIR/$D"
+    NAME="$D"
+    if [ "$D" = "bootstrap" ] ; then
+        DIR="$RAWBUILDDIR"
+        NAME="main repo"
+    fi
+
     if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
         (
             # executed in a subshell
-            [ "$COMMAND" != "clone" ] && cd $DIR
+            [ "$COMMAND" != "clone" ] && cd "$DIR"
 
             # relativize the absolutized params again if we want to operate
             # only on the files belonging to this exact repo
@@ -183,7 +189,7 @@ for DIR in $DIRS ; do
                     ;;
             esac
 
-            [ "$REPORT_REPOS" = "1" ] && echo "===== $DIR ====="
+            [ "$REPORT_REPOS" = "1" ] && echo "===== $NAME ====="
 
             # check for changes
             HEADREF=`git show-ref --head HEAD`
commit a613a736c311c5caeb29d54d8f46fabb2631d005
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 09:08:22 2010 -0600

    gitignore mac built objects

diff --git a/.gitignore b/.gitignore
index 6829bde..7519241 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,8 @@
 /*/unxlng??.pro
 /*/wntmsci??
 /*/wntmsci??.pro
+/*/unxmac??
+/*/unxmac??.pro
 
 # autoconf generated stuff
 /aclocal.m4
commit 0c3ab145fb5b22ce58e295e16885b5596f6eabda
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Nov 16 15:00:48 2010 +0100

    build: Add the 'g' wrapper to the bootstrap repo.
    
    This is the first step in removing the need for the 'build' repository, and
    its 'rawbuild' hack.

diff --git a/.gitignore b/.gitignore
index 67388a4..6829bde 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,9 @@
 *~
 .*.sw[op]
 
+# where the 'subrepos' are located
+/clone
+
 # the build directories
 /*/unxlng??
 /*/unxlng??.pro
@@ -9,13 +12,217 @@
 /*/wntmsci??.pro
 
 # autoconf generated stuff
+/aclocal.m4
+/autom4te.cache
+/bootstrap
 /ChangeLog
+/config.log
+/config.parms
+/config.status
 /configure
-/aclocal.m4
+/Makefile
+/makefile.mk
+/set_soenv
+/visibility.cxx
+
+/*.Set.sh
 
 /*/*.exe
 
-instsetoo_native/util/LibreOffice*
-instsetoo_native/util/tmon.out
-/*/unxmac??
-/*/unxmac??.pro
+# links to the other repositories
+MathMLDTD
+Mesa
+UnoControls
+accessibility
+afms
+animations
+apache-commons
+apple_remote
+autodoc
+automation
+avmedia
+basctl
+basebmp
+basegfx
+basic
+bean
+beanshell
+berkeleydb
+binfilter
+boost
+bridges
+cairo
+canvas
+chart2
+cli_ure
+codemaker
+comphelper
+configmgr
+connectivity
+cosv
+cppcanvas
+cppu
+cppuhelper
+cppunit
+cpputools
+crashrep
+cui
+curl
+dbaccess
+default_images
+desktop
+dictionaries
+drawinglayer
+dtrans
+editeng
+embeddedobj
+embedserv
+epm
+eventattacher
+expat
+extensions
+external
+external_images
+extras
+fileaccess
+filter
+forms
+formula
+fpicker
+framework
+graphite
+helpcontent2
+hsqldb
+hunspell
+hwpfilter
+hyphen
+i18npool
+i18nutil
+icc
+icu
+idl
+idlc
+io
+javainstaller2
+javaunohelper
+jfreereport
+jpeg
+jurt
+jvmaccess
+jvmfwk
+l10ntools
+languagetool
+libegg
+libtextcat
+libwpd
+libwpg
+libwps
+libxml2
+libxmlsec
+libxslt
+lingucomponent
+linguistic
+lotuswordpro
+lpsolve
+lucene
+mdds
+migrationanalysis
+more_fonts
+moz
+mysqlc
+mysqlcppconn
+mythes
+neon
+nlpsolver
+np_sdk
+nss
+o3tl
+odk
+offapi
+officecfg
+offuh
+ooo_custom_images
+oovbaapi
+oox
+openssl
+package
+packimages
+padmin
+postprocess
+psprint_config
+python
+pyuno
+qadevOOo
+rdbmaker
+readlicense_oo
+redland
+regexp
+registry
+remotebridges
+reportbuilder
+reportdesign
+rhino
+ridljar
+rsc
+sal
+salhelper
+sane
+sax
+saxon
+sc
+scaddins
+sccomp
+scripting
+sd
+sdext
+setup_native
+sfx2
+shell
+slideshow
+smoketestoo_native
+sot
+starmath
+stax
+stoc
+store
+svl
+svtools
+svx
+sw
+swext
+sysui
+test
+testautomation
+testgraphical
+testtools
+tomcat
+toolkit
+tools
+twain
+ucb
+ucbhelper
+udkapi
+udm
+unixODBC
+unodevtools
+unoil
+unotools
+unoxml
+ure
+uui
+vbahelper
+vcl
+vigra
+wizards
+writerfilter
+writerperfect
+x11_extensions
+xmerge
+xml2cmp
+xmlhelp
+xmloff
+xmlscript
+xmlsecurity
+xpdf
+xsltml
+zlib
diff --git a/g b/g
new file mode 100755
index 0000000..ce43f72
--- /dev/null
+++ b/g
@@ -0,0 +1,248 @@
+#!/usr/bin/env bash
+#
+# Wrapper for git to handle more subdirs at the same time
+#
+
+# no params, no action
+if [ "$#" -eq "0" ] ; then
+    git
+    echo
+    echo "Additional options available only in this 'g' wrapper:"
+    echo
+    echo "Usage: g [options] [git commands]"
+    echo "   -f         Force - act on all the repos, not only the changed ones"
+    echo "   -s         Silent - do not report the repo names."
+    exit $?
+fi
+
+CLONEDIR=`perl -e 'use Cwd "abs_path"; print abs_path(shift);' $0 | sed -e ' s/\/g$/\/clone/'`
+if [ ! -e ${CLONEDIR} ]; then mkdir -p $CLONEDIR; fi
+RAWBUILDDIR=`perl -e 'use Cwd "abs_path"; print abs_path(shift);' $0 | sed -e ' s/\/g$//'`
+if [ ! -e ${RAWBUILDDIR} ]; then mkdir -p $RAWBUILDDIR; fi
+
+# extra params for some commands, like log
+EXTRA=
+COMMAND="$1"
+PAGER=
+RELATIVIZE=1
+PUSH_ALL=
+ALLOW_EMPTY=
+KEEP_GOING=0
+REPORT_REPOS=1
+
+while [ "${COMMAND:0:1}" = "-" ] ; do
+    case "$COMMAND" in
+        -f) KEEP_GOING=1
+            ;;
+        -s) REPORT_REPOS=0
+            ;;
+    esac
+    shift
+    COMMAND="$1"
+done
+
+case "$COMMAND" in
+    apply)
+        EXTRA="-p0 --stat --apply --index --ignore-space-change --whitespace=error"
+        RELATIVIZE=0
+        ;;
+    diff)
+        PAGER='--no-pager'
+        REPORT_REPOS=0
+        ;;
+    log)
+        if [ "$#" = "1" ] ; then
+            EXTRA='-1'
+        fi
+        PAGER='--no-pager'
+        ;;
+    push)
+        if [ "$#" != "1" ] ; then
+            PUSH_ALL=1
+        fi
+        ;;
+esac
+
+# absolutize the parameters first
+unset FILES
+FILESNUM=0
+while shift ; do
+    PARAM="$1"
+    if [ -z "$PARAM" ] ; then
+        continue
+    elif [ "${PARAM:0:1}" = "-" ] ; then
+        if [ \( "$COMMAND" = "checkout" -a "$PARAM" = "-b" \) -o \
+             \( "$COMMAND" = "clone"    -a "$PARAM" = "--reference" \) -o \
+             \( "$COMMAND" = "commit"   -a "$PARAM" = "-m" \) -o \
+             \( "$COMMAND" = "commit"   -a "$PARAM" = "-am" \) -o \
+             \( "$COMMAND" = "tag"      -a "$PARAM" = "-m" \) ]
+        then
+            # params that take an argument
+            FILES[$FILESNUM]="$PARAM"
+            FILESNUM=$(($FILESNUM+1))
+            shift
+            FILES[$FILESNUM]="$1"
+            FILESNUM=$(($FILESNUM+1))
+        else
+            [ "$COMMAND" = "commit" -a "$PARAM" = "--allow-empty" ] && ALLOW_EMPTY=1
+
+            FILES[$FILESNUM]="$PARAM"
+            FILESNUM=$(($FILESNUM+1))
+        fi
+    else
+        if [ "$COMMAND" = "apply" ] ; then
+            grep -qs $'^+ *\t' "$PARAM" && {
+                echo "Patch '$PARAM' introduces tabs in indentation, aborting."
+                echo
+                echo "Please fix the patch (something like s/^\(+ *\)\t/\1    /) and try again."
+                echo
+                exit 1
+            }
+        fi
+
+        # make the paths absolute
+        FILES[$FILESNUM]=`perl -e 'use Cwd "abs_path"; print abs_path(shift);' "$PARAM"`
+        if [ -z "${FILES[$FILESNUM]}" -o ! -e "${FILES[$FILESNUM]}" ] ; then
+            # it is probably not a file, but a tag name, or something
+            FILES[$FILESNUM]="$PARAM"
+        fi
+        FILESNUM=$(($FILESNUM+1))
+    fi
+done
+
+# do it!
+cd "$CLONEDIR"
+DIRS=". `ls`"
+if [ "$COMMAND" = "clone" ] ; then
+    DIRS="artwork base calc components extensions extras filters
+          help impress libs-core libs-extern libs-extern-sys libs-gui
+          postprocess sdk testing ure writer"
+fi
+for DIR in $DIRS ; do
+    if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
+        (
+            # executed in a subshell
+            [ "$COMMAND" != "clone" ] && cd $DIR
+
+            # relativize the absolutized params again if we want to operate
+            # only on the files belonging to this exact repo
+            if [ "$RELATIVIZE" = "1" -a -n "$FILES" ] ; then
+                FILESNUM=0
+                INSERTNUM=0
+                PWD=`pwd`
+                PWDLEN=`pwd | wc -c`
+                for I in "${FILES[@]}" ; do
+                    I="${I//@REPO@/${DIR}}"
+                    unset FILES[$FILESNUM]
+                    FILESNUM=$(($FILESNUM+1))
+                    # filter out files that don't belong to this repo
+                    if [ \( "${I:0:1}" = "/" \) -a \( "$COMMAND" != "clone" \) ] ; then
+                        if [ "${I:0:$PWDLEN}" = "$PWD/" ] ; then
+                            FILES[$INSERTNUM]="${I:$PWDLEN}"
+                            INSERTNUM=$(($INSERTNUM+1))
+                        fi
+                    else
+                        FILES[$INSERTNUM]="$I"
+                        INSERTNUM=$(($INSERTNUM+1))
+                    fi
+                done
+                [ "$INSERTNUM" = "0" ] && exit 0
+            fi
+
+            # some extra params
+            case "$COMMAND" in
+                apply)
+                    for I in * ; do
+                        if [ -d "$I" ] ; then
+                            EXTRA="$EXTRA --include=$I/*"
+                        else
+                            EXTRA="$EXTRA --include=$I"
+                        fi
+                    done
+                    ;;
+                commit)
+                    if [ "$ALLOW_EMPTY" != "1" ] ; then
+                        [ -z "`git diff-index --name-only HEAD --`" ] && exit 0
+                    fi
+                    ;;
+                push)
+                    if [ "$PUSH_ALL" != "1" ] ; then
+                        [ -n "`git rev-list origin..HEAD`" ] || exit 0
+                    fi
+                    ;;
+                status)
+                    LOCALCOMMITS="`git rev-list origin..HEAD`"
+                    if [ -z "$LOCALCOMMITS" ] ; then
+                        [ -z "`git diff-index --name-only HEAD --`" ] && exit 0
+                    fi
+                    ;;
+                clone)
+                    if [ -z "$FILES" ]; then
+                        EXTRA="$(git config remote.origin.url|sed 's|/[^/]\+$||')/${DIR}"
+                    fi
+                    ;;
+            esac
+
+            [ "$REPORT_REPOS" = "1" ] && echo "===== $DIR ====="
+
+            # check for changes
+            HEADREF=`git show-ref --head HEAD`
+
+            # do it!
+            git $PAGER "$COMMAND" $EXTRA "${FILES[@]}"
+            RETURN=$?
+
+            # now we can change the dir in case of clone as well
+            [ "$COMMAND" = "clone" ] && cd $DIR
+
+            # update stamp if the repo changed
+            NEWHEADREF=`git show-ref --head HEAD`
+            [ "$HEADREF" != "$NEWHEADREF" ] && touch $CLONEDIR/repos_changed
+
+            case "$COMMAND" in
+                pull|clone)
+                    # update links
+                    for link in `ls` ; do
+                        if [ ! -e "$RAWBUILDDIR/$link" ] ; then
+                            echo "Creating missing link $link"
+                            ln -s "$CLONEDIR/$DIR/$link" "$RAWBUILDDIR/$link"
+                        fi
+                    done
+                    ;;
+                status)
+                    # git status returns error in some versions, clear that
+                    RETURN=0
+                    ;;
+                grep)
+                    # git grep return an 'error' if nothing is found
+                    # still we should continue grepping the other repos
+                    RETURN=0
+                    ;;
+            esac
+            if [  "$KEEP_GOING" = "1" ] ; then
+                RETURN=0
+            fi
+
+            exit $RETURN
+        ) || exit $?
+    fi
+done
+
+# Cleanup the broken links
+if [ "$COMMAND" = "pull" ] ; then
+    for link in `ls $RAWBUILDDIR` ; do
+        if [ -h "$RAWBUILDDIR/$link" -a ! -e "$RAWBUILDDIR/$link" ]; then
+            echo "Removing broken link $link"
+            rm $RAWBUILDDIR/$link
+        fi
+    done
+fi
+
+# warn
+if [ "$COMMAND" = "apply" ] ; then
+    echo
+    echo "Don't forget to check the status & commit now ;-)"
+    echo
+fi
+
+# vi:set shiftwidth=4 expandtab:
commit 8aaeaf38059ca3c9f5c35a698a2cf957b7974e3e
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Nov 27 09:03:38 2010 -0600

    building rawbuild on mac should not depend on pkg-config being installed

diff --git a/autogen.sh b/autogen.sh
index defc542..c2572eb 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -22,6 +22,13 @@ fi
 
 touch ChangeLog
 
+if test "z$ACLOCAL_FLAGS" = "z" -a "z`uname -s`" = "zDarwin" ; then
+    ACLOCAL_FLAGS="-I ./m4/mac"
+fi
+if test "z`uname -s`" != "zDarwin" ; then
+    AUTOMAKE_EXTRA_FLAGS=--warnings=no-portability
+fi
+
 aclocal $ACLOCAL_FLAGS || exit 1;
 #automake --gnu --add-missing --copy || exit 1;
 #intltoolize --copy --force --automake
diff --git a/m4/mac/pkg.m4 b/m4/mac/pkg.m4
new file mode 100644
index 0000000..2cd2290
--- /dev/null
+++ b/m4/mac/pkg.m4
@@ -0,0 +1,154 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+#
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists.  Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+		[AC_MSG_RESULT([no])
+                $4])
+elif test $pkg_failed = untried; then
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+		[$4])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES


More information about the Libreoffice-commits mailing list