Fix py3 version changed even version control enabled issue#6422
Fix py3 version changed even version control enabled issue#6422xumia merged 3 commits intosonic-net:masterfrom
Conversation
a7e0fda to
27ed107
Compare
|
|
||
| HOOK_PATH=/usr/local/share/buildinfo/hooks | ||
| TARGET_PATH=/usr/sbin | ||
| [ -d /usr/local/sbin ] && TARGET_PATH=/usr/local/sbin |
There was a problem hiding this comment.
/usr/local/sbin [](start = 5, length = 15)
To simplify the logic, we can assume /usr/local/sbin exists and fail if not. #Closed
There was a problem hiding this comment.
Simply change to /usr/local/sbin, we assume the path exists, if not will be failed when creating the symbol link.
In reply to: 556191523 [](ancestors = 556191523)
This looks weird. Could you check the best practice for string comparision? #Closed Refers to: src/sonic-build-hooks/scripts/buildinfo_base.sh:34 in 27ed107. [](commit_id = 27ed107, deletion_comment = False) |
| @@ -24,7 +24,7 @@ log_err() | |||
|
|
|||
| get_command() | |||
There was a problem hiding this comment.
get_command [](start = 0, length = 11)
Could you add function scope comment to explain the intention? #Closed
How about change to grep as below? Or any advice? In reply to: 759130913 [](ancestors = 759130913) Refers to: src/sonic-build-hooks/scripts/buildinfo_base.sh:34 in 27ed107. [](commit_id = 27ed107, deletion_comment = False) |
I mean In reply to: 759140107 [](ancestors = 759140107,759130913) Refers to: src/sonic-build-hooks/scripts/buildinfo_base.sh:34 in 27ed107. [](commit_id = 27ed107, deletion_comment = False) |
| echo "$1" 1>&2 | ||
| } | ||
|
|
||
| # Get the real command not hooked by sonic-build-hook package |
There was a problem hiding this comment.
And how? I guess you remove some paths (listing them) in $PATH and check the absolute path of the same command again? #Closed
There was a problem hiding this comment.
We add the command in /usr/local/sbin, and exclude the /usr/local/sbin in env PATH when find the real command.
In reply to: 556218199 [](ancestors = 556218199)
|
retest vs please |
* Fix py3 version changed even version control enabled issue * Add some comments and simplify the script * Add the comment to explain how to get the not hooked command
- Why I did it
The pip3 is installed the /usr/local/bin, the hook command pip3 does not work correctly. Change to use /usr/local/sbin.
- How I did it
- How to verify it
Enable the version control and set the version of the pip package importlib-metadata to 3.3.0, run the following command.
pip3 install importlib-metadata
Before fixing the issue, the version 3.4.0 is installed.
After fixing the issue, the version 3.3.0 installed as expected.
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)