You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/10/29 05:57:58 UTC

[GitHub] [ratis] cnauroth opened a new pull request, #772: RATIS-1340: Ratis scripts' discovery of Bash source path is incompati…

cnauroth opened a new pull request, #772:
URL: https://github.com/apache/ratis/pull/772

   …ble with CDPATH.
   
   ## What changes were proposed in this pull request?
   
   Several Bash scripts in Ratis use this common idiom to discover the current source path and then build relative paths from it:
   
   ```
   DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
   ```
   This mostly works well, but it isn't compatible with interactive shells using the `CDPATH` environment variable to provide a custom search path for resolving the directory referenced by `cd`.  (See [bash man page](https://linux.die.net/man/1/bash) discussion of `CDPATH` and how the resolved directory is "written to the standard output.")
   
   The standard solution is to redirect stdout of `cd` to `/dev/null`:
   
   ```
   DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
   ```
   
   Some Ratis scripts already do this, but not all.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-1340
   
   ## How was this patch tested?
   
   Manual testing invoking the scripts.


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] cnauroth commented on pull request #772: RATIS-1340: Ratis scripts' discovery of Bash source path is incompatible with CDPATH.

Posted by GitBox <gi...@apache.org>.
cnauroth commented on PR #772:
URL: https://github.com/apache/ratis/pull/772#issuecomment-1297748272

   Thank you, @adoroszlai and @szetszwo !


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] adoroszlai commented on pull request #772: RATIS-1340: Ratis scripts' discovery of Bash source path is incompatible with CDPATH.

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on PR #772:
URL: https://github.com/apache/ratis/pull/772#issuecomment-1297739475

   Thanks @cnauroth for the patch, @szetszwo for the review.


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ratis] adoroszlai merged pull request #772: RATIS-1340: Ratis scripts' discovery of Bash source path is incompatible with CDPATH.

Posted by GitBox <gi...@apache.org>.
adoroszlai merged PR #772:
URL: https://github.com/apache/ratis/pull/772


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org