Subversion Repositories DevTools

Rev

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

Rev 1548 Rev 1550
Line 199... Line 199...
199
 
199
 
200
 
200
 
201
my ($m_UID)  = "";
201
my ($m_UID)  = "";
202
my ($m_GID)  = "";
202
my ($m_GID)  = "";
203
my ($m_MASK) = "";
203
my ($m_MASK) = "";
-
 
204
my ($m_KEEP_MASK) = "";
204
 
205
 
205
 
206
 
206
#------------------------------------------------------------------------------
207
#------------------------------------------------------------------------------
207
# Variables global/local to this package
208
# Variables global/local to this package
208
#------------------------------------------------------------------------------
209
#------------------------------------------------------------------------------
Line 6054... Line 6055...
6054
#       This sub-routine is used to create the required package prototype file
6055
#       This sub-routine is used to create the required package prototype file
6055
#       fom a known directory struture using the a=b format.
6056
#       fom a known directory struture using the a=b format.
6056
#
6057
#
6057
#------------------------------------------------------------------------------
6058
#------------------------------------------------------------------------------
6058
{
6059
{
-
 
6060
    my ($opt_keep_mask, @args);
-
 
6061
 
-
 
6062
    #
-
 
6063
    #   Process the arguments and extract parameters and options
-
 
6064
    #
-
 
6065
    foreach ( @_ )
-
 
6066
    {
-
 
6067
        if ( m/^--KeepMask/ ) {
-
 
6068
            $opt_keep_mask = 1;
-
 
6069
 
-
 
6070
        } elsif ( m/^--/ ) {
-
 
6071
            Error("createPrototypeFile2: Unknown option: $_")
-
 
6072
 
-
 
6073
        } else {
-
 
6074
            push @args, $_;
-
 
6075
 
-
 
6076
        }
-
 
6077
    }
-
 
6078
 
6059
    # correct number of parameters?
6079
    # correct number of parameters?
6060
    if ( ($#_+1) != 3 )
6080
    if ( ($#args + 1) != 3 )
6061
    {
6081
    {
6062
        Error("Incorrect number of params passed to " .
6082
        Error("Incorrect number of params passed to " .
6063
                  "createPrototypeFile2() function. Check deploy config.");
6083
                  "createPrototypeFile2() function. Check deploy config.");
6064
    }
6084
    }
6065
 
6085
 
Line 6071... Line 6091...
6071
        Verbose("createPrototypeFile2() not supported on this machine type.");
6091
        Verbose("createPrototypeFile2() not supported on this machine type.");
6072
        return 1;
6092
        return 1;
6073
    }
6093
    }
6074
 
6094
 
6075
    # lets take the passed in args.
6095
    # lets take the passed in args.
6076
    my ($uid, $gid, $mask) = @_;
6096
    my ($uid, $gid, $mask) = @args;
6077
 
6097
 
6078
 
6098
 
6079
    # we need to determine whiich file we are dealing with
6099
    # we need to determine whiich file we are dealing with
6080
    my ($protoTypeFile);
6100
    my ($protoTypeFile);
6081
    my ($targetBaseDir);
6101
    my ($targetBaseDir);
Line 6116... Line 6136...
6116
    # for the bits in the prototype file.
6136
    # for the bits in the prototype file.
6117
    #
6137
    #
6118
    $m_UID  = $uid;
6138
    $m_UID  = $uid;
6119
    $m_GID  = $gid;
6139
    $m_GID  = $gid;
6120
    $m_MASK = $mask;
6140
    $m_MASK = $mask;
-
 
6141
    $m_KEEP_MASK = $opt_keep_mask;
6121
 
6142
 
6122
 
6143
 
6123
    # now we need to add entries for each directory we will 
6144
    # now we need to add entries for each directory we will 
6124
    # be installing 
6145
    # be installing 
6125
    File::Find::find(\&prototype2Find, "$targetBaseDir");
6146
    File::Find::find(\&prototype2Find, "$targetBaseDir");
Line 6252... Line 6273...
6252
#        This subroutine is used to locate all associated package dirs.
6273
#        This subroutine is used to locate all associated package dirs.
6253
#        It also adds an entry into the prototype file for each dir.
6274
#        It also adds an entry into the prototype file for each dir.
6254
#
6275
#
6255
#------------------------------------------------------------------------------
6276
#------------------------------------------------------------------------------
6256
{
6277
{
6257
    my($file)= "$File::Find::name";
6278
    my $file = $File::Find::name;
-
 
6279
    my $fullfile = $file;
6258
    my($base)= File::Basename::basename($file);
6280
    my $base = File::Basename::basename($file);
6259
 
6281
 
6260
    # we get the absolute path from the find, but we only require
6282
    # we get the absolute path from the find, but we only require
6261
    # a relative path from the starting dir.
6283
    # a relative path from the starting dir.
6262
    # so our start dir.
6284
    # so our start dir.
6263
 
6285
 
Line 6283... Line 6305...
6283
        # if TargetBaseDir is "." then find will find the pkginfo & prototype 
6305
        # if TargetBaseDir is "." then find will find the pkginfo & prototype 
6284
        # files so we need to exclude them
6306
        # files so we need to exclude them
6285
        if ( "$file" ne "$ProtoTypeFileName" &&
6307
        if ( "$file" ne "$ProtoTypeFileName" &&
6286
             "$file" ne "$PkgInfoFileName")
6308
             "$file" ne "$PkgInfoFileName")
6287
        {
6309
        {
-
 
6310
 
-
 
6311
            my $fmask = $m_MASK;
-
 
6312
            if ( $m_KEEP_MASK )
-
 
6313
            {
-
 
6314
                $fmask = sprintf "%lo", ( (stat($fullfile))[2]) & 07777;
-
 
6315
            }
-
 
6316
 
6288
            open ( FILE, ">> $pfile") or
6317
            open ( FILE, ">> $pfile") or
6289
                Error("Failed to open file [$pfile].");
6318
                Error("Failed to open file [$pfile].");
6290
 
6319
 
6291
            if ( -f "$m_sfile" )
6320
            if ( -f "$m_sfile" )
6292
            {
6321
            {
6293
                printf FILE ("f none $file=$file $m_MASK $m_UID $m_GID\n");
6322
                printf FILE ("f none $file=$file $fmask $m_UID $m_GID\n");
6294
            }
6323
            }
6295
 
6324
 
6296
            if ( -d "$m_sfile" )
6325
            if ( -d "$m_sfile" )
6297
            {
6326
            {
6298
                printf FILE ("d none $file $m_MASK $m_UID $m_GID\n");
6327
                printf FILE ("d none $file $fmask $m_UID $m_GID\n");
6299
            }
6328
            }
6300
 
6329
 
6301
            close (FILE);
6330
            close (FILE);
6302
        }
6331
        }
6303
    }
6332
    }