[SPARK-25840][BUILD] make-distribution.sh should not fail due to missing LICENSE-binary

## What changes were proposed in this pull request?

We vote for the artifacts. All releases are in the form of the source materials needed to make changes to the software being released. (http://www.apache.org/legal/release-policy.html#artifacts)

From Spark 2.4.0, the source artifact and binary artifact starts to contain own proper LICENSE files (LICENSE, LICENSE-binary). It's great to have them. However, unfortunately, `dev/make-distribution.sh` inside source artifacts start to fail because it expects `LICENSE-binary` and source artifact have only the LICENSE file.

https://dist.apache.org/repos/dist/dev/spark/v2.4.0-rc4-bin/spark-2.4.0.tgz

`dev/make-distribution.sh` is used during the voting phase because we are voting on that source artifact instead of GitHub repository. Individual contributors usually don't have the downstream repository and starts to try build the voting source artifacts to help the verification for the source artifact during voting phase. (Personally, I did before.)

This PR aims to recover that script to work in any way. This doesn't aim for source artifacts to reproduce the compiled artifacts.

## How was this patch tested?

Manual.
```
$ rm LICENSE-binary
$ dev/make-distribution.sh
```

Closes #22840 from dongjoon-hyun/SPARK-25840.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This commit is contained in:
Dongjoon Hyun 2018-10-25 20:26:13 -07:00
parent dc9b320807
commit 79f3babcc6
No known key found for this signature in database
GPG key ID: EDA00CE834F0FC5C

View file

@ -212,9 +212,13 @@ mkdir -p "$DISTDIR/examples/src/main"
cp -r "$SPARK_HOME/examples/src/main" "$DISTDIR/examples/src/"
# Copy license and ASF files
cp "$SPARK_HOME/LICENSE-binary" "$DISTDIR/LICENSE"
cp -r "$SPARK_HOME/licenses-binary" "$DISTDIR/licenses"
cp "$SPARK_HOME/NOTICE-binary" "$DISTDIR/NOTICE"
if [ -e "$SPARK_HOME/LICENSE-binary" ]; then
cp "$SPARK_HOME/LICENSE-binary" "$DISTDIR/LICENSE"
cp -r "$SPARK_HOME/licenses-binary" "$DISTDIR/licenses"
cp "$SPARK_HOME/NOTICE-binary" "$DISTDIR/NOTICE"
else
echo "Skipping copying LICENSE files"
fi
if [ -e "$SPARK_HOME/CHANGES.txt" ]; then
cp "$SPARK_HOME/CHANGES.txt" "$DISTDIR"