pan3793 commented on code in PR #49885:
URL: https://github.com/apache/spark/pull/49885#discussion_r1950712919
##########
dev/make-distribution.sh:
##########
@@ -317,12 +317,9 @@ if [ "$MAKE_TGZ" == "true" ]; then
TARDIR="$SPARK_HOME/$TARDIR_NAME"
rm -rf "$TARDIR"
cp -r "$DISTDIR" "$TARDIR"
- sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\
- &/' "$TARDIR/bin/pyspark"
- sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\
- &/' "$TARDIR/bin/spark-shell"
- sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\
- &/' "$TARDIR/bin/spark-submit"
+ sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' "$TARDIR/bin/pyspark"
Review Comment:
`sed` has different behavior on macOS(BSD sed) and Linux(GNU sed)
on macOS (produce an additional backup `*-e` file)
```
$ sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' "bin/pyspark"
$ git status
On branch master
Your branch is behind 'apache/master' by 2 commits, and can be
fast-forwarded.
(use "git pull" to update your local branch)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: bin/pyspark
Untracked files:
(use "git add <file>..." to include in what will be committed)
bin/pyspark-e
no changes added to commit (use "git add" and/or "git commit -a")
```
on Linux (work as expected)
```
$ sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' "bin/pyspark"
$ git status
On branch master
Your branch is up to date with 'apache/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: bin/pyspark
no changes added to commit (use "git add" and/or "git commit -a")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]