summaryrefslogtreecommitdiff
path: root/build/fixwin32mak.pl
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-04 18:54:00 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-04 18:54:00 +0000
commit1297c557ba8202a7726c9e1008df381bdc037006 (patch)
tree3c5f0c667ba759dad76b56e82c075a34da9363c9 /build/fixwin32mak.pl
parent3cad1a9dcc2cc6aac7e934d4e9735cb9e74ffe9f (diff)
downloadlibapr-1297c557ba8202a7726c9e1008df381bdc037006.tar.gz
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.] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62906 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/fixwin32mak.pl')
-rw-r--r--build/fixwin32mak.pl28
1 files changed, 18 insertions, 10 deletions
diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl
index c3f6acf86..fa2d1b4eb 100644
--- a/build/fixwin32mak.pl
+++ b/build/fixwin32mak.pl
@@ -12,28 +12,36 @@ use File::Find;
$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;