Subversion Repositories DevTools

Rev

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

Rev 6515 Rev 6531
Line 318... Line 318...
318
        #   Remove the directory for this package
318
        #   Remove the directory for this package
319
        #   Remove the general work dir - if all packages have been cleaned
319
        #   Remove the general work dir - if all packages have been cleaned
320
        #
320
        #
321
        rmtree( $WorkDirBase );
321
        rmtree( $WorkDirBase );
322
        rmtree ($opt_tarFile) if ( defined($opt_tarFile) && -f $opt_tarFile );
322
        rmtree ($opt_tarFile) if ( defined($opt_tarFile) && -f $opt_tarFile );
323
        rmtree ($opt_output) if ( -f $opt_output );
323
        rmtree ($opt_output) if ( $opt_output && -f $opt_output );
324
        exit;
324
        exit;
325
    }
325
    }
326
 
326
 
327
    #
327
    #
328
    #   NoArch sanity test
328
    #   NoArch sanity test
Line 1706... Line 1706...
1706
#                   $dst_dir    - Within the output workspace
1706
#                   $dst_dir    - Within the output workspace
1707
#                   Options
1707
#                   Options
1708
#                       --Merge                 - Don't delete first
1708
#                       --Merge                 - Don't delete first
1709
#                       --Source=Name           - Source via Symbolic Name
1709
#                       --Source=Name           - Source via Symbolic Name
1710
#                       --FromPackage           - Source via package roots
1710
#                       --FromPackage           - Source via package roots
-
 
1711
#                       --FromPackage:Name      - Source via specified package roots
1711
#                       --NoIgnoreDbgFiles      - Do not ignore .dbg and .debug files in dir copy
1712
#                       --NoIgnoreDbgFiles      - Do not ignore .dbg and .debug files in dir copy
1712
#                       --IfPresent             - Not an error if the path cannot be found
1713
#                       --IfPresent             - Not an error if the path cannot be found
1713
#                       --ConfFile              - Mark transferred files as config files
1714
#                       --ConfFile              - Mark transferred files as config files
1714
#                       --Flatten               - Copy all to one directory
1715
#                       --Flatten               - Copy all to one directory
1715
#                       --FilterOut=xxx         - Ignore files. DOS Wildcard
1716
#                       --FilterOut=xxx         - Ignore files. DOS Wildcard
Line 1733... Line 1734...
1733
    my $ignoreDbg = 1;
1734
    my $ignoreDbg = 1;
1734
    my $ignoreNoDir;
1735
    my $ignoreNoDir;
1735
    my $user_src_dir = $src_dir;
1736
    my $user_src_dir = $src_dir;
1736
    my $opt_source;
1737
    my $opt_source;
1737
    my $opt_package;
1738
    my $opt_package;
-
 
1739
    my $opt_package_name;
1738
    my @fileList;
1740
    my @fileList;
1739
    my $isFiltered;
1741
    my $isFiltered;
1740
    return 1 unless ($ActiveSection);
1742
    return 1 unless ($ActiveSection);
1741
 
1743
 
1742
    #
1744
    #
Line 1764... Line 1766...
1764
        } elsif ( m/^--Source=(.+)/ ) {
1766
        } elsif ( m/^--Source=(.+)/ ) {
1765
            Error ("Source directory can only be specified once")
1767
            Error ("Source directory can only be specified once")
1766
                if ( defined $opt_source );
1768
                if ( defined $opt_source );
1767
            $opt_source = $1;
1769
            $opt_source = $1;
1768
 
1770
 
-
 
1771
        } elsif ( m/^--FromPackage:(.+)/ ) {
-
 
1772
            Error ("FromPackage can only be specified once")
-
 
1773
                if ( defined $opt_package );
-
 
1774
            $opt_package = 1;
-
 
1775
            $opt_package_name = $1;
-
 
1776
 
1769
        } elsif ( m/^--FromPackage/ ) {
1777
        } elsif ( m/^--FromPackage/ ) {
1770
            Error ("FromPackage can only be specified once")
1778
            Error ("FromPackage can only be specified once")
1771
                if ( defined $opt_package );
1779
                if ( defined $opt_package );
1772
            $opt_package = 1;
1780
            $opt_package = 1;
1773
 
1781
 
Line 1880... Line 1888...
1880
        Verbose2 ("CopyDir: FromPackage: $src_dir");
1888
        Verbose2 ("CopyDir: FromPackage: $src_dir");
1881
 
1889
 
1882
        my @path;
1890
        my @path;
1883
        foreach my $entry ( getPackageList() )
1891
        foreach my $entry ( getPackageList() )
1884
        {
1892
        {
-
 
1893
            #
-
 
1894
            #   Locate the named package if specified
-
 
1895
            #
-
 
1896
            if (defined $opt_package_name) {
-
 
1897
                next unless ($opt_package_name eq $entry->getName() || uc($opt_package_name) eq $entry->getUnifiedName() );
-
 
1898
            }
-
 
1899
 
1885
            my $base = $entry->getBase(3);
1900
            my $base = $entry->getBase(3);
1886
            next unless ( defined $base );
1901
            next unless ( defined $base );
1887
            if ( -d $base . '/' . $src_dir )
1902
            if ( folderHasFiles( $base . '/' . $src_dir) )
1888
            {
1903
            {
1889
                push @path, $base;
1904
                push @path, $base;
1890
                $from_interface = 1
1905
                $from_interface = 1
1891
                    if ( $entry->{'TYPE'} eq 'interface' );
1906
                    if ( $entry->{'TYPE'} eq 'interface' );
1892
            }
1907
            }
Line 3077... Line 3092...
3077
    Debug("RelPath: Result: $result");
3092
    Debug("RelPath: Result: $result");
3078
    return $result;
3093
    return $result;
3079
}
3094
}
3080
 
3095
 
3081
#-------------------------------------------------------------------------------
3096
#-------------------------------------------------------------------------------
-
 
3097
# Function        : folderHasFiles  
-
 
3098
#
-
 
3099
# Description     : Detect empty folders
-
 
3100
#
-
 
3101
# Inputs          : dirname - Path to examine 
-
 
3102
#
-
 
3103
# Returns         : TRUE - Is a folder and it has files
-
 
3104
#
-
 
3105
 
-
 
3106
sub folderHasFiles {
-
 
3107
    my $dirname = shift;
-
 
3108
    my $rv = 0;
-
 
3109
 
-
 
3110
    opendir(my $dh, $dirname) or return 0;
-
 
3111
    while (readdir $dh)
-
 
3112
    {
-
 
3113
        next if ($_ eq "." || $_ eq "..");
-
 
3114
        $rv = 1;
-
 
3115
        last;
-
 
3116
    }
-
 
3117
    closedir $dh;
-
 
3118
    return $rv;
-
 
3119
}
-
 
3120
 
-
 
3121
#-------------------------------------------------------------------------------
3082
# Function        : ExpandLinkFiles
3122
# Function        : ExpandLinkFiles
3083
#
3123
#
3084
# Description     : Look for .LINK files in the output image and expand
3124
# Description     : Look for .LINK files in the output image and expand
3085
#                   the links into softlinks
3125
#                   the links into softlinks
3086
#
3126
#