Subversion Repositories DevTools

Rev

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

Rev 4672 Rev 4676
Line 323... Line 323...
323
    #       Ignore any control file. It will be done next
323
    #       Ignore any control file. It will be done next
324
    #
324
    #
325
    foreach my $key ( keys %DebianControlFiles )
325
    foreach my $key ( keys %DebianControlFiles )
326
    {
326
    {
327
        next if ($key eq 'control');
327
        next if ($key eq 'control');
328
        CopyFile ( $DebianControlFiles{$key},    "/DEBIAN", $key );
328
        CopyFile ( $DebianControlFiles{$key}, '/DEBIAN', $key  );
329
    }
329
    }
330
 
330
 
331
    #
331
    #
332
    #   Create 'conffiles'
332
    #   Create 'conffiles'
333
    #       Append to any user provided file
333
    #       Append to any user provided file
Line 534... Line 534...
534
#
534
#
535
# Inputs          : name            - Target Name
535
# Inputs          : name            - Target Name
536
#                                     If the name starts with 'package.' then it will be replaced
536
#                                     If the name starts with 'package.' then it will be replaced
537
#                                     with the name of the current package
537
#                                     with the name of the current package
538
#                   file            - Source File Name
538
#                   file            - Source File Name
-
 
539
#                   options         - Options include
-
 
540
#                                       --FromPackage
539
#
541
#
540
# Returns         : 
542
# Returns         : 
541
#
543
#
542
sub DebianControlFile
544
sub DebianControlFile
543
{
545
{
544
    my ($name, $file, $misc) = @_;
546
    my ($name, $file, @options) = @_;
-
 
547
    my $fromPackage = 0;
-
 
548
 
-
 
549
    #
-
 
550
    #   Process options
-
 
551
    foreach ( @options)
-
 
552
    {
-
 
553
        if (m~^--FromPackage~) {
-
 
554
            $fromPackage = 1;
-
 
555
        }
-
 
556
        else  {
545
    Error ("DebianControlFile: Unknown argument: $misc") if defined $misc;
557
            ReportError(("DebianControlFile: Unknown argument: $_"));
-
 
558
        }
-
 
559
    }
-
 
560
    ErrorDoExit();
546
 
561
 
547
    #
562
    #
548
    #   Some control files need to have the package name prepended
563
    #   Some control files need to have the package name prepended
549
    #
564
    #
550
    $name =~ s~^package\.~$opt_name.~;
565
    $name =~ s~^package\.~$opt_name.~;
Line 555... Line 570...
555
    #
570
    #
556
    my $simpleName = lc($name);
571
    my $simpleName = lc($name);
557
    Error("DebianControlFile: Multiple definitions for '$name' not allowed")
572
    Error("DebianControlFile: Multiple definitions for '$name' not allowed")
558
        if (exists $DebianControlFileNames{$simpleName});
573
        if (exists $DebianControlFileNames{$simpleName});
559
 
574
 
560
    Error("DebianControlFile: $name. File not found", "Control target: $name", "File not found: $file")
-
 
561
        unless (-f $file);
575
    my $filePath = ResolveFile($fromPackage, $file);
562
 
576
 
563
    #
577
    #
564
    #   Add info to data structures
578
    #   Add info to data structures
565
    #
579
    #
566
    $DebianControlFiles{$name} = $file;
580
    $DebianControlFiles{$name} = $filePath;
567
    $DebianControlFileNames{$simpleName} = $name;
581
    $DebianControlFileNames{$simpleName} = $name;
568
}
582
}
569
 
583
 
570
#-------------------------------------------------------------------------------
584
#-------------------------------------------------------------------------------
571
# Function        : DebianDepends 
585
# Function        : DebianDepends 
Line 1742... Line 1756...
1742
    #   Final warning
1756
    #   Final warning
1743
    #
1757
    #
1744
    Warning ("SetPermissions: No files located", "Args: @_") unless ( $someDone );
