Index: patches/GIT.pl
===================================================================
--- patches/GIT.pl	(revision 0)
+++ patches/GIT.pl	(revision 0)
@@ -0,0 +1,311 @@
+#! /usr/bin/perl -w
+
+my $remove = 0;
+my $dest_dir = shift || die "GIT.pl: usage: GIT.pl DESTDIR";
+my @DRINK = "tea";
+
+# start git -- do a smart @GIT@ sed into apply.pl.in?
+my $git_debug = $ENV{"OOO_GIT"};
+$SIG{ __DIE__ } = sub { require Carp; Carp::confess( @_ ) } if $git_debug;
+my $program = "apply.pl";
+
+sub read_pipe
+{
+    my $command = shift;
+    print "PIPING: $command\n" if $git_debug;
+    open PIPE, "$command|" || die "$program: error piping: $command\n";
+    my @result = <PIPE>;
+    my $status = !close PIPE;
+    print "STATUS: $status\n" if $git_debug;
+    print "LOG[0..99]: " . join "", @result[0..($#result < 99 ? $#result : 99)] if $git_debug && $git_debug =~ /pipe/;
+    return $status, join "", @result;
+}
+
+sub svn_revision
+{
+    my ($status, $log) = read_pipe "svn info";
+    $log =~ m/^Revision: ([0-9]+)/m;
+    return $1;
+}
+    
+sub git_is_archive
+{
+    return -d "$dest_dir/.git";
+}
+
+sub git_system
+{
+    my $command = shift;
+    # return system "cd $dest_dir && $command";
+    print "EXECUTING: $command\n" if $git_debug;
+    my $status = system "cd $dest_dir && $command";
+    print "STATUS: $status\n" if $git_debug;
+    die "$program: error executing: $command\n" if $status;
+    # return $status;
+}
+
+sub git_pipe
+{
+    my $command = shift;
+    return read_pipe "cd $dest_dir && $command";
+}
+
+
+sub git_commit
+{
+    my $message = shift;
+    git_system "git add .";
+    git_system "git add -u .";
+    git_system "git commit -m '$message'";
+}
+
+sub git_init
+{
+    git_system "../../bin/create-gitignores.sh";
+    git_system "git init";
+    print "Creating GIT archive - [ go and have some @DRINK@ ] ...\n";
+    git_system "git add .";
+    $svn_revision = svn_revision;
+    git_commit "Initial svn:r$svn_revision unpatched.";
+    git_system "git branch pristine";
+    git_system "git branch patched";
+}
+
+sub git_on_branch
+{
+    my ($branch) = shift;
+    $branch =~ s/\+/\\+/g;
+    my ($status, $log) = git_pipe "git branch";
+    return $log =~ m/(^|\n)\* $branch\n/;
+}
+
+sub git_has_branch
+{
+    my ($branch) = shift;
+    $branch =~ s/\+/\\+/g;
+    my ($status, $log) = git_pipe "git branch";
+    return $log =~ m/(^|\n)(\*| ) $branch\n/;
+}
+
+sub git_is_modified
+{
+    my ($status, $log) = git_pipe "git status";
+    # FIXME: git-status' exit code cannot be used to determine status;
+    # comparing command output.
+    return 0 if $log
+	=~ /^# On branch.*\nnothing to commit \(working directory clean\)\n/;
+    return $log;
+}
+
+sub git_select_branch
+{
+    my $branch = shift;
+    my $pending_changes = git_is_modified;
+    if ($pending_changes)
+    {
+	print "$program: git directory $dest_dir unclean: pending changes\n";
+	print "***************************\n";
+	print "$pending_changes";
+	print "***************************\n";
+	die;
+    }
+    my ($status, $log) = git_pipe "git checkout $branch";
+    return if !$status;
+    die "$program: cannot select branch $branch:\n$log";
+}
+
+sub git_prepare
+{
+    git_init $dest_dir if !git_is_archive;
+#    git_select_branch "patched" if !git_on_branch "patched";
+#    git_command "git clean -f";
+    if (!git_on_branch "patched")
+    {
+	git_select_branch "patched";
+	git_system "git clean -f";
+    }
+}
+    
+sub git_postpare
+{
+    return if !git_is_modified;
+    git_system "git add .";
+    git_system "git add -u .";
+    $svn_revision = svn_revision;
+    my $un = $remove ? "un" : "";
+    git_commit "Update to svn:r$svn_revision ${un}patched.";
+    git_system "git checkout master";
+    git_system "git rebase patched" if !$remove;
+    #print "Now do something like\n";
+    #print "    cd $dest_dir && git rebase patched\n";
+}
+
+my $module_re = 0;
+sub git_get_branch
+{
+    # FIXME: group in branch using [Section], or more fine-grained using issue i#00000?
+    my $base = shift;
+    my $dir = shift;
+
+    return $1 if $base =~ /(writerfilter-qnametostr-NOOPTFILES)/;
+
+    return $dir if $dir and not "$dir" =~ /^[.]$|^[.][.]$|64bit|dev300|hotfixes/;
+    return $1 if $base =~ /^(cjk-character-units|cws-scsheetprotection|emf\+|fpicker-kde|jvmfwk-gij|lockfile|mono|sal-strintern-speed|sc-dataform|sc-datapilot|svg-import|system-lpsolve|transogl|unittesting|unxsplash|vba|wpgimporter|writerfilter)/;
+
+    return "emf+" if $base =~ /^(cairocanvas-alpha-pixmap-rewrite|vcl-grey-alpha-unix-sal-bitmap)/;
+    return "linkoo" if $base =~ /^(fix-linkoo|linkoo-)/;
+    return "ooxml" if $base =~ /^(win32-installer-register-moox-types)/;
+    return "vba" if $base =~ /^(default-autotext-and-form-name|sc-toggle-merge-center)/;
+
+    if (!$module_re)
+    {
+	my $modules = git_pipe "find . -mindepth 1 -maxdepth 1 -type d";
+	$modules =~ s@[.]/@@g;
+	$module_re = join "|", split " ", $modules;
+    }
+    $base =~ s/-($module_re)$//;
+    return $base;
+}
+
+sub git_get_depend
+{
+    my $branch = shift;
+
+    return "autocorrect-accidental-caps-lock", "internal-mesa-headers" if $branch =~/vcl-linking-randr/;
+    return "cairo" if $branch =~ /^cairocanvas-fix-image-cache/;
+    return "cws-layoutdialogs" if $branch =~ /^buildfix-layoutdialogs/;
+    return "cws-layoutdialogs" if $branch =~ /^layout-plugin/;
+    return "cws-npower10", "cws-pflin10", "cws-npower11" if $branch =~ /vba/;
+    return "form-control-visibility" if $branch =~ /^forms-radio-button-group-names/;
+    return "internal-mesa-headers" if $branch =~ /^vcl-linking-randr/;
+    return "layout-plugin" if $branch =~ /^layout-tab/;
+    return "link-as-needed" if $branch =~ /^emf\+/;
+    return "linkwarn-svtools-miscopts-bits" if $branch =~ /^ui-desktop-integration/;
+    return "lwp-filter-component" if $branch =~ /^ooxml/;
+    return "novell-win32-odma" if $branch =~ /^linkwarn-svtools-miscopts-bits/;
+    return "ooo64508.vcl.honourfontconfighinting" if $branch =~ /^ooo59127.vcl.honourcairofont/;
+    return "sc-dataform" if $branch =~ /^(sc-copy-on-merged-cells|sc-datapilot)/;
+    return "sc-datapilot" if $branch =~ /^sc-dp-gridlayout/;
+    return "sc-datapilot", "sc-paste-on-enter" if $branch =~ /^cws-scsheetprotection/;
+    return "sc-export-shape-macro-bindings" if $branch =~ /^sc-export-shape-hlink-bindings/;
+    return "sc-hrc-ooo-build-resources" if $branch =~ /^sc-dataform/;
+    return "sc-natural-sort" if $branch =~ /sc-simple-sort-include-format-header/;
+    return "sc-paste-on-enter" if $branch =~ /^cws-scsheetprotection/;
+    return "sfx2-pre-and-postprocess-during-save-load" if $branch =~ /^sfx2-pre-and-postprocess-crash-fix/;
+    return "sfx2-remove-check-update-on-fileload" if $branch =~ /^sfx2-pre-and-postprocess-during-save-load/;
+    return "speed-symbolic-functions" if $branch =~ /^speed-bdirect/;
+    return "store-core" if $branch =~ /^speed-store-lck/;
+    return "system-lpsolve" if $branch =~/static-libs-use-_pic/;
+    return "tools-qa-urlobj-unittest", "gnome-vfs-late-init" if $branch =~ /^unittesting/;
+    return "vba" if $branch =~ /^sc-toggle-merge-center/;
+    return "wpsimport" if $branch =~ /^wpgimport/;
+    return "unxsplash" if $branch =~ /^oosplash-etc-openoffice-sofficerc/;
+    
+    return "pristine";
+}
+
+sub git_count_commits
+{
+    return 0 + git_pipe "git log --pretty=oneline | wc -l";
+}
+
+sub git_patch_branch
+{
+    my $patch = shift;
+    $patch =~ /([^\/]+)\/([^\/]+)[.](diff|patch)$/;
+    my $dir = $1;
+    my $base = $2;
+    $base =~ s/[0-9]$// if $base !~ /chart2|helpcontent2|javainstaller2|scp2|sfx2|sj2|stlport5|testshl2|transex3|[0-9][0-9]+$/;
+    my $branch = git_get_branch $base, $dir;
+    my @depend = git_get_depend $branch;
+    print "DIR: $dir\n" if $git_debug;
+    print "BASE: $base\n" if $git_debug;
+    print "DEPEND[0]: $depend[0]\n" if $git_debug;
+    print "DEPEND...:" . join "," if $#depend > 1 && $git_debug;
+    print "BRANCH: $branch\n" if $git_debug;
+    git_commit "Apply $patch.";
+    git_system "git branch $branch $depend[0]" if !git_has_branch $branch;
+    git_select_branch $branch;
+    foreach my $d (@depend[1..$#depend]) { git_system "git rebase $d"; }
+    my $log = git_pipe "git log -1 patched";
+    $log =~ /^commit (.*)/;
+    my $commit = $1;
+#    git_system "git cherry-pick $commit";
+    my $status = system "cd $dest_dir && git cherry-pick $commit";
+    if ($status)
+    {
+	print "FIXME: patch depends on earlier patches: $patch\n";
+	if (git_count_commits == 1)
+	{
+	    # Single-patch branch, or first patch of multiple-patch branch
+	    git_system "git reset --hard HEAD";
+	    git_system "git clean -f";
+	    git_system "git checkout patched";
+	    git_system "git branch -D $branch";
+	    git_system "git branch DEPENDENCY-$branch patched";
+	    git_system "git tag FIXME-branched-from-patched-$base DEPENDENCY-$branch";
+	}
+	else
+	{
+	    # Non-first patch in multiple-patch branch
+	    # Hitting this if our patch is not the first in this branch
+	    # would be extra ugly
+	    print "FIXME: conflict in multiple-patch branch: $branch, $patch\n";
+	    git_commit "Conflicts cherry-picking $commit ($patch).";
+	    git_system "git checkout patched";
+	    git_system "git branch -m $branch CONFLICTS-$base";
+	    git_system "git branch $branch patched";
+	    git_system "git tag FIXME-branched-from-patched-$base $branch";
+	}
+    }
+    git_select_branch "patched";
+}
+# end git
+
+
+my @deps = git_get_depend "buildfix-layoutdialogs";
+print "DEPS:" . join ",", @deps;
+print "\n";
+@deps = git_get_depend "vcl-linking-randr";
+print "DEPS:" . join ",", @deps;
+print "\n";
+
+exit 0;
+    
+read_pipe "exit-status 255";
+
+git_system "exit-status 0";
+#git_system "exit-status 1";
+#git_system "exit-status 255";
+
+git_patch_branch "/home/janneke/vc/ooo-HEAD/patches/dev300/./sc-simple-sort-include-format-header.diff";
+exit 0;
+    
+$dir = ".";
+$base = "sc-simple-sort-include-format-header";
+my $branch = git_get_branch $base, $dir;
+my $depend = git_get_depend $branch;
+
+print "DEPEND: $depend\n";
+print "\n";
+
+print "HAS: EMF+\n"  if git_has_branch "emf+";
+
+exit 0;
+
+$patch = "layout-tab-toolkit.diff";
+git_system "echo foo >> bar";
+sub git_patch_branch;
+git_patch_branch $patch if $ENV{"OOO_GIT"} =~ /branch/;
+git_system "git clean -f";
+
+read_pipe "exit-status 0";
+read_pipe "exit-status 1";
+
+exit 0;
+    
+{
+    git_prepare if $ENV{"OOO_GIT"};
+    git_postpare if $ENV{"OOO_GIT"};
+
+}
Index: patches/dev300/reportdesign-mention-package.diff
===================================================================
--- patches/dev300/reportdesign-mention-package.diff	(revision 12949)
+++ patches/dev300/reportdesign-mention-package.diff	(working copy)
@@ -30,56 +30,3 @@
         CancelButton PB_CANCEL
         {
                 Pos = MAP_APPFONT ( DLG_WIDTH / 2 + (CELL_PADDING/2), ACTION_LINE_START) ;
---- dbaccess/source/ui/dlg/localize.sdf-old	2008-04-29 12:45:07.000000000 +0200
-+++ dbaccess/source/ui/dlg/localize.sdf	2008-04-29 12:47:49.000000000 +0200
-@@ -7034,48 +7034,8 @@
- dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	pushbutton	RID_EXTENSION_NOT_PRESENT_DLG	PB_DOWNLOAD			0	vi	Tải ~về...				2002-02-02 02:02:02
- dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	pushbutton	RID_EXTENSION_NOT_PRESENT_DLG	PB_DOWNLOAD			0	zh-CN	下载(~D)...				2002-02-02 02:02:02
- dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	pushbutton	RID_EXTENSION_NOT_PRESENT_DLG	PB_DOWNLOAD			0	zh-TW	下載(~D)...				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ar	لفتح التقرير أنت بحاجة لامتداد %RPT_EXTENSION_NAME.\n\nانقر ' نزل ...' لتنزيل وتثبيت الامتتداد.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	be-BY	Каб адкрыць паведамленне, патрэбнае пашырэнне %RPT_EXTENSION_NAME.\n\nНацісніце 'Атрымаць...' каб атрымаць і ўстанавіць пашырэнне.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	bg	За да отворите справка, ви е необходимо разширението %RPT_EXTENSION_NAME.\n\nНатиснете "Изтегляне...", за да изтеглите и инсталирате разширението.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	br	Evit digeriñ ur marilh ho po ezhomm eus an askouezhad %RPT_EXTENSION_NAME.\n\nKlikañ war 'Pellgargañ...' evit pellgargañ ha staliañ an askouezhad.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ca	Per a obrir un informe necessiteu l'extensió %RPT_EXTENSION_NAME.\n\nFeu clic a "Baixa..." per a baixar i instal·lar l'extensió.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	cs	Pro otevření sestavy je potřeba rozšíření %RPT_EXTENSION_NAME.\n\nKlepněte na 'Stáhnout...', pokud chcete rozšíření stáhnout a nainstalovat.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	da	For at åbne en rapport kræves udvidelsen %RPT_EXTENSION_NAME.\n\nKlik på 'Hent...' for at hente og installere udvidelsen.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	de	Zum Öffnen eines Berichts wird die Erweiterung %RPT_EXTENSION_NAME benötigt.\n\nKlicken Sie auf 'Download...', um die Erweiterung herunterzuladen und zu installieren.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	el	Για να ανοίξετε μια αναφορά χρειάζεστε την επέκταση  %RPT_EXTENSION_NAME.\n\nΠατήστε 'Λήψη...' για να κάνετε λήψη και εγκατάσταση της επέκτασης.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				1	eo	Por malfermi raporton vi bezonas la etendajxon %RPT_EXTENSION_NAME.\n\nAlklaku 'Elsxuti...' por elsxuti kaj instali la etendajxon.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	es	Para abrir un informe se requiere la extensión %RPT_EXTENSION_NAME.\n\nHaga clic en 'Descargar...' para descargar e instalar la extensión.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	et	Aruande avamiseks on vaja laiendust %RPT_EXTENSION_NAME.\n\nLaienduse allalaadimiseks ja paigaldamiseks klõpsa 'Laadi alla...'.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	fr	L'ouverture d'un rapport requiert l'extension %RPT_EXTENSION_NAME.\n\nCliquez sur Télécharger... pour télécharger et installer l'extension.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	gl	Necesítase a extensión %RPT_EXTENSION_NAME para abrir o informe.\n\nPrema 'Descargar...' para descargar e instalar a extensión.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				13691	gu	અહેવાલ ખોલવા માટે તમને %RPT_EXTENSION_NAME એક્સટેન્સન જરૂરી છે.\n\nએક્સટેન્સન ડાઉનલોડ કરવા અને સ્થાપિત કરવા માટે 'ડાઉનલોડ...' ક્લિક કરકો.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	hr	Za otvaranje izvješća morate imati %RPT_EXTENSION_NAME proširenje.\n\nKliknite na  'Preuzmi...' kako bi preuzeli i instalirali proširenje.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	hu	Jelentés megnyitásához %RPT_EXTENSION_NAME bővítésre van szükség.\n\nKattintson a „Letöltés...” lehetőségre a bővítés letöltése és telepítése érdekében.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	it	Per aprire un rapporto è necessaria l'estensione %RPT_EXTENSION_NAME.\n\nFare clic su Scarica per scaricare e installare l'estensione.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ja	To open a report you require the extension %RPT_EXTENSION_NAME.\n\nClick 'Download...' to download and install the extension.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				13691	km	ដើម្បី​បើក​របាយការណ៍​មួយ អ្នក​ត្រូវការ​ផ្នែក​បន្ថែម %RPT_EXTENSION_NAME.\n\nចុច 'ទាញយក...' ដើម្បី​ទាញ​យក ហើយ​ដំឡើង​ផ្នែក​បន្ថែម ។				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ko	보고서를 열려면 확장자 %RPT_EXTENSION_NAME이(가) 필요합니다.\n\n'다운로드...'를 클릭하고 확장자를 다운로드 및 설치합니다.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	lt	Ataskaitai atverti reikalingas plėtinys %RPT_EXTENSION_NAME.\n\nSpustelėkite „Atsisiųsti...“, kad atsisiųstumėte ir įdiegtumėte plėtinį.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	mk	За да отворите извештај ви треба проширувањето %RPT_EXTENSION_NAME.\n\nКликнете на „Симни...“ за да го симнете и инсталирате проширувањето.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	nb	Du trenger utvidelsen %RPT_EXTENSION_NAME for å åpne rapporter.\n\nTrykk på «Last ned» for å laste ned og installere utvidelsen.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ne	प्रतिवेदन खोल्न तपाईँलाई विस्तार %RPT_EXTENSION_NAME आवश्यक पर्दछ ।\n\nविस्तार डाउनलोड र स्थापना गर्न 'डाउनलोड...' क्लिक गर्नुहोस् ।				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	nl	U hebt de extensie %RPT_EXTENSION_NAME nodig om een rapport te kunnen openen.\n\nKlik op 'Downloaden...' om de extensie te downloaden en installeren.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	nn	Du treng utvidinga %RPT_EXTENSION_NAME for å opna rapportar.\n\nTrykk på «Last ned» for å lasta ned og installera utvidinga.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	pl	Do otwarcia raportu potrzebne jest rozszerzenie %RPT_EXTENSION_NAME.\n\nW celu ściągnięcia i zainstalowania rozszerzenia kliknij 'Pobierz...'.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	pt	Para abrir um relatório, é necessário a extensão %RPT_EXTENSION_NAME.\n\nClique em 'Download...' para fazer o download e instalar a extensão.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	pt-BR	Para abrir um relatório, é necessário a extensão %RPT_EXTENSION_NAME.\n\nClique em 'Download...' para fazer o download e instalar a extensão.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	ru	Для редактирования отчета требуется расширение %RPT_EXTENSION_NAME.\n\nЩелкните  "Загрузить..." для загрузки и установки расширения.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	rw	Kugira ngo ufungure raporo usaba umugereka %RPT_EXTENSION_NAME.\n\nKanda 'Gukurura...' kugira ngo ukurure uninjizemo umugereka.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	sh	Za otvaranje izveštaja potreban je dodatak %RPT_EXTENSION_NAME.\n\nPritisnite „Preuzmi...“ kako bi preuzeli i instalirali dodatak.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				13691	sk	Pre otvorenie správy potrebujete rozšírenie %RPT_EXTENSION_NAME.\n\nKliknite 'Stiahnuť...' pre stiahnutie a inštaláciu rozšírenia.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	sl	Če želite odpreti poročilo, potrebujete razširitev %RPT_EXTENSION_NAME.\n\nKliknite 'Prenesi ...', da prenesete in namestite razširitev.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	sr	За отварање извештаја потребан је додатак %RPT_EXTENSION_NAME.\n\nПритисните „Преузми...“ како би преузели и инсталирали додатак.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	sv	Tillägget %RPT_EXTENSION_NAME krävs för att du ska kunna öppna rapporten.\n\nKlicka på "Ladda ner" för att hämta och installera tillägget.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	tr	%RPT_EXTENSION_NAME eklentisi raporları açmak için gereklidir.\n\nEklentiyi indirip yüklemek için "İndir..." düğmesine tıklayın.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	uk	Для редагування звіту потрібне розширення %RPT_EXTENSION_NAME.\n\nНатисніть  "Завантажити..." для завантаження та встановлення розширення.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	vi	Khả năng mở báo cáo nhờ phần mở rộng %RPT_EXTENSION_NAME.\n\nNhấn vào « Tải về... » để tải về và cài đặt phần mở rộng này.				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	zh-CN	为打开报表您需要 %RPT_EXTENSION_NAME 扩展。\n\n请单击“下载...”来下载和安装该扩展。				2002-02-02 02:02:02
--dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	zh-TW	您需要有擴充軟體 %RPT_EXTENSION_NAME 才能開啟報表。\n\n請按一下 [下載...] 以下載及安裝擴充軟體。				2002-02-02 02:02:02
-+dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	de	Zum Öffnen eines Berichts wird die Erweiterung %RPT_EXTENSION_NAME benötigt.\n\nnInstallieren Sie dafür das Paket 'openoffice.org-report-builder'.				2002-02-02 02:02:02
-+dbaccess	source\ui\dlg\ExtensionNotPresent.src	0	string	RID_STR_EXTENSION_NOT_PRESENT				0	fr	L'ouverture d'un rapport requiert l'extension %RPT_EXTENSION_NAME.\n\nPour cela, installez le package 'openoffice.org-report-builder'.				2002-02-02 02:02:02
- dbaccess	source\ui\dlg\RelationDlg.src	0	fixedline	DLG_REL_PROPERTIES	FL_CASC_DEL			84	af	Skrapopsies				2002-02-02 02:02:02
- dbaccess	source\ui\dlg\RelationDlg.src	0	fixedline	DLG_REL_PROPERTIES	FL_CASC_DEL			84	ar	خيارات الحذف				2002-02-02 02:02:02
- dbaccess	source\ui\dlg\RelationDlg.src	0	fixedline	DLG_REL_PROPERTIES	FL_CASC_DEL			84	as-IN	বিকল্পবোৰ ডিলিট কৰক				2002-02-02 02:02:02
Index: patches/dev300/apply
===================================================================
--- patches/dev300/apply	(revision 12949)
+++ patches/dev300/apply	(working copy)
@@ -60,6 +60,7 @@
 SUSE-11.0 : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts
 SUSE      : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts
 SUSE-reduced:NovellBase,BerkeleyDB43, ReducedDefaults
+SUSE-Debian: NovellBase, BerkeleyDB43, Gcc43, EMFPlus, CairoFonts, DebianBaseOnly, GCCSTL, PostgreSQL, DebianOnly, DebianSidOnly, Debian32Only
 # Debian
 DebianBase : LinuxCommon, DebianBaseOnly, Lockdown, GCCSTL, BerkeleyDB43, Split, PostgreSQL
 Debian : DebianBase, DebianOnly, DebianSidOnly, Debian32Only, CairoFonts, Gcc43
@@ -829,7 +830,8 @@
 
 sensible-ooomua.diff
 sensible-browser.diff
-no-fontooo-wizard.diff
+#no-fontooo-wizard.diff identical to default-no-install-wizards.diff
+#default-no-install-wizards.diff
 pyuno-rpath-ooodir.diff
 default-cairo-disable.diff
 gcj-32bit-runtime-path.diff, i#64888, mklose
@@ -2002,7 +2004,7 @@
 debian-system-jfreereport.diff
 debian-system-apache-commons.diff
 # FIXME: does this need more for DEV300s new external modules?
-configures-explicit-arch.diff
+##configures-explicit-arch.diff
 
 [ Fixes ]
 svx-sdrobjeditview-update-edit-area.diff, n#305205, n#347355, rodo
Index: patches/dev300/layout-tab-sfx2.diff
===================================================================
--- patches/dev300/layout-tab-sfx2.diff	(revision 12949)
+++ patches/dev300/layout-tab-sfx2.diff	(working copy)
@@ -1,3 +1,25 @@
+diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx
+index 94bbf4b..4155b05 100644
+--- sfx2/inc/sfx2/macrconf.hxx
++++ sfx2/inc/sfx2/macrconf.hxx
+@@ -141,7 +141,7 @@ public:
+ 	sal_uInt16					GetSlotId(SfxMacroInfoPtr);
+ 	void					ReleaseSlotId(sal_uInt16 nId);
+ 	void					RegisterSlotId(sal_uInt16 nId);
+-	const SfxMacroInfoPtr 	GetMacroInfo(sal_uInt16 nId) const;
++    SfxMacroInfoPtr GetMacroInfo(sal_uInt16 nId) const;
+ 	sal_Bool					ExecuteMacro(sal_uInt16 nId, const String& rArgs ) const;
+ 	sal_Bool					ExecuteMacro( SfxObjectShell*, const SvxMacro*, const String& ) const;
+ 	sal_Bool					CheckMacro(sal_uInt16 nId) const;
+@@ -149,7 +149,7 @@ public:
+ 
+ //#if 0 // _SOLAR__PRIVATE
+ 	SAL_DLLPRIVATE static void Release_Impl();
+-	SAL_DLLPRIVATE const SfxMacroInfoPtr GetMacroInfo_Impl( const SvxMacro *pMacro ) const;
++    SAL_DLLPRIVATE SfxMacroInfoPtr GetMacroInfo_Impl( const SvxMacro *pMacro ) const;
+ 	DECL_DLLPRIVATE_LINK( CallbackHdl_Impl, SfxMacroConfig*);
+ 	DECL_DLLPRIVATE_LINK( EventHdl_Impl, SfxMacroInfo*);
+ //#endif
 diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
 index d5b930e..6087aba 100644
 --- sfx2/inc/sfx2/tabdlg.hxx
@@ -60,6 +82,28 @@
  
  	const OKButton& 	GetOKButton() const { return aOKBtn; }
  	OKButton&			GetOKButton() { return aOKBtn; }
+diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx
+index 0a2a595..1ab851b 100644
+--- sfx2/source/control/macrconf.cxx
++++ sfx2/source/control/macrconf.cxx
+@@ -662,7 +662,7 @@ void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId)
+ 
+ //==========================================================================
+ 
+-const SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const
++SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const
+ {
+ 	sal_uInt16 nCount = pImp->aArr.Count();
+ 	for (sal_uInt16 i=0; i<nCount; i++)
+@@ -674,7 +674,7 @@ const SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const
+ 
+ //==========================================================================
+ 
+-const SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const
++SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const
+ {
+ 	sal_uInt16 nCount = pImp->aArr.Count();
+ 	for (sal_uInt16 i=0; i<nCount; i++)
 diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
 index 57a8e89..9db6fba 100644
 --- sfx2/source/dialog/tabdlg.cxx
Index: patches/dev300/static-libs-use-_pic.diff
===================================================================
--- patches/dev300/static-libs-use-_pic.diff	(revision 12949)
+++ patches/dev300/static-libs-use-_pic.diff	(working copy)
@@ -29,9 +29,9 @@
  AGGLIB=-lagg$(OFFICEUPD)$(DLLPOSTFIX)
  .ENDIF
 @@ -339,7 +339,7 @@
- .ELSE
- HUNSPELLLIB=-lhunspell-1.1
- .ENDIF
+ UDMLIB=-ludm
+ HUNSPELLLIB*=-lhunspell
+ ULINGULIB=-lulingu
 -MYTHESLIB=-lmythes
 +MYTHESLIB*=-lmythes
  PYUNOLIB=-lpyuno
Index: patches/apply.pl.in
===================================================================
--- patches/apply.pl.in	(revision 12949)
+++ patches/apply.pl.in	(working copy)
@@ -6,7 +6,7 @@
 sub get_search_paths()
 {
     my @paths = ();
-    my @search = split /:/, $options{'PATCHPATH'};
+    my @search = split /:/, $options{'PATCHPATH'}; #/
 
     for my $stem (@search) {
 	push @paths, "$patch_dir/$stem";
@@ -725,6 +725,9 @@
         print "copy $patch_file -> $patch_copy\n" unless $quiet;
 
         copy($patch, $patch_copy) || die "Can't copy $patch to $patch_copy $!";
+
+	sub git_patch_branch;
+	git_patch_branch $patch if $ENV{"OOO_GIT"} =~ /branch/;
     }
 
     if (keys %existing_patches) {
@@ -749,7 +752,7 @@
     my @Patches = list_patches (@distros);
 
     for my $patch (@Patches) {
-	$patch =~ s/^\Q$patch_dir\E\/.\//src680\//;
+	$patch =~ s/^\Q$patch_dir\E\/.\//dev300\//;
 	$patch =~ s/^\Q$patch_dir\E\/..\///;
 	print "$patch -p0\n";
     }
@@ -992,9 +995,268 @@
     print "Total no issue: $total_no_issue\n";
 }
 
+
+# start git -- do a smart @GIT@ sed into apply.pl.in?
+my $git_debug = $ENV{"OOO_GIT"};
+$SIG{ __DIE__ } = sub { require Carp; Carp::confess( @_ ) } if $git_debug;
+my $program = "apply.pl";
+
+sub read_pipe
+{
+    my $command = shift;
+    print "PIPING: $command\n" if $git_debug;
+    open PIPE, "$command|" || die "$program: error piping: $command\n";
+    my @result = <PIPE>;
+    my $status = !close PIPE;
+    print "STATUS: $status\n" if $git_debug;
+    print "LOG[0..99]: " . join "", @result[0..($#result < 99 ? $#result : 99)] if $git_debug && $git_debug =~ /pipe/;
+    return $status, join "", @result;
+}
+
+sub svn_revision
+{
+    my ($status, $log) = read_pipe "svn info";
+    $log =~ m/^Revision: ([0-9]+)/m;
+    return $1;
+}
+    
+sub git_is_archive
+{
+    return -d "$dest_dir/.git";
+}
+
+sub git_system
+{
+    my $command = shift;
+    # return system "cd $dest_dir && $command";
+    print "EXECUTING: $command\n" if $git_debug;
+    my $status = system "cd $dest_dir && $command";
+    print "STATUS: $status\n" if $git_debug;
+    die "$program: error executing: $command\n" if $status;
+    # return $status;
+}
+
+sub git_pipe
+{
+    my $command = shift;
+    return read_pipe "cd $dest_dir && $command";
+}
+
+
+sub git_commit
+{
+    my $message = shift;
+    git_system "git add .";
+    git_system "git add -u .";
+    git_system "git commit -m '$message'";
+}
+
+sub git_init
+{
+    git_system "../../bin/create-gitignores.sh";
+    git_system "git init";
+    print "Creating GIT archive - [ go and have some @DRINK@ ] ...\n";
+    git_system "git add .";
+    $svn_revision = svn_revision;
+    git_commit "Initial svn:r$svn_revision unpatched.";
+    git_system "git branch pristine";
+    git_system "git branch patched";
+}
+
+sub git_on_branch
+{
+    my ($branch) = shift;
+    $branch =~ s/\+/\\+/g;
+    my ($status, $log) = git_pipe "git branch";
+    return $log =~ m/(^|\n)\* $branch\n/;
+}
+
+sub git_has_branch
+{
+    my ($branch) = shift;
+    $branch =~ s/\+/\\+/g;
+    my ($status, $log) = git_pipe "git branch";
+    return $log =~ m/(^|\n)(\*| ) $branch\n/;
+}
+
+sub git_is_modified
+{
+    my ($status, $log) = git_pipe "git status";
+    # FIXME: git-status' exit code cannot be used to determine status;
+    # comparing command output.
+    return 0 if $log
+	=~ /^# On branch.*\nnothing to commit \(working directory clean\)\n/;
+    return $log;
+}
+
+sub git_select_branch
+{
+    my $branch = shift;
+    my $pending_changes = git_is_modified;
+    if ($pending_changes)
+    {
+	print "$program: git directory $dest_dir unclean: pending changes\n";
+	print "***************************\n";
+	print "$pending_changes";
+	print "***************************\n";
+	die;
+    }
+    my ($status, $log) = git_pipe "git checkout $branch";
+    return if !$status;
+    die "$program: cannot select branch $branch:\n$log";
+}
+
+sub git_prepare
+{
+    git_init $dest_dir if !git_is_archive;
+#    git_select_branch "patched" if !git_on_branch "patched";
+#    git_command "git clean -f";
+    if (!git_on_branch "patched")
+    {
+	git_select_branch "patched";
+	git_system "git clean -f";
+    }
+}
+    
+sub git_postpare
+{
+    return if !git_is_modified;
+    git_system "git add .";
+    git_system "git add -u .";
+    $svn_revision = svn_revision;
+    my $un = $remove ? "un" : "";
+    git_commit "Update to svn:r$svn_revision ${un}patched.";
+    git_system "git checkout master";
+    git_system "git rebase patched" if !$remove;
+    #print "Now do something like\n";
+    #print "    cd $dest_dir && git rebase patched\n";
+}
+
+my $module_re = 0;
+sub git_get_branch
+{
+    # FIXME: group in branch using [Section], or more fine-grained using issue i#00000?
+    my $base = shift;
+    my $dir = shift;
+
+    return $1 if $base =~ /(writerfilter-qnametostr-NOOPTFILES)/;
+
+    return $dir if $dir and not "$dir" =~ /^[.]$|^[.][.]$|64bit|dev300|hotfixes/;
+    return $1 if $base =~ /^(cjk-character-units|cws-scsheetprotection|emf\+|fpicker-kde|jvmfwk-gij|lockfile|mono|sal-strintern-speed|sc-dataform|sc-datapilot|svg-import|system-lpsolve|transogl|unittesting|unxsplash|vba|wpgimporter|writerfilter)/;
+
+    return "emf+" if $base =~ /^(cairocanvas-alpha-pixmap-rewrite|vcl-grey-alpha-unix-sal-bitmap)/;
+    return "linkoo" if $base =~ /^(fix-linkoo|linkoo-)/;
+    return "ooxml" if $base =~ /^(win32-installer-register-moox-types)/;
+    return "vba" if $base =~ /^(default-autotext-and-form-name|sc-toggle-merge-center)/;
+
+    if (!$module_re)
+    {
+	my $modules = git_pipe "find . -mindepth 1 -maxdepth 1 -type d";
+	$modules =~ s@[.]/@@g;
+	$module_re = join "|", split " ", $modules;
+    }
+    $base =~ s/-($module_re)$//;
+    return $base;
+}
+
+sub git_get_depend
+{
+    my $branch = shift;
+
+    return "autocorrect-accidental-caps-lock", "internal-mesa-headers" if $branch =~/vcl-linking-randr/;
+    return "cairo" if $branch =~ /^cairocanvas-fix-image-cache/;
+    return "cws-layoutdialogs" if $branch =~ /^buildfix-layoutdialogs/;
+    return "cws-layoutdialogs" if $branch =~ /^layout-plugin/;
+    return "cws-npower10", "cws-pflin10", "cws-npower11" if $branch =~ /vba/;
+    return "form-control-visibility" if $branch =~ /^forms-radio-button-group-names/;
+    return "internal-mesa-headers" if $branch =~ /^vcl-linking-randr/;
+    return "layout-plugin" if $branch =~ /^layout-tab/;
+    return "link-as-needed" if $branch =~ /^emf\+/;
+    return "linkwarn-svtools-miscopts-bits" if $branch =~ /^ui-desktop-integration/;
+    return "lwp-filter-component" if $branch =~ /^ooxml/;
+    return "novell-win32-odma" if $branch =~ /^linkwarn-svtools-miscopts-bits/;
+    return "ooo64508.vcl.honourfontconfighinting" if $branch =~ /^ooo59127.vcl.honourcairofont/;
+    return "sc-dataform" if $branch =~ /^(sc-copy-on-merged-cells|sc-datapilot)/;
+    return "sc-datapilot" if $branch =~ /^sc-dp-gridlayout/;
+    return "sc-datapilot", "sc-paste-on-enter" if $branch =~ /^cws-scsheetprotection/;
+    return "sc-export-shape-macro-bindings" if $branch =~ /^sc-export-shape-hlink-bindings/;
+    return "sc-hrc-ooo-build-resources" if $branch =~ /^sc-dataform/;
+    return "sc-natural-sort" if $branch =~ /sc-simple-sort-include-format-header/;
+    return "sc-paste-on-enter" if $branch =~ /^cws-scsheetprotection/;
+    return "sfx2-pre-and-postprocess-during-save-load" if $branch =~ /^sfx2-pre-and-postprocess-crash-fix/;
+    return "sfx2-remove-check-update-on-fileload" if $branch =~ /^sfx2-pre-and-postprocess-during-save-load/;
+    return "speed-symbolic-functions" if $branch =~ /^speed-bdirect/;
+    return "store-core" if $branch =~ /^speed-store-lck/;
+    return "system-lpsolve" if $branch =~/static-libs-use-_pic/;
+    return "tools-qa-urlobj-unittest", "gnome-vfs-late-init" if $branch =~ /^unittesting/;
+    return "vba" if $branch =~ /^sc-toggle-merge-center/;
+    return "wpsimport" if $branch =~ /^wpgimport/;
+    return "unxsplash" if $branch =~ /^oosplash-etc-openoffice-sofficerc/;
+	
+    return "pristine";
+}
+
+sub git_count_commits
+{
+    return 0 + git_pipe "git log --pretty=oneline | wc -l";
+}
+
+sub git_patch_branch
+{
+    my $patch = shift;
+    $patch =~ /([^\/]+)\/([^\/]+)[.](diff|patch)$/;
+    my $dir = $1;
+    my $base = $2;
+    $base =~ s/[0-9]$// if $base !~ /chart2|helpcontent2|javainstaller2|scp2|sfx2|sj2|stlport5|testshl2|transex3|[0-9][0-9]+$/;
+    my $branch = git_get_branch $base, $dir;
+    my @depend = git_get_depend $branch;
+    print "DIR: $dir\n" if $git_debug;
+    print "BASE: $base\n" if $git_debug;
+    print "DEPEND[0]: $depend[0]\n" if $git_debug;
+    print "DEPEND...:" . join "," if $#depend > 1 && $git_debug;
+    print "BRANCH: $branch\n" if $git_debug;
+    git_commit "Apply $patch.";
+    git_system "git branch $branch $depend[0]" if !git_has_branch $branch;
+    git_select_branch $branch;
+    foreach my $d (@depend[1..$#depend]) { git_system "git rebase $d"; }
+    my $log = git_pipe "git log -1 patched";
+    $log =~ /^commit (.*)/;
+    my $commit = $1;
+#    git_system "git cherry-pick $commit";
+    my $status = system "cd $dest_dir && git cherry-pick $commit";
+    if ($status)
+    {
+	print "FIXME: patch depends on earlier patches: $patch\n";
+	if (git_count_commits == 1)
+	{
+	    # Single-patch branch, or first patch of multiple-patch branch
+	    git_system "git reset --hard HEAD";
+	    git_system "git clean -f";
+	    git_system "git checkout patched";
+	    git_system "git branch -D $branch";
+	    git_system "git branch DEPENDENCY-$branch patched";
+	    git_system "git tag FIXME-branched-from-patched-$base DEPENDENCY-$branch";
+	}
+	else
+	{
+	    # Non-first patch in multiple-patch branch
+	    # Hitting this if our patch is not the first in this branch
+	    # would be extra ugly
+	    print "FIXME: conflict in multiple-patch branch: $branch, $patch\n";
+	    git_commit "Conflicts cherry-picking $commit ($patch).";
+	    git_system "git checkout patched";
+	    git_system "git branch -m $branch CONFLICTS-$base";
+	    git_system "git branch $branch patched";
+	    git_system "git tag FIXME-branched-from-patched-$base $branch";
+	}
+    }
+    git_select_branch "patched";
+}
+# end git
+
 (@ARGV > 1) ||
     die "Syntax:\n".
-    "apply <path-to-patchdir> <src root> --tag=<src680-m90> [--distro=<Debian> [--distro=<Binfilter> [...]]] [--quiet] [--dry-run] [ patch flags ]\n" .
+    "apply <path-to-patchdir> <src root> --tag=<src680-m90> [--distro=<Debian> [--distro=<Binfilter> [...]]] [--quiet] [--dry-run] [--with-git] [ patch flags ]\n" .
     "apply <path-to-patchdir> --series-from=<Debian>\n" .
     "apply <path-to-patchdir> --add-developer\n" .
     "apply <path-to-patchdir> --find-unused\n" .
@@ -1066,6 +1328,8 @@
 	    $tag = $1;
 	} elsif ($a =~ m/--dry-run/g) {
 	    $dry_run = 1;
+	} elsif ($a =~ m/--with-git/g) {
+	    $ENV{"OOO_GIT"} = $a;
 	} else {
 	    push @arguments, $a;
 	}
@@ -1115,11 +1379,15 @@
 	$base_cmd = 'sed \'s/^\(@.*\)\r$/\1/\' | ' . $base_cmd;
     }
 
+    git_prepare if $ENV{"OOO_GIT"};
+
     if ($remove) {
 	remove_patches();
     } else {
 	apply_patches();
     }
+
+    git_postpare if $ENV{"OOO_GIT"};
 }
 
 # vim: ts=4 sw=4 noet
Index: patches/sections.py
===================================================================
--- patches/sections.py	(revision 0)
+++ patches/sections.py	(revision 0)
@@ -0,0 +1,120 @@
+#! /usr/bin/python
+
+# sections.py - silly one-shot stab at creating some apply [Section]s as branches
+#               after running apply.pl --with-git
+#
+# Usage: python patches/sections.py BUILD-DIR-WITH-GIT
+
+import os
+import re
+import sys
+
+def remove_cruft (s):
+    s = s[s.index ('\n['):]
+    s = re.sub ('\nSection.*', '\n', s)
+    s = re.sub ('(i|n)#[0-9]+', '', s)
+    s = re.sub ('\n#.*', '\n', s)
+    s = re.sub ('\n#.*', '\n', s)
+    s = re.sub (',.*', '\n', s)
+    s = re.sub ('[:space:]+\n', '\n', s)
+    s = re.sub (']', '', s)
+    s = re.sub (' ', '', s)
+    s = re.sub ('\n+', '\n', s)
+    return s
+
+class SystemFailed:
+    def __init__ (self, s):
+        pass
+
+def system (command, raise_on_error=True):
+    dir = git_dir
+    command = 'cd %(dir)s && %(command)s' % locals ()
+    print 'executing: %(command)s' % locals ()
+    status = os.system (command)
+    if status and raise_on_error:
+        raise SystemFailed ('Command failed: %(command)s' % locals ())
+
+def read_pipe (command, raise_on_error=True):
+    dir = git_dir
+    command = 'cd %(dir)s && %(command)s' % locals ()
+    pipe = os.popen (command)
+    output = pipe.read ()
+    if pipe.close () and raise_on_error:
+        raise SystemFailed ('Pipe failed: %(command)s' % locals ())
+    return output
+
+commits = {}
+def get_commit (patch):
+    global commits
+    if not commits:
+        log = read_pipe ('git log --pretty=oneline patched')
+        def grok_log_line (s):
+            m = re.match ('([^ ]+) Apply.*/([^/]+[.](diff|patch))', s)
+            if not m:
+                print 'Skipping line:%(s)s:' % locals ()
+                return None, None
+            return m.group (2), m.group (1)
+        commits = dict (map (grok_log_line, log.split ('\n')[:-2]))
+    return commits.get (patch, None)
+
+sections = {}
+def section_branch (s):
+    lst = s.split ('\n')[:-1]
+    name = lst[0]
+    count = sections.get (name, 1)
+    sections[name] = count + 1
+    if count > 1:
+        name += '%(count)d' % locals ()
+    name = 'section/%(name)s' % locals ()
+    lines = len (lst)
+    if lines <= 1:
+        return
+    first_patch = last_patch = lst[1]
+    if lines > 2:
+        last_patch = lst[-1]
+
+    # Some dependency fixups
+    if name == 'section/LinuxOnly':
+        first_patch = 'sc-hrc-ooo-build-resources.diff'
+
+    first_commit = get_commit (first_patch)
+    last_commit = get_commit (last_patch)
+    if not first_commit:
+        print 'FIXME: no commit for %(first_patch)s' % locals ()
+        return
+    if not last_commit:
+        print 'FIXME: no commit for %(last_patch)s' % locals ()
+        return
+    print 'Section: %(name)s (%(first_patch)s .. %(last_patch)s)' % locals ()
+    def p (s, raise_on_error=False):
+        print s
+    ##system = p
+    try:
+        system ('git checkout pristine')
+        system ('git checkout -b "%(name)s" %(last_commit)s' % locals ())
+        system ('git rebase --onto pristine %(first_commit)s~1 "%(name)s"' % locals ())
+        commit_count = int (read_pipe ('git log --pretty=oneline "%(name)s" | wc -l' % locals ()))
+        if commit_count != lines:
+            # smoke-test fails, remove branch
+            print 'FIXME: %(name)s has %(commit_count)d patches, expecting %(lines)d' % locals ()
+            print read_pipe ('git log --pretty=oneline "%(name)s"' % locals ())
+            system ('git checkout pristine')
+            system ('git branch -D "%(name)s"' % locals ())
+    except:
+        system ('git rebase --abort', raise_on_error=False)
+        system ('git reset --hard HEAD')
+        system ('git checkout pristine')
+        system ('git branch -D "%(name)s"' % locals ())
+
+git_dir = 'build/dev300-m19'
+def main ():
+    global git_dir
+    if len (sys.argv) > 1:
+        git_dir = sys.argv[1]
+    apply = os.getcwd () + '/patches/dev300/apply'
+    apply_string = remove_cruft (file (apply).read ())
+    for section in apply_string.split ('[')[1:]:
+        section_branch (section)
+        
+if __name__ == '__main__':
+    main ()
Index: bin/create-gitignores.sh
===================================================================
--- bin/create-gitignores.sh	(revision 12949)
+++ bin/create-gitignores.sh	(working copy)
@@ -15,22 +15,41 @@
         [ -d "$D" ] && echo "$B" >> "$D/.gitignore"
     fi
 done << EOF
-/applied_patches
+*-
+*-HEAD
+*-git
+*-patched
+*-pristine
+*.bak
+*.cxx-*
+*.git
+*.hxx-*
+*.orig
+*.patched
+*.pristine
+*.pyc
+*~
+.\#*
 /Linux*Env.Set*
 /bootstrap
 /makefile.mk
+/solver
+CVS
+TAGS
+\#*
+localize.sdf
 unxlng*.pro
-localize.sdf
-/solver
-*.orig
 config_office/autom4te.cache/
 config_office/config.log
 config_office/config.parms
 config_office/config.status
 config_office/configure
 config_office/set_soenv
+config_office/visibility.cxx
+config_office/visibility.s
 config_office/warn
 default_images/introabout/intro-save.bmp
+default_images/introabout/intro.bmp
 default_images/svx/res/openabout_ark.png
 default_images/svx/res/openabout_translateorgza.png
 default_images/sw/res/go-oo-team.png
@@ -88,11 +107,16 @@
 dmake/win95/.deps/
 dmake/win95/microsft/.deps/
 instsetoo_native/res/banner_nld.bmp
+instsetoo_native/res/banner_ooop.bmp
 instsetoo_native/res/nologoinstall_nld.bmp
+instsetoo_native/res/nologoinstall_ooop.bmp
 instsetoo_native/util/OpenOffice
+sd/xml/transitions-ogl.xml
 setup_native/source/win32/nsis/ooobanner_nld.bmp
+setup_native/source/win32/nsis/ooobanner_ooop.bmp
 setup_native/source/win32/nsis/ooobitmap_nld.bmp
+setup_native/source/win32/nsis/ooobitmap_ooop.bmp
 setup_native/source/win32/nsis/ooosetup_nld.ico
-solenv/unxlngx6/
+solenv/unxlngx*/
 svx/res/
 EOF
Index: Makefile.shared
===================================================================
--- Makefile.shared	(revision 12949)
+++ Makefile.shared	(working copy)
@@ -31,6 +31,9 @@
 		if test -n "$(OOO_ADDITIONAL_SECTIONS)" ; then \
 			FLAGS="$$FLAGS --additional-sections=$(OOO_ADDITIONAL_SECTIONS)"; \
 		fi ; \
+		if test -n "$(OOO_GIT)" ; then \
+			FLAGS="$$FLAGS --with-git=$(OOO_GIT)"; \
+		fi ; \
 		chmod +x $(TOOLSDIR)/patches/apply.pl && $(TOOLSDIR)/patches/apply.pl $(APPLY_DIR) $(OOBUILDDIR) $$FLAGS -f -R ; \
 	fi
 	cd $(top_srcdir)/bin ; ./unpack
@@ -97,8 +100,14 @@
 	if test -n "$(OOO_ADDITIONAL_SECTIONS)" ; then \
 		FLAGS="$$FLAGS --additional-sections=$(OOO_ADDITIONAL_SECTIONS)"; \
 	fi ; \
+	if test -n "$(OOO_GIT)" ; then \
+	   	FLAGS="$$FLAGS --with-git=$(OOO_GIT)"; \
+	fi ; \
 	chmod +x $(TOOLSDIR)/patches/apply.pl && $(TOOLSDIR)/patches/apply.pl $(APPLY_DIR) $(OOBUILDDIR) $$FLAGS --tag=$(CVSTAG) ;
 	$(TOOLSDIR)/bin/transform --apply $(TOOLSDIR) $(OOBUILDDIR)
+	if test -n "$(OOO_GIT)" ; then \
+		cd $(OOBUILDDIR) && git commit -am 'Font munging.'; \
+	fi ; \
 	$(TOOLSDIR)/bin/fix-deps $(OOBUILDDIR)
 	rm -f $(STAMP_DIR)/build
 	touch $@
Index: configure.in
===================================================================
--- configure.in	(revision 12949)
+++ configure.in	(working copy)
@@ -328,6 +328,11 @@
 			  Example: --with-drink=coffee],
 ,)
 
+AC_ARG_WITH(git,
+[
+  --with-git              Use GIT to manage your patches],
+,)
+
 dnl
 dnl Items here only to make --help work nicely:
 dnl 
@@ -1098,6 +1103,19 @@
 fi
 AC_MSG_RESULT([$build_product])
 
+AC_MSG_CHECKING([whether to use GIT])
+if test -z "$with_git" -o "$with_git" = "no"; then
+    unset OOO_GIT
+    AC_MSG_RESULT([no])
+else
+    OOO_GIT=git
+    if test "z$with_git" != "zyes"; then
+        OOO_GIT=$with_git
+    fi
+    AC_MSG_RESULT([$OOO_GIT])
+fi
+AC_SUBST(OOO_GIT)
+
 UPSTREAM_NAME=
 UPSTREAM_SOURCE=
 UPSTREAM_URI=

