Skip to content

Commit 6869645

Browse files
committed
Auto merge of #21242 - richo:no-perl, r=brson
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
2 parents 8abcbab + de3ea99 commit 6869645

File tree

4 files changed

+17
-50
lines changed

4 files changed

+17
-50
lines changed

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ documentation.
2121
1. Make sure you have installed the dependencies:
2222
* `g++` 4.7 or `clang++` 3.x
2323
* `python` 2.6 or later (but not 3.x)
24-
* `perl` 5.0 or later
2524
* GNU `make` 3.81 or later
2625
* `curl`
2726
* `git`

Diff for: configure

+1-2
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,6 @@ putvar CFG_BOOTSTRAP_KEY
617617

618618
step_msg "looking for build programs"
619619

620-
probe_need CFG_PERL perl
621620
probe_need CFG_CURLORWGET curl wget
622621
probe_need CFG_PYTHON python2.7 python2.6 python2 python
623622

@@ -1375,7 +1374,7 @@ do
13751374
done
13761375

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

13811380
msg

Diff for: src/etc/check-links.pl

-34
This file was deleted.

Diff for: src/etc/indenter

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
#!/usr/bin/perl
2-
use strict;
3-
use warnings;
1+
#!/usr/bin/env python
2+
import re
3+
import sys
44

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

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

13-
if (/^rust: ~"<</) {
14-
$indent -= 1;
15-
}
16-
}
16+
print "%03d %s%s" % (indent, " " * indent, line.strip())
17+
18+
if less_re.match(line):
19+
indent -= 1

0 commit comments

Comments
 (0)