about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-21 11:07:31 +0000
committerbors <bors@rust-lang.org>2015-01-21 11:07:31 +0000
commit6869645e86c91544b8737b89809bdf10bef536d9 (patch)
tree522452a9cb7b47e2c8c8df97aa2727290bc9a159
parent8abcbaba1dd3f98dc37bec2288ba61a044be785c (diff)
parentde3ea99ec55d5f544abef6df836d67e6b87cb299 (diff)
downloadrust-6869645e86c91544b8737b89809bdf10bef536d9.tar.gz
rust-6869645e86c91544b8737b89809bdf10bef536d9.zip
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
-rw-r--r--README.md1
-rwxr-xr-xconfigure3
-rwxr-xr-xsrc/etc/check-links.pl34
-rwxr-xr-xsrc/etc/indenter29
4 files changed, 17 insertions, 50 deletions
diff --git a/README.md b/README.md
index 147d2e9d2f4..eef27236b1a 100644
--- a/README.md
+++ b/README.md
@@ -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`
diff --git a/configure b/configure
index 712db849039..b14eac4b77e 100755
--- a/configure
+++ b/configure
@@ -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
 
@@ -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
diff --git a/src/etc/check-links.pl b/src/etc/check-links.pl
deleted file mode 100755
index 3818c0f8401..00000000000
--- a/src/etc/check-links.pl
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/perl -w
-# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-# file at the top-level directory of this distribution and at
-# http://rust-lang.org/COPYRIGHT.
-#
-# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-# option. This file may not be copied, modified, or distributed
-# except according to those terms.
-
-my $file = $ARGV[0];
-
-my @lines = <>;
-
-my $anchors = {};
-
-my $i = 0;
-for $line (@lines) {
-    $i++;
-    if ($line =~ m/id="([^"]+)"/) {
-        $anchors->{$1} = $i;
-    }
-}
-
-$i = 0;
-for $line (@lines) {
-    $i++;
-    while ($line =~ m/href="#([^"]+)"/g) {
-        if (! exists($anchors->{$1})) {
-            print "$file:$i: $1 referenced\n";
-        }
-    }
-}
diff --git a/src/etc/indenter b/src/etc/indenter
index 1a3a4465335..b3eed6a1443 100755
--- a/src/etc/indenter
+++ b/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