aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2018-06-19 01:35:44 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-19 01:37:15 -0700
commite3650359bd82dc50c6d4776ae260b6cd15d85efc (patch)
treecae54b65bfbcdb932cffab2a2e1834d36410ab43 /src/main
parent8938d62ba9b77d04130750ac34d23659cd500ded (diff)
Ensure seq never formats output with decimals or using scientific notation
as this isn't supported by `((... == 0))` below. See bazelbuild/bazel#5413 PiperOrigin-RevId: 201135798
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
index 9689927d09..d4d66c9b03 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
@@ -307,18 +307,20 @@ function create_and_run_classpath_jar() {
# Create manifest file
MANIFEST_FILE="${self}-${RAND_ID}.jar_manifest"
- echo "Manifest-Version: 1.0" >$MANIFEST_FILE
- CLASSPATH_LINE="Class-Path:$MANIFEST_CLASSPATH"
- # No line in the MANIFEST.MF file may be longer than 72 bytes.
- # A space prefix indicates the line is still the content of the last attribute.
- for i in `seq 0 71 ${#CLASSPATH_LINE}`; do
- PREFIX=" "
- if (($i == 0)); then
- PREFIX=""
- fi
- echo "$PREFIX${CLASSPATH_LINE:$i:71}" >>$MANIFEST_FILE
- done
- echo "Created-By: Bazel" >>$MANIFEST_FILE
+ (
+ echo "Manifest-Version: 1.0"
+ CLASSPATH_LINE="Class-Path:$MANIFEST_CLASSPATH"
+ # No line in the MANIFEST.MF file may be longer than 72 bytes.
+ # A space prefix indicates the line is still the content of the last attribute.
+ for ((i = 0; i < "${#CLASSPATH_LINE}"; i += 71)); do
+ PREFIX=" "
+ if ((i == 0)); then
+ PREFIX=""
+ fi
+ echo "$PREFIX${CLASSPATH_LINE:$i:71}"
+ done
+ echo "Created-By: Bazel"
+ ) >$MANIFEST_FILE
# Create classpath JAR file
MANIFEST_JAR_FILE="${self}-${RAND_ID}-classpath.jar"