diff options
author | Reinhard Tartler <siretart@tauware.de> | 2009-04-02 13:58:11 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2009-04-02 13:58:11 +0200 |
commit | a84d45498bd861c9225080232948a99c2e317bb8 (patch) | |
tree | 8f1f5fb7bf7ffbf6f24cf4a4fd6888a235dbcc08 /infrastructure/makedistribution.pl.in | |
parent | 25db897553a0db0f912602b375029e724f51556e (diff) |
Import upstream version 0.11~rc3~r2491
Diffstat (limited to 'infrastructure/makedistribution.pl.in')
-rwxr-xr-x | infrastructure/makedistribution.pl.in | 67 |
1 files changed, 41 insertions, 26 deletions
diff --git a/infrastructure/makedistribution.pl.in b/infrastructure/makedistribution.pl.in index 2ef8b960..3914780a 100755 --- a/infrastructure/makedistribution.pl.in +++ b/infrastructure/makedistribution.pl.in @@ -7,7 +7,9 @@ use Symbol; my %comment_chars = ('cpp' => '// ', 'h' => '// ', 'pl' => '# ', 'pm' => '# ', '' => '# '); # other extensions which need text copying, just to remove the private stuff -my %text_files = ('txt' => 1, 'spec' => 1); +# .in is included here, as these could be any kind of source, but clearly +# they have text substitutions run on them by autoconf, so we can too :) +my %text_files = ('txt' => 1, 'spec' => 1, 'in' => 1); # files which don't get the license added my %no_license = (); # 'filename' => 1 @@ -113,6 +115,13 @@ sub copy_from_list 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') { @@ -189,9 +198,9 @@ sub copy_file # licensed or not? if(exists $comment_chars{$ext} && !exists $no_license{$fn} && $license_in_dir) { - my $b = $comment_chars{$ext}; - # 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"; @@ -204,6 +213,7 @@ sub copy_file } # write license + my $b = $comment_chars{$ext}; for(@license) { print OUT $b,$_,"\n" @@ -225,31 +235,32 @@ sub copy_file close OUT; close $in; } - else + elsif(exists $text_files{$ext}) { - if(exists $text_files{$ext}) - { - # copy this as text, to remove private stuff - my $in = gensym; - open $in,$fn; - open OUT,">$base_name/$dst_fn"; + # copy this as text, to remove private stuff + # print "text copy $fn to $base_name/$dst_fn\n"; - while(<$in>) - { - unless(skip_non_applicable_section($_, $in, $fn)) - { - print OUT - } - } - - close OUT; - close $in; - } - else + my $in = gensym; + open $in,$fn; + open OUT,">$base_name/$dst_fn"; + + while(<$in>) { - # copy as binary - system 'cp',$fn,"$base_name/$dst_fn" - } + unless(skip_non_applicable_section($_, $in, $fn)) + { + print OUT + } + } + + close OUT; + close $in; + } + else + { + # copy as binary + # print "binary copy $fn to $base_name/$dst_fn\n"; + my $cmd = "cp -p $fn $base_name/$dst_fn"; + system($cmd) == 0 or die "copy failed: $cmd"; } # copy executable bit from src @@ -332,7 +343,11 @@ sub copy_dir next if m/\AMakefile\Z/; next if m/\Aautogen/; next if m/-smf-method\Z/; # copy only the .in versions - next if m/-manifest.xml\Z/; # copy onlt the .in versions + next if m/-manifest.xml\Z/; # copy only the .in versions + if($dir eq 'docs') { + next if m/.(x[sm]l|tmpl)\Z/; # don't include doc sources + next if m/generate_except_xml.pl/; + } next if !-f "$dir/$_"; copy_file("$dir/$_","$dst_dir/$_"); |