diff -urN --exclude-from=conglomerate-r/.diffexclude conglomerate/uss/ChangeLog conglomerate-r/uss/ChangeLog
--- conglomerate/uss/ChangeLog	2003-10-31 04:40:13.000000000 +0200
+++ conglomerate-r/uss/ChangeLog	2003-11-01 17:48:20.000000000 +0200
@@ -1,3 +1,8 @@
+2003-10-01  Robert Varga <frozenfingers@xs4all.nl>
+
+	* mkgtkdoc, mkgtkdoctypes, mkgtkdocoverrides, mkgtkdocsections:
+	Scripts work "Geert"-style, various fixes.
+	
 2003-10-27  Geert Stappers <stappers@stappers.nl>
 
 	* mkgtkdoc
diff -urN --exclude-from=conglomerate-r/.diffexclude conglomerate/uss/mkgtkdoc conglomerate-r/uss/mkgtkdoc
--- conglomerate/uss/mkgtkdoc	2003-10-31 04:40:13.000000000 +0200
+++ conglomerate-r/uss/mkgtkdoc	2003-11-01 17:45:40.000000000 +0200
@@ -7,7 +7,6 @@
 ######################################################
 # VARIABLES
 # All paths are relative to the main conglomerate dir
-# except for 
 ######################################################
 
 # the directory containing the C sources
@@ -21,29 +20,56 @@
 CONGLOMERATE_TYPES=conglomerate.types
 CONGLOMERATE_OVERRIDES=conglomerate-overrides.txt
 CONGLOMERATE_SECTIONS=conglomerate-sections.txt
+
 # Sometimes we have ChangeLog, sometimes Changelog
 CHANGELOG=ChangeLog
-
 # ChangeLog output
 CHANGELOG_DATE=`date +%F`
 # is a name necessary in the ChangeLog?
 CHANGELOG_EMAIL='Robert Varga <frozenfingersxs4all.nl>'
-CHANGELOG_FILES='conglomerate.types, conglomerate-overrides.txt, conglomerate-sections.txt:'
-CHANGELOG_NOTICE='uss/mkgtkdoc: Syncronized with source'
-
-UPDATE_FALSE=F
-UPDATE_TRUE=T
-UPDATE_DOCS=$UPDATE_FALSE
-# UPDATE_MESSAGE=
-
-
-#######################################
 
-uss/mkgtkdocoverrides
-uss/mkgtkdocsections
-uss/mkgtkdoctypes
-# hoping the sequence is the smart one FIXME
+update_gtkdoc_changelog(){
+    
+    CHANGELOG_FILE=$1
+    CHANGELOG_NOTICE=$2
+
+    mv $DEST_DIR/$CHANGELOG $DEST_DIR/$CHANGELOG.tmp
+    echo `date +%F`'  '$CHANGELOG_EMAIL > $DEST_DIR/$CHANGELOG
+    echo >> $DEST_DIR/$CHANGELOG
+    echo -e '\t* '$CHANGELOG_FILE':' >> $DEST_DIR/$CHANGELOG
+    echo -e '\t'$CHANGELOG_NOTICE >> $DEST_DIR/$CHANGELOG
+    echo >> $DEST_DIR/$CHANGELOG
+    cat $DEST_DIR/$CHANGELOG.tmp >> $DEST_DIR/$CHANGELOG
+    rm -f $DEST_DIR/$CHANGELOG.tmp
+
+    echo -e '\a*** '$CHANGELOG' updated ***'
+
+}
+
+######################################
+
+uss/mkgtkdoctypes $SOURCE_DIR $DEST_DIR/$CONGLOMERATE_TYPES 
+
+if [ `diff $DEST_DIR/$CONGLOMERATE_TYPES $DEST_DIR/$CONGLOMERATE_TYPES.bak | wc -l` -ne 0 ]
+then
+    # update ChangeLog
+    update_gtkdoc_changelog 'conglomerate.types' 'Syncronized with source by uss/mkgtkdoctypes $version: 1.1$'
+fi
+
+uss/mkgtkdocoverrides $SOURCE_DIR $DEST_DIR/$CONGLOMERATE_OVERRIDES
+
+if [ `diff $DEST_DIR/$CONGLOMERATE_OVERRIDES $DEST_DIR/$CONGLOMERATE_OVERRIDES.bak | wc -l` -ne 0 ]
+then
+    # update ChangeLog
+    update_gtkdoc_changelog 'conglomerate-overrides.txt' 'Syncronized with source by uss/mkgtkdocoverrides $version: 1.1$'
+fi
+
+uss/mkgtkdocsections $SOURCE_DIR $DEST_DIR $DEST_DIR/$CONGLOMERATE_OVERRIDES $DEST_DIR/$CONGLOMERATE_SECTIONS
+
+if [ `diff $DEST_DIR/$CONGLOMERATE_SECTIONS $DEST_DIR/$CONGLOMERATE_SECTIONS.bak | wc -l` -ne 0 ]
+then
+    # update ChangeLog
+    update_gtkdoc_changelog 'conglomerate-sections.txt' 'Syncronized with source by uss/mkgtkdocsections $version: 1.3$'
+fi
 
