aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/cmdline
diff options
context:
space:
mode:
authorGravatar dannark <dannark@google.com>2018-04-10 19:59:46 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-10 20:01:26 -0700
commita65b419c25ae15fb51206f57ca47f9e7cfea0c83 (patch)
tree6357bd5f38e190dc44a17b7d14e9933bab19d8aa /src/main/java/com/google/devtools/build/lib/cmdline
parent2b533aba878698d50525826fd3e40571af87a1b9 (diff)
Automated rollback of commit ca598fb9445627e9734c2900bc6b11430250d453.
*** Reason for rollback *** breaks guitar tests *** Original change description *** Disallow labels of the form ////foo. RELNOTES: Labels of the form ////foo are disallowed. PiperOrigin-RevId: 192393660
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/cmdline')
-rw-r--r--src/main/java/com/google/devtools/build/lib/cmdline/Label.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
index 92969c4111..f271ea6c8b 100644
--- a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
+++ b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
@@ -257,14 +257,11 @@ public final class Label
*/
private static PackageIdentifier validatePackageName(String packageIdentifier, String name)
throws LabelSyntaxException {
- if (packageIdentifier.startsWith("/")) {
- throw new LabelSyntaxException(
- "package names may not start with '/' (do you have too many '/'?)");
- }
+ String error = null;
try {
return PackageIdentifier.parse(packageIdentifier);
} catch (LabelSyntaxException e) {
- String error = e.getMessage();
+ error = e.getMessage();
error = "invalid package name '" + packageIdentifier + "': " + error;
// This check is just for a more helpful error message
// i.e. valid target name, invalid package name, colon-free label form