apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/build fixwin32mak.pl
Date Mon, 04 Feb 2002 18:54:00 GMT
wrowe       02/02/04 10:54:00

  Modified:    build    fixwin32mak.pl
  Log:
    A slighly more inventive method of cleaning up abs paths from .mak files
    I worked up before the machines went down [yup - data is recovered.]
  
  Revision  Changes    Path
  1.5       +18 -10    apr/build/fixwin32mak.pl
  
  Index: fixwin32mak.pl
  ===================================================================
  RCS file: /home/cvs/apr/build/fixwin32mak.pl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- fixwin32mak.pl	17 Aug 2001 06:46:30 -0000	1.4
  +++ fixwin32mak.pl	4 Feb 2002 18:54:00 -0000	1.5
  @@ -12,28 +12,36 @@
   
   $root = cwd;
   # ignore our own direcory (allowing us to move into any parallel tree)
  -$root =~ s|^.:(.*)/.*?$|cd "$1|;
  +$root =~ s|^.:(.*)?$|cd "$1|;
   $root =~ s|/|\\\\|g;
   print "Testing " . $root . "\n";
   find(\&fixcwd, '.');
   
   sub fixcwd { 
       if (m|.mak$|) {
  -# note repl is broken... isn't freindly to directories with periods.
  -	$repl = $File::Find::dir;
  -# replace ./ with the parent (moving into any parallel tree)
  -        $repl =~ s|^\./|../|;
  -# replace each directory in this path with .. to get back to our root
  -        $repl =~ s|[^/]+|..|g;
  -        $repl =~ s|/|\\|;
  +        $thisroot = $File::Find::dir;
  +	$thisroot =~ s|^./(.*)$|$1|;
  +	$thisroot =~ s|/|\\\\|g;
  +        $thisroot = $root . "\\\\" . $thisroot;
           $oname = $_;
   	$tname = '.#' . $_;
   	$verchg = 0;
  -print "Processing " . $_ . "\n";
  +#print "Processing " . $thisroot . " of " . $_ . "\n";
   	$srcfl = new IO::File $_, "r" || die;
   	$dstfl = new IO::File $tname, "w" || die;
   	while ($src = <$srcfl>) {
  -	    if ($src =~ s|^(\s*)$root|$1cd "$repl|) {
  +	    if ($src =~ m|^\s*($root[^\"]*)\".*$|) {
  +#print "Found " . $1 . "\"\n";
  +		$orig = $thisroot;
  +                $repl = "cd \".";
  +                while (!($src =~ s|$orig|$repl|)) {
  +#print "Tried replacing " . $orig . " with " . $repl . "\n";
  +		   if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) {
  +                       break;
  +                   }
  +		   $repl .= "\\..";
  +		}
  +#print "Replaced " . $orig . " with " . $repl . "\n";
   		$verchg = -1;
   	    }
               print $dstfl $src; 
  
  
  

Mime
View raw message