Subversion Repositories DevTools

Rev

Rev 1596 | Rev 1600 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1596 Rev 1598
Line 2814... Line 2814...
2814
    installDpkgArchiveFile("doc", $sfile, $targetTag);
2814
    installDpkgArchiveFile("doc", $sfile, $targetTag);
2815
 
2815
 
2816
    return 1;
2816
    return 1;
2817
}
2817
}
2818
 
2818
 
2819
 
-
 
2820
#------------------------------------------------------------------------------
2819
#------------------------------------------------------------------------------
2821
sub installDpkgArchiveBinFile
2820
sub installDpkgArchiveBinFile
2822
#
2821
#
2823
# Description:
2822
# Description:
2824
#       This sub-routine is used to install a binary file from the
2823
#       This sub-routine is used to install a binary file from the
Line 2838... Line 2837...
2838
#                   --SelectFrom=xxxx       - Limits file source selection
2837
#                   --SelectFrom=xxxx       - Limits file source selection
2839
#                                             By default all LIB sources are searched.
2838
#                                             By default all LIB sources are searched.
2840
#                                             The selector should be a Platform, Product
2839
#                                             The selector should be a Platform, Product
2841
#                                             ,Target or MachineType
2840
#                                             ,Target or MachineType
2842
#
2841
#
-
 
2842
#                   --Rename=xxxx           - Rename the file during the copy operation
-
 
2843
#                                             Not valid if $sfile is a ref to a list
-
 
2844
#
2843
#
2845
#
2844
# Returns         :     Nothing of use
2846
# Returns         :     Nothing of use
2845
#                       Will not return if the file is not found
2847
#                       Will not return if the file is not found
2846
#
2848
#
2847
#------------------------------------------------------------------------------
2849
#------------------------------------------------------------------------------
2848
{
2850
{
2849
    my @args;
2851
    my @args;
2850
    my $select = '_ALL_';
2852
    my $select = '_ALL_';
-
 
2853
    my $rename;
2851
 
2854
 
2852
    #
2855
    #
2853
    #   Process parameters and extract options
2856
    #   Process parameters and extract options
2854
    #
2857
    #
2855
    foreach  ( @_ )
2858
    foreach  ( @_ )
Line 2857... Line 2860...
2857
        if ( m/^--SelectFrom=(.*)/ ) {
2860
        if ( m/^--SelectFrom=(.*)/ ) {
2858
            $select = $1;
2861
            $select = $1;
2859
            Error("installDpkgArchiveBinFile: Selector not known: $_")
2862
            Error("installDpkgArchiveBinFile: Selector not known: $_")
2860
                unless ( defined $DpkgLibDirList{$select} );
2863
                unless ( defined $DpkgLibDirList{$select} );
2861
 
2864
 
-
 
2865
        } elsif ( m/^--Rename=(.+)/ ) {
-
 
2866
            $rename = $1;
-
 
2867
 
2862
        } elsif ( m/^--/ ) {
2868
        } elsif ( m/^--/ ) {
2863
            Warning ("installDpkgArchiveBinFile: Unknown option ignored: $_")
2869
            Warning ("installDpkgArchiveBinFile: Unknown option ignored: $_")
2864
 
2870
 
2865
        } else {
2871
        } else {
2866
            push @args, $_;
2872
            push @args, $_;
Line 2893... Line 2899...
2893
    unless ( ref ( $fref ) eq 'ARRAY' )
2899
    unless ( ref ( $fref ) eq 'ARRAY' )
2894
    {
2900
    {
2895
        push @one_file, $fref;
2901
        push @one_file, $fref;
2896
        $fref = \@one_file;
2902
        $fref = \@one_file;
2897
    }
2903
    }
-
 
2904
    else
-
 
2905
    {
-
 
2906
        Error ("installDpkgArchiveBinFile. --Rename option cannot be used with a list of files")
-
 
2907
            if $rename;
-
 
2908
    }
2898
 
2909
 
2899
    foreach my $sfile ( @$fref )
2910
    foreach my $sfile ( @$fref )
2900
    {
2911
    {
2901
    
2912
    
2902
        if ( "$MachType" eq "win32" )
2913
        if ( "$MachType" eq "win32" )
2903
        {
2914
        {
2904
            # if the item does not have an .exe extention
2915
            # if the item does not have an .exe extention
2905
            # we shall add one for convience.
2916
            # we shall add one for convience.
2906
            #
2917
            #
2907
            if ( $sfile !~ m/\.exe$/  &&
2918
            $sfile .= '.exe'
2908
                 $sfile !~ m/\.dll$/ )
2919
                if ( $sfile !~ m~\.(exe)|(dll)$~ );
-
 
2920
 
-
 
2921
            if ( $rename )
2909
            {
2922
            {
2910
                $sfile = $sfile . ".exe";
2923
                $rename .= '.exe'
-
 
2924
                    if ( $rename !~ m~\.(exe)|(dll)$~ );
2911
            }
2925
            }
2912
        }
2926
        }
2913
 
2927
 
2914
 
-
 
2915
        my ($i);
2928
        my ($i);
2916
        my ($foundFileFlag) = "false";
2929
        my ($foundFileFlag) = "false";
2917
        my ($m_DpkgBinDir)  = "";
2930
        my ($m_DpkgBinDir)  = "";
2918
        my ($m_srcFileLocation) = "";
2931
        my ($m_srcFileLocation) = "";
2919
        my ($m_dstFileLocation) = "";
2932
        my ($m_dstFileLocation) = "";
Line 2926... Line 2939...
2926
                next;
2939
                next;
2927
            }
2940
            }
2928
 
2941
 
2929
            # lets define the absolute location of the file
2942
            # lets define the absolute location of the file
2930
            $m_srcFileLocation = "$m_DpkgBinDir/$sfile";
2943
            $m_srcFileLocation = "$m_DpkgBinDir/$sfile";
2931
            $m_dstFileLocation = "$targetValue/$sfile";
2944
            $m_dstFileLocation = "$targetValue/" . ( $rename ? $rename : $sfile );
2932
 
2945
 
2933
            # we will check to see if the file exists.
2946
            # we will check to see if the file exists.
2934
            #
2947
            #
2935
            if ( -f "$m_srcFileLocation" )
2948
            if ( -f "$m_srcFileLocation" )
2936
            {
2949
            {