diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-12-04 14:18:58 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:48:10 +0100 |
commit | e736a215cecd0b6cb7a735313b8be59114dec68d (patch) | |
tree | d6f01d6d0c0485cad6f1d648f98e32670e3de8f8 /source4 | |
parent | e7279ac7c1e8a79f8c667437aeb8b9fa9c255488 (diff) | |
download | samba-e736a215cecd0b6cb7a735313b8be59114dec68d.tar.gz samba-e736a215cecd0b6cb7a735313b8be59114dec68d.tar.bz2 samba-e736a215cecd0b6cb7a735313b8be59114dec68d.zip |
r26290: build: split add_dir() into add_dir_str() and add_dir_array()
metze
(This used to be commit e0754868dfa868900f84266f155a236fd13b0ea3)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/build/smb_build/output.pm | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 17d5755348..d9c05530b3 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -8,26 +8,35 @@ package output; use strict; -sub add_dir($$) +sub add_dir_str($$) { - my ($dir,$files) = @_; - my @ret = (); + my ($dir,$file) = @_; my $dirsep = "/"; $dir =~ s/^\.$//g; $dir =~ s/^\.\///g; $dirsep = "" if ($dir eq ""); - - foreach (@$files) { - if (substr($_, 0, 1) ne "\$") { - $_ = "$dir$dirsep$_"; - s/([^\/\.]+)\/\.\.\///g; - s/([^\/\.]+)\/\.\.\///g; - } - push (@ret, $_); + + my $ret = $file; + if (substr($ret, 0, 1) ne "\$") { + $ret = "$dir$dirsep$file"; + $ret =~ s/([^\/\.]+)\/\.\.\///g; + $ret =~ s/([^\/\.]+)\/\.\.\///g; } - + + return $ret; +} + +sub add_dir_array($$) +{ + my ($dir,$files) = @_; + my @ret = (); + + foreach (@{$files}) { + push (@ret, add_dir_str($dir, $_)); + } + return @ret; } @@ -136,7 +145,8 @@ sub create_output($$) next unless(defined($part->{OUTPUT_TYPE})); # Combine object lists - push(@{$part->{OBJ_LIST}}, add_dir($part->{BASEDIR}, $part->{OBJ_FILES})) if defined($part->{OBJ_FILES}); + my @list = add_dir_array($part->{BASEDIR}, $part->{OBJ_FILES}); + push(@{$part->{OBJ_LIST}}, @list) if defined($part->{OBJ_FILES}); generate_binary($part) if grep(/BINARY/, @{$part->{OUTPUT_TYPE}}); generate_shared_library($part) if grep(/SHARED_LIBRARY/, @{$part->{OUTPUT_TYPE}}); |