-###
-# wish:
-# update of doc/reference/ChangeLog FIXME
+rm -f $DEST_DIR/*.bak
diff -urN --exclude-from=conglomerate-r/.diffexclude conglomerate/uss/mkgtkdocoverrides conglomerate-r/uss/mkgtkdocoverrides
--- conglomerate/uss/mkgtkdocoverrides	2003-10-28 00:12:47.000000000 +0200
+++ conglomerate-r/uss/mkgtkdocoverrides	2003-11-01 17:27:37.000000000 +0200
@@ -7,15 +7,16 @@
 # DEST_OVERRIDES=../doc/reference/conglomerate-overrides.txt
 DEST_OVERRIDES=$2
 
-if [ $# -lt 3 ]
+if [ $# -ne 2 ]
 then
 	# probably no parameters supplied, setting them
 	SOURCE_DIR=src
 	DEST_OVERRIDES=doc/reference/conglomerate-overrides.txt
 fi
 
-# Remove the old overrides file, because we generate a new one, in case objects got added/removed from the sources
-test -e $DEST_OVERRIDES && rm -f $DEST_OVERRIDES
+[ -e $DEST_OVERRIDES ] && mv $DEST_OVERRIDES $DEST_OVERRIDES.bak
+
+echo '*** Generating conglomerate-overrides.txt ***'
 
 # get_types
 # note that cong-editor-widget3-impl.h conflicts with other headers (generating duplicate
diff -urN --exclude-from=conglomerate-r/.diffexclude conglomerate/uss/mkgtkdocsections conglomerate-r/uss/mkgtkdocsections
--- conglomerate/uss/mkgtkdocsections	2003-10-25 16:49:11.000000000 +0300
+++ conglomerate-r/uss/mkgtkdocsections	2003-11-01 17:39:49.000000000 +0200
@@ -1,19 +1,48 @@
 #!/bin/bash
 
 # source dir = path to the header files
-# SOURCE_DIR=../src
 SOURCE_DIR=$1
+# destination dir
+DEST_DIR=$2
 # source file: path including conglomerate-overrides.txt
-# SOURCE_OVERRIDES=../doc/reference/conglomerate-overrides.txt
-SOURCE_OVERRIDES=$2
+SOURCE_OVERRIDES=$3
 # dest output = path including conglomerate-sections.txt
-# DEST_SECTIONS=../doc/reference/conglomerate-sections.txt
-DEST_SECTIONS=$3
+DEST_SECTIONS=$4
+
+# In the case that we are not called with exactly 3 arguments
+# default the paths from top conglomerate dir
+if [ $# -ne 4 ]
+then
+    SOURCE_DIR=src
+    DEST_DIR=doc/reference
+    SOURCE_OVERRIDES=doc/reference/conglomerate-overrides.txt
+    DEST_SECTIONS=doc/reference/conglomerate-sections.txt
+fi
+
+WORK_DIR=$PWD
+
+[ -e $DEST_SECTIONS ] && mv $DEST_SECTIONS $DEST_SECTIONS.bak
+
+cd $DEST_DIR
+# assumes SOURCE_DIR is relative
+gtkdoc-scan --module=conglomerate --source-dir=$WORK_DIR/$SOURCE_DIR --ignore-headers=""
+cd $WORK_DIR
+
+# check for gtkdoc-scan output
+if [ ! -e $DEST_SECTIONS ]
+then
+    echo '*** ERROR: conglomerate-sections.txt not found. ***'
+    echo '*** please report this to frozenfingers@xs4all.nl ***'
+    exit 1
+fi
+
+echo '*** Generating conglomerate-sections.txt ***'
 
 FILE_LINE=
 CONG_SECTIONS=`cat $DEST_SECTIONS`
 # Now that we have the file's contents, delete the file
 test -e $DEST_SECTIONS && rm -f $DEST_SECTIONS
+
 let OBJNUM=0
 for LINE in $CONG_SECTIONS
 do
@@ -29,6 +58,11 @@
 		echo 'Added '$D
 		let OBJNUM+=1
 	else
+	    # preserve empty lines
+		if [[ $LINE = '<SECTION>' ]]
+		then
+		    echo >> $DEST_SECTIONS
+		fi
 		echo $LINE >> $DEST_SECTIONS
 	fi
 done
diff -urN --exclude-from=conglomerate-r/.diffexclude conglomerate/uss/mkgtkdoctypes conglomerate-r/uss/mkgtkdoctypes
--- conglomerate/uss/mkgtkdoctypes	2003-10-25 16:49:11.000000000 +0300
+++ conglomerate-r/uss/mkgtkdoctypes	2003-11-01 17:28:22.000000000 +0200
@@ -1,12 +1,22 @@
 #!/bin/bash
 
 # source dir = the path to the header files
-# SOURCE_DIR=../src
 SOURCE_DIR=$1
 # output file = the path including conglomerate.types
-# DEST_TYPES=../doc/reference/conglomerate.types
 DEST_TYPES=$2
 
+# no args => default paths from top
+if [ $# -ne 2 ]
+then
+    SOURCE_DIR=src
+    DEST_TYPES=doc/reference/conglomerate.types
+fi
+
+# copy the old $DEST_TYPES to $DEST_TYPES.bak
+[ -e $DEST_TYPES ] && mv $DEST_TYPES $DEST_TYPES.bak
+
+echo '*** Generating conglomerate.types ***'
+
 echo '#include "global.h"' > $DEST_TYPES
 for HEADERFILE in $SOURCE_DIR/*.h
 do 
