Subversion Repositories DevTools

Rev

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

Rev 5986 Rev 5991
Line 241... Line 241...
241
{
241
{
242
    my $self = shift;
242
    my $self = shift;
243
    push @{$self->{COMMENT}}, @_
243
    push @{$self->{COMMENT}}, @_
244
}
244
}
245
 
245
 
-
 
246
 
-
 
247
#-------------------------------------------------------------------------------
-
 
248
# Function        : QuoteDependency
-
 
249
#
-
 
250
# Description     : Escape/Quote a pathname for make
-
 
251
#                       Allow files with a $ in the name
-
 
252
#                       Allow files with a space in the name
-
 
253
#                       Allow files with a comma in the name
-
 
254
#                       Allow files with a colon in the name
-
 
255
#                       Allow for paths that have make-varible prefixes
-
 
256
#                           $(GBE_...)/
-
 
257
#                           as these may be generated internally
-
 
258
#
-
 
259
#                       Must also allow $(GBE_TYPE) in the remainder
-
 
260
#
-
 
261
# Inputs          : uarg                - Arg to quote
-
 
262
#
-
 
263
# Returns         : Quoted arg
-
 
264
#
-
 
265
 
-
 
266
sub QuoteDependency
-
 
267
{
-
 
268
    my ($uarg) = @_;
-
 
269
 
-
 
270
    #
-
 
271
    #   Split into two
-
 
272
    #       $(xxx)/             - Makefile variables
-
 
273
    #       Remainder           - Stuff to quote
-
 
274
    #
-
 
275
    $uarg =~ m~^((\$\(.*?\)/)*)(.*)~;
-
 
276
    my $prefix = defined $1 ? $1 : '';
-
 
277
    my $arg    = defined $3 ? $3 : '';
-
 
278
 
-
 
279
    $arg =~ s~\$(?!\(GBE_)~\$\$~g;       # $, not followed by (GBE_ - id not $(GBE_
-
 
280
    $arg =~ s~ ~\\ ~g;
-
 
281
    $arg =~ s~,~\$(comma)~g;
-
 
282
    $arg =~ s~%~\\%~g;
-
 
283
    $arg =~ s~:~\\:~g;
-
 
284
    return $prefix . $arg;
-
 
285
}
-
 
286
 
-
 
287
#-------------------------------------------------------------------------------
-
 
288
# Function        : AddDependancyEscaped
-
 
289
#
-
 
290
# Description     : Add a dependancy to the entry and Quote the value so that
-
 
291
#                   it can be it can be processed by make
-
 
292
#
-
 
293
# Inputs          : An array of dependencies to add
-
 
294
#
-
 
295
# Returns         :
-
 
296
#
-
 
297
sub AddDependancyEscaped
-
 
298
{
-
 
299
    my $self = shift;
-
 
300
    my @escaped;
-
 
301
 
-
 
302
    push @escaped, QuoteDependency($_) foreach (@_);
-
 
303
    UniquePush $self->{DEPENDANCY}, @escaped ;
-
 
304
}
-
 
305
 
246
#-------------------------------------------------------------------------------
306
#-------------------------------------------------------------------------------
247
# Function        : AddDependancy
307
# Function        : AddDependancy
248
#
308
#
249
# Description     : Add a dependancy to the entry
309
# Description     : Add a dependancy to the entry
-
 
310
#                   These will not be escaped.
250
#
311
#
251
# Inputs          : An array of dependacies to add
312
# Inputs          : An array of dependencies to add
252
#
313
#
253
# Returns         :
314
# Returns         :
254
#
315
#
255
sub AddDependancy
316
sub AddDependancy
256
{
317
{