Skip to content

Commit

Permalink
Auto merge of #21242 - richo:no-perl, r=brson
Browse files Browse the repository at this point in the history
There's only one build-critical path in which perl is used, and it was to do a text replacement trivially achievable with sed(1).

I ported the indenter script because it [appears to be used][indenter], but removed check links because it appears to be entirely out of date.

[indenter]: https://github.com/rust-lang/rust/blob/master/src/librustc/util/common.rs#L60-70
  • Loading branch information
bors committed Jan 21, 2015
2 parents 8abcbab + de3ea99 commit 6869645
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 50 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -21,7 +21,6 @@ documentation.
1. Make sure you have installed the dependencies:
* `g++` 4.7 or `clang++` 3.x
* `python` 2.6 or later (but not 3.x)
* `perl` 5.0 or later
* GNU `make` 3.81 or later
* `curl`
* `git`
Expand Down
3 changes: 1 addition & 2 deletions configure
Expand Up @@ -617,7 +617,6 @@ putvar CFG_BOOTSTRAP_KEY

step_msg "looking for build programs"

probe_need CFG_PERL perl
probe_need CFG_CURLORWGET curl wget
probe_need CFG_PYTHON python2.7 python2.6 python2 python

Expand Down Expand Up @@ -1375,7 +1374,7 @@ do
done

# Munge any paths that appear in config.mk back to posix-y
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' config.tmp
sed -i.bak -e 's@ \([a-zA-Z]\):[/\\]@ /\1/@g;' config.tmp
rm -f config.tmp.bak

msg
Expand Down
34 changes: 0 additions & 34 deletions src/etc/check-links.pl

This file was deleted.

29 changes: 16 additions & 13 deletions src/etc/indenter
@@ -1,16 +1,19 @@
#!/usr/bin/perl
use strict;
use warnings;
#!/usr/bin/env python
import re
import sys

my $indent = 0;
while (<>) {
if (/^rust: ~">>/) {
$indent += 1;
}
indent = 0
more_re = re.compile(r"^rust: ~\">>")
less_re = re.compile(r"^rust: ~\"<<")
while True:
line = sys.stdin.readline()
if not line:
break

printf "%03d %s%s", $indent, (" " x $indent), $_;
if more_re.match(line):
indent += 1

if (/^rust: ~"<</) {
$indent -= 1;
}
}
print "%03d %s%s" % (indent, " " * indent, line.strip())

if less_re.match(line):
indent -= 1

0 comments on commit 6869645

Please sign in to comment.