1758
    Warning ("SetPermissions: No files located", "Args: @_") unless ( $someDone );
1745
}
1759
}
1746
 
1760
 
1747
#-------------------------------------------------------------------------------
1761
#************ INTERNAL USE ONLY  **********************************************
1748
# Function        : chmodItem 
1762
# Function        : chmodItem 
1749
#
1763
#
1750
# Description     : Internal
1764
# Description     : Internal
1751
#                   chmod a file or a folder
1765
#                   chmod a file or a folder
1752
#
1766
#
Line 1755... Line 1769...
1755
#                   dirPerms                    - dire perms
1769
#                   dirPerms                    - dire perms
1756
#
1770
#
1757
# Returns         : 1   - Item modified
1771
# Returns         : 1   - Item modified
1758
#                   0   - Item not modified
1772
#                   0   - Item not modified
1759
#
1773
#
-
 
1774
#************ INTERNAL USE ONLY  **********************************************
1760
sub chmodItem
1775
sub chmodItem
1761
{
1776
{
1762
    my ($item, $filePerms, $dirPerms) = @_;
1777
    my ($item, $filePerms, $dirPerms) = @_;
1763
 
1778
 
1764
    if ( -d $item && defined $dirPerms)
1779
    if ( -d $item && defined $dirPerms)
Line 1849... Line 1864...
1849
        return 1 if ( $opt_variant eq $_ );
1864
        return 1 if ( $opt_variant eq $_ );
1850
    }
1865
    }
1851
    return 0;
1866
    return 0;
1852
}
1867
}
1853
 
1868
 
1854
#-------------------------------------------------------------------------------
1869
#************ INTERNAL USE ONLY  **********************************************
1855
# Function        : FindFiles
1870
# Function        : FindFiles
1856
#
1871
#
1857
# Description     : Locate files within a given dir tree
1872
# Description     : Locate files within a given dir tree
1858
#
1873
#
1859
# Inputs          : $root           - Base of the search
1874
# Inputs          : $root           - Base of the search
1860
#                   $match          - Re to match
1875
#                   $match          - Re to match
1861
#
1876
#
1862
# Returns         : A list of files that match
1877
# Returns         : A list of files that match
1863
#
1878
#
-
 
1879
#************ INTERNAL USE ONLY  **********************************************
1864
my @FIND_LIST;
1880
my @FIND_LIST;
1865
my $FIND_NAME;
1881
my $FIND_NAME;
1866
 
1882
 
1867
sub FindFiles
1883
sub FindFiles
1868
{
1884
{
Line 1969... Line 1985...
1969
        close (LF);
1985
        close (LF);
1970
        unlink $linkfile;
1986
        unlink $linkfile;
1971
    }
1987
    }
1972
}
1988
}
1973
 
1989
 
1974
#-------------------------------------------------------------------------------
1990
#************ INTERNAL USE ONLY  **********************************************
1975
# Function        : ResolveFile
1991
# Function        : ResolveFile
1976
#
1992
#
1977
# Description     : Determine where the source for a file is
1993
# Description     : Determine where the source for a file is
1978
#                   Will look in (default):
1994
#                   Will look in (default):
1979
#                       Local directory
1995
#                       Local directory
Line 1988... Line 2004...
1988
# Inputs          : $from_package       - 0 - Local File
2004
# Inputs          : $from_package       - 0 - Local File
1989
#                   $file
2005
#                   $file
1990
#
2006
#
1991
# Returns         : Path
2007
# Returns         : Path
1992
#
2008
#
-
 
2009
#************ INTERNAL USE ONLY  **********************************************
1993
sub ResolveFile
2010
sub ResolveFile
1994
{
2011
{
1995
    my ($from_package, $file) = @_;
2012
    my ($from_package, $file) = @_;
1996
    my $wildcard = ($file =~ /[*?]/);
2013
    my $wildcard = ($file =~ /[*?]/);
1997
    my @path;
2014
    my @path;