From: Nicholas Clark Date: Sat, 27 Dec 2003 16:39:01 +0000 (+0000) Subject: Allow overriding of the p4 settings via environment variables X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24b2a273a08bacf9bdb36f18e9091329f41183d6;p=p5sagit%2Fp5-mst-13.2.git Allow overriding of the p4 settings via environment variables Make regexp more robust to parse FreeBSD's patch output p4raw-id: //depot/perl@21970 --- diff --git a/Porting/apply b/Porting/apply index d3bdb0b..cfa76e0 100644 --- a/Porting/apply +++ b/Porting/apply @@ -1,8 +1,8 @@ #!/usr/bin/perl -w my $file = pop(@ARGV); my %meta; -$ENV{'P4PORT'} = 'bactrian:1667'; -$ENV{'P4CLIENT'} = 'ni-s'; +$ENV{'P4PORT'} ||= 'bactrian:1667'; +$ENV{'P4CLIENT'} ||= 'ni-s'; open(FILE,$file) || die "Cannot open $file:$!"; while () { @@ -17,7 +17,7 @@ my $code = $?; warn "$code from patch\n"; foreach (@results) { - if (/patching\s+file\s*(.*?)\s*$/) + if (/[Pp]atching\s+file\s*(\S+)/) { push(@edit,$1); }