[PR #4133] [MERGED] core: persist /usr/local/bin via profile.d helper #4769

Closed
opened 2025-11-20 06:11:34 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/4133
Author: @MickLesk
Created: 4/29/2025
Status: Merged
Merged: 4/29/2025
Merged by: @tremor021

Base: mainHead: add_path_set


📝 Commits (1)

  • 1660034 add profile function and export PATH to prevent issues in future

📊 Changes

1 file changed (+14 additions, -9 deletions)

View changed files

📝 misc/tools.func (+14 -9)

📄 Description

✍️ Description

What does this PR do?

  • Replaces inline PATH manipulation in setup_uv() with a new helper function ensure_usr_local_bin_persist().
  • This function ensures that /usr/local/bin is included in the $PATH, both for the current shell session and persistently via /etc/profile.d/custom_path.sh.

Why?

  • In some environments (especially containers), /usr/local/bin is not included in $PATH by default.
  • The previous solution appended the path at runtime, but did not persist it across logins or reboots.
  • This change makes uv and other binaries reliably executable without requiring re-export or login shell restarts.

Additional considerations

  • The function checks if pveversion exists and skips changes on Proxmox nodes to avoid affecting system-level behavior.

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/4133 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 4/29/2025 **Status:** ✅ Merged **Merged:** 4/29/2025 **Merged by:** [@tremor021](https://github.com/tremor021) **Base:** `main` ← **Head:** `add_path_set` --- ### 📝 Commits (1) - [`1660034`](https://github.com/community-scripts/ProxmoxVE/commit/16600347bf378c15130028afba2b5839c3183787) add profile function and export PATH to prevent issues in future ### 📊 Changes **1 file changed** (+14 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `misc/tools.func` (+14 -9) </details> ### 📄 Description ## ✍️ Description ### What does this PR do? - Replaces inline PATH manipulation in `setup_uv()` with a new helper function `ensure_usr_local_bin_persist()`. - This function ensures that `/usr/local/bin` is included in the `$PATH`, both for the current shell session and persistently via `/etc/profile.d/custom_path.sh`. ### Why? - In some environments (especially containers), `/usr/local/bin` is not included in `$PATH` by default. - The previous solution appended the path at runtime, but did not persist it across logins or reboots. - This change makes `uv` and other binaries reliably executable without requiring re-export or login shell restarts. ### Additional considerations - The function checks if `pveversion` exists and skips changes on Proxmox nodes to avoid affecting system-level behavior. ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [ ] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [x] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 06:11:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#4769