From 8a937bd354001a190dbe66538aacb353e7c99341 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Tue, 9 Nov 2010 17:28:58 +0100 Subject: Import upstream version 0.11~rc8~r2714 --- infrastructure/BoxPlatform.pm.in | 4 +- infrastructure/makebuildenv.pl.in | 19 +++++--- infrastructure/makedistribution.pl.in | 70 ++++++++++++----------------- infrastructure/makeparcels.pl.in | 85 ++++++++++++++++++++++++++--------- 4 files changed, 109 insertions(+), 69 deletions(-) (limited to 'infrastructure') diff --git a/infrastructure/BoxPlatform.pm.in b/infrastructure/BoxPlatform.pm.in index 8657134e..59ab5d85 100644 --- a/infrastructure/BoxPlatform.pm.in +++ b/infrastructure/BoxPlatform.pm.in @@ -89,14 +89,14 @@ BEGIN my $cpus = `sysctl hw.ncpu`; if($cpus =~ m/hw.ncpu:\s(\d+)/ && $1 > 1) { - print "$1 processors detected, will set make to perform concurrent jobs\n"; + print STDERR "$1 processors detected, will set make to perform concurrent jobs\n"; $sub_make_options = ' -j '.($1 + 1); } # test for fink installation if(-d '/sw/include' && -d '/sw/lib') { - print "Fink installation detected, will use headers and libraries\n"; + print STDERR "Fink installation detected, will use headers and libraries\n"; $platform_compile_line_extra = '-I/sw/include '; $platform_link_line_extra = '-L/sw/lib '; } diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in index 5ed4a0ab..9f53e2c6 100755 --- a/infrastructure/makebuildenv.pl.in +++ b/infrastructure/makebuildenv.pl.in @@ -55,7 +55,7 @@ while() my $dir = $1; open FL,$file or die "Can't open $_ for reading"; my %vars; - $vars{PERL} = "@PERL@"; + $vars{_PERL} = "@PERL@"; my $do_cmds = 0; while() { @@ -428,9 +428,16 @@ __E if (-d "$module/testfiles") { print TESTFILE <<__E; +kill_daemons() +{ + kill_process bbackupd + kill_process bbstored + kill_process httpserver + kill_process s3simulator +} + echo Killing any running daemons... -kill_process bbackupd -kill_process bbstored +kill_daemons __E } @@ -457,8 +464,7 @@ __E if (-d "$module/testfiles") { print TESTFILE <<__E; -kill_process bbackupd -kill_process bbstored +kill_daemons __E } @@ -584,6 +590,7 @@ _LINK = \$(CXX) _WINDRES = \$(WINDRES) _AR = \$(AR) _RANLIB = \$(RANLIB) +_PERL = \$(PERL) .else HIDE = @ _CXX = @ echo " [CXX] " \$(*F) && \$(CXX) @@ -591,6 +598,7 @@ _LINK = @ echo " [LINK] " \$(*F) && \$(CXX) _WINDRES = @ echo " [WINDRES]" \$(*F) && \$(WINDRES) _AR = @ echo " [AR] " \$(*F) && \$(AR) _RANLIB = @ echo " [RANLIB] " \$(*F) && \$(RANLIB) +_PERL = @ echo " [PERL] " \$(*F) && \$(PERL) >/dev/null .endif __E @@ -604,6 +612,7 @@ _LINK = \$(if \$(V),\$(CXX), @ echo " [LINK] \$@" && \$(CXX)) _WINDRES = \$(if \$(V),\$(WINDRES), @ echo " [WINDRES] \$<" && \$(WINDRES)) _AR = \$(if \$(V),\$(AR), @ echo " [AR] \$@" && \$(AR)) _RANLIB = \$(if \$(V),\$(RANLIB), @ echo " [RANLIB] \$@" && \$(RANLIB)) +_PERL = \$(if \$(V),\$(PERL), @ echo " [PERL] \$@" && \$(PERL) >/dev/null) __E } diff --git a/infrastructure/makedistribution.pl.in b/infrastructure/makedistribution.pl.in index 3914780a..0ccd92be 100755 --- a/infrastructure/makedistribution.pl.in +++ b/infrastructure/makedistribution.pl.in @@ -12,12 +12,15 @@ my %comment_chars = ('cpp' => '// ', 'h' => '// ', 'pl' => '# ', 'pm' => '# ', ' my %text_files = ('txt' => 1, 'spec' => 1, 'in' => 1); # files which don't get the license added -my %no_license = (); # 'filename' => 1 +# my %file_license = (); # 'filename' => 'GPL', 'DUAL' or 'none' # ---------------------------------------------- # filled in from the manifest file -my %no_license_dir = (); +# my %dir_license = (); # 'dir' => 'GPL', 'DUAL' or 'none' +# +# most recently specified LICENSE become default until overridden +my $current_license; # 'GPL', 'DUAL' or 'none' # distribution name my $distribution = $ARGV[0]; @@ -68,12 +71,17 @@ system "rm -rf $base_name"; system "rm $base_name.tgz"; mkdir $base_name,0755; -# get license file -open LICENSE,"$dist_root/LICENSE.txt" or die "Can't open $dist_root/LICENSE.txt"; -my $license_f; -read LICENSE,$license_f,100000; -close LICENSE; -my @license = ('distribution '.$base_name.' (svn version: '.$svnversion.')',split(/\n/,$license_f)); +# get license files +my %license_text; # name of license => array of lines of license text +foreach my $license ("GPL", "DUAL") +{ + my $file = "./LICENSE-$license.txt"; + open LICENSE, $file or die "Can't open $file: $!"; + my @lines = ; + close LICENSE; + unshift @lines, "distribution $base_name (svn version: $svnversion)\n"; + $license_text{$license} = \@lines; +} # copy files, make a note of all the modules included my %modules_included; @@ -88,41 +96,22 @@ sub copy_from_list { next unless $line =~ m/\S/; chomp $line; - my ($src,$dst,$other) = split /\s+/, $line; + my @words = split /\s+/, $line; + my ($src,$dst,$other) = @words; $dst = $src if $dst eq ''; if($src eq 'MKDIR') { # actually we just need to make a directory here mkdir "$base_name/$dst",0755; } - elsif($src eq 'NO-LICENSE-IN-DIR') + elsif($src eq 'LICENSE') { - my ($junk,$spec) = split /\s+/, $line; - # record that this directory shouldn't have the license added - $no_license_dir{$dst} = 1; - - # actually copy it, to remove redundancy in manifests - $src = $dst; - $dst = $other; - $dst = $src if $dst eq ''; - $modules_included{$spec} = 1; - copy_dir($src,$dst); + $current_license = $dst; } elsif($src eq 'REPLACE-VERSION-IN') { replace_version_in($dst); } - elsif($src eq 'NO-LICENSE') - { - $no_license{$dst} = 1; - - # actually copy it, to remove redundancy in manifests - $src = $dst; - $dst = $other; - $dst = $src if $dst eq ''; - - copy_file($src,$dst); - } elsif($src eq 'RUN') { my ($junk,$cmd) = split /\s+/, $line, 2; @@ -189,21 +178,17 @@ sub copy_file my $ext; $ext = $1 if $fn =~ m/\.(\w+)\Z/; - - # licenses not used in this directory? - my $license_in_dir = 1; $dst_fn =~ m~\A(.+)/[^/]+?\Z~; - $license_in_dir = 0 if exists $no_license_dir{$1}; # licensed or not? - if(exists $comment_chars{$ext} && !exists $no_license{$fn} && $license_in_dir) + if(exists $comment_chars{$ext} && $current_license ne "none") { # copy as text, inserting license # print "source copy $fn to $base_name/$dst_fn\n"; my $in = gensym; - open $in,$fn; - open OUT,">$base_name/$dst_fn"; + open $in,$fn or die "$fn: $!"; + open OUT,">$base_name/$dst_fn" or die "$base_name/$dst_fn: $!"; my $first = <$in>; if($first =~ m/\A#!/) @@ -214,9 +199,10 @@ sub copy_file # write license my $b = $comment_chars{$ext}; - for(@license) + my $this_license = $license_text{$current_license}; + for (@$this_license) { - print OUT $b,$_,"\n" + print OUT $b, $_; } if($first ne '') @@ -241,8 +227,8 @@ sub copy_file # print "text copy $fn to $base_name/$dst_fn\n"; my $in = gensym; - open $in,$fn; - open OUT,">$base_name/$dst_fn"; + open $in,$fn or die "$fn: $!"; + open OUT,">$base_name/$dst_fn" or die "$base_name/$dst_fn: $!"; while(<$in>) { diff --git a/infrastructure/makeparcels.pl.in b/infrastructure/makeparcels.pl.in index cc54b23f..41dab287 100755 --- a/infrastructure/makeparcels.pl.in +++ b/infrastructure/makeparcels.pl.in @@ -66,6 +66,19 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file"; next; } next if (m'\AEND-ONLY'); + + if (m'\AEXCEPT:(.+)') + { + if (os_matches($1)) + { + while () + { + last if m'\AEND-EXCEPT'; + } + } + next; + } + next if (m'\AEND-EXCEPT'); # new parcel, or a new parcel definition? if(m/\A\s+(.+)\Z/) @@ -102,25 +115,7 @@ __E print MAKE "all:\t",join(' ',map {"build-".$_} @parcels),"\n\n"; -print MAKE "clean:\n"; -for my $parcel (@parcels) -{ - print MAKE "\trm -rf ", BoxPlatform::parcel_dir($parcel), "\n"; - print MAKE "\trm -f ", BoxPlatform::parcel_target($parcel), "\n"; -} - -if ($build_os eq 'CYGWIN') -{ - print MAKE "\tfind release debug -type f | xargs -r rm -f\n"; -} -else -{ - print MAKE "\tfind release debug -type f -exec rm -f {} \\;\n"; -} - print MAKE <<__END_OF_FRAGMENT; - \$(MAKE) -C docs clean - test: release/common/test release/common/test: @@ -133,6 +128,7 @@ docs: __END_OF_FRAGMENT my $release_flag = BoxPlatform::make_flag('RELEASE'); +my @clean_deps; for my $parcel (@parcels) { @@ -228,6 +224,38 @@ docs/man/${name}.gz: EOF push @parcel_deps, "$dir/${name}.gz"; } + elsif($type eq 'html') + { + print MAKE <