[ooo-build-commit] build/bin build/src Makefile.am solenv/bin

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Jul 7 08:11:32 PDT 2009


 Makefile.am                            |    2 
 build/bin/copyexcept                   |   85 +++++++++++++++++++++++++++++++++
 build/src/.gitignore                   |    2 
 build/src/Makefile.common              |   19 +++++++
 solenv/bin/modules/installer/worker.pm |    4 +
 5 files changed, 110 insertions(+), 2 deletions(-)

New commits:
commit c4b243189a3b791c6641f8e67e21be8a8156f23a
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Tue Jul 7 16:58:51 2009 +0200

    Split build: Share the common Makefile rules.
    
    * Makefile.am: Update to install the Makefile.common.
    * build/bin/copyexcept: Needed for installation of solver bits.
    * build/src/.gitignore: Ignore more stuff.
    * build/src/Makefile.common: The common Makefile rules.
    * solenv/bin/modules/installer/worker.pm: Skip existing symlinks.

diff --git a/Makefile.am b/Makefile.am
index 348b3ce..c08ee5d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,8 +36,10 @@ install-data-local: $(stampdir)/all
 	cp -r $(top_builddir)/solenv $(DESTDIR)$(ooo_prefix)/
 	cp -r $(top_builddir)/solver $(DESTDIR)$(ooo_prefix)/
 	$(INSTALL_DATA) $(top_builddir)/Linux*Env.Set.sh $(DESTDIR)$(solverdir)/
+	$(INSTALL_DATA) $(top_builddir)/build/src/Makefile.common $(DESTDIR)$(solverdir)/
 	$(INSTALL_DATA) $(top_builddir)/build/src/buildenv-common $(DESTDIR)$(solverdir)/
 	$(INSTALL_DATA) $(top_builddir)/build/src/OpenOffice.org-bootstrap.pc $(DESTDIR)$(pkgconfigdir)/
+	$(INSTALL_SCRIPT) $(top_builddir)/build/bin/copyexcept $(DESTDIR)$(ooo_prefix)/solenv/bin
 
 $(stampdir)/all: $(stampdir)/bootstrap
 	( . ./Linux*Env.Set.sh ; \
diff --git a/build/bin/copyexcept b/build/bin/copyexcept
new file mode 100755
index 0000000..bf12053
--- /dev/null
+++ b/build/bin/copyexcept
@@ -0,0 +1,85 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Copy;
+
+sub syntax()
+{
+    print "copyexcept [-x exception-file] <src> <dest>\n";
+    print "  -x: file containing list of files not to copy\n";
+    print "  -v: verbose\n";
+    print "  --help: this message\n";
+}
+
+sub copy_recursive($$$$);
+sub copy_recursive($$$$)
+{
+    my ($excepts, $src, $dest, $verbose) = @_;
+
+    if (defined $excepts->{$src}) {
+        print "skipping $src\n" if ( $verbose );
+        return;
+    }
+
+    if (-d $src) {
+        print "mkdir -p $dest\n" if ( $verbose );
+        system("mkdir -p $dest") == 0 || die "Failed to mkdir -p $dest: $!";
+
+        my $dir;
+        opendir ($dir, $src) || die "Can't open dir $src: $!";
+        my @entries;
+        while (my $name = readdir ($dir)) {
+            $name =~ /^\./ && next;
+            $name =~ /^\s*$/ && next;
+            copy_recursive ($excepts, "$src/$name", "$dest/$name", $verbose);
+        }
+        closedir ($dir);
+    } elsif (-f $src) {
+        print "syscopy $src -> $dest\n" if ( $verbose );
+        File::Copy::copy ($src, $dest) || die "Failed to copy $src -> $dest: $!";
+        my $perm = (stat $src)[2];
+        chmod ($perm, $dest);
+    } else {
+        print "skipping link $src\n" if ( $verbose );
+    }
+}
+
+# main ...
+my (@src, $dest, $except, $verbose);
+
+while (my $arg = shift @ARGV) {
+    if ($arg eq '-h' || $arg eq '--help') {
+        syntax();
+        exit 0;
+    } elsif ($arg eq '-x') {
+        $except = shift @ARGV;
+    } elsif ($arg eq '-v') {
+        $verbose = 1;
+    } else {
+        push @src, $arg;
+    }
+}
+
+$dest = pop @src;
+ at src && defined $dest || die "Missing src or dest\n";
+
+system("mkdir -p $dest") == 0 || die "Failed to mkdir -p $dest: $!";
+
+my $ef;
+my %exceptions;
+if ( defined $except && $except ne '' ) {
+    open ($ef, $except) || die "Can't open $except: $!";
+    while (<$ef>) {
+        chomp;
+        # pre-process ?
+        $exceptions{$_} = '1';
+    }
+    close ($ef);
+}
+
+for my $s (@src) {
+    my $suffix = $s;
+    $suffix =~ s|^.*/||g;
+    print "Copy $s -> $dest/$suffix\n" if ( $verbose );
+    copy_recursive (\%exceptions, $s, "$dest/$suffix", $verbose);
+}
diff --git a/build/src/.gitignore b/build/src/.gitignore
index 678808b..840ea15 100644
--- a/build/src/.gitignore
+++ b/build/src/.gitignore
@@ -1 +1 @@
-/OpenOffice.org-bootstrap.pc
+/OpenOffice.org-*.pc
diff --git a/build/src/Makefile.common b/build/src/Makefile.common
new file mode 100644
index 0000000..db58cde
--- /dev/null
+++ b/build/src/Makefile.common
@@ -0,0 +1,19 @@
+# the common rules
+
+# TODO more in dist-hook, likeremove .o's in dmake, stuff in build/stamp, etc.
+# [basically everything that we have in .gitignores ;-)]
+dist-hook-common:
+	git log --date=short --pretty="format:@%cd  %an  <%ae>  [%H]%n%n%s%n%n%e%b" | sed -e "s|^\([^@]\)|\t\1|" -e "s|^@||" >$(distdir)/ChangeLog
+	rm -rf $(distdir)/*/unxlng*.pro
+
+install-data-common:
+	( . buildenv -i ; \
+	  export PRODUCT="OpenOffice" ; \
+	  perl -w $(solenvdir)/bin/make_installer.pl \
+	       -f $(ooo_prefix)/instsetoo_native/util/openoffice.lst \
+	       -l 'en-US' -p "$$PRODUCT" -buildid "$$BUILD" -destdir "$(DESTDIR)$(ooo_prefix)" \
+	       -dontstrip -verbose -simple "/" )
+	$(solenvdir)/bin/copyexcept $(top_builddir)/solver $(DESTDIR)$(ooo_prefix)/
+
+all-common:
+	( . buildenv ; cd build ; build.pl --all $$WITH_CPUS -- $$WITH_ICECREAM )
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index 943d63c..b47ba2f 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -820,7 +820,9 @@ sub install_simple ($$$$$$)
         my $destinationfile = $onelink->{'destinationfile'};
     
         # print "link $destinationfile -> $destdir$destination\n";
-        symlink ("$destinationfile", "$destdir$destination") || die "Can't create symlink: $!";
+        if ( !symlink ("$destinationfile", "$destdir$destination") && !$installer::globals::split ) {
+            die "Can't create symlink: $!";
+        }
         push @lines, "$destination\n";
     }
 


More information about the ooo-build-commit mailing list