From a6e4d7a256978079742c9836bab30e7910196222 Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Tue, 21 Apr 2026 15:24:04 +0200 Subject: [PATCH] get ready for release --- LICENSE | 2 +- README.md | 3 ++- doc/CHANGELOG.md | 26 +++++++++++++++++++ doc/CONTRIBUTING.md | 61 +++++++++++++++++++++++++++++++++++++-------- doc/LICENSE | 29 +++++++++++++++++++++ doc/todo.md | 7 ------ version | 2 +- 7 files changed, 109 insertions(+), 21 deletions(-) create mode 100755 doc/LICENSE diff --git a/LICENSE b/LICENSE index 9e015a9..1de3e6a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2013-2022 Geoffray Levasseur +Copyright 2013-2026 Geoffray Levasseur This is distributed with BSD-3-Clause license with the following terms and condition: diff --git a/README.md b/README.md index 2a58665..a937a47 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,8 @@ A bar-style prompt showing current time, execution time of the last command | `mcd` | filefct | Create a directory and immediately move into it | | `meteo` | info | Display weather forecast for the configured or given city | | `myextip` | net | Get information about your public IP address | -| `pkgs` | packages | Search for a pattern in installed package names (dpkg/rpm, supports `-i`) | +| `get_pkgmgr` | packages | Detect the active package manager of the running distribution (`apt`, `dnf`, `yum`, `zypper`, `pacman`, `apk`, `portage`, `xbps`, `nix`) | +| `pkgs` | packages | Search for a pattern in installed package names (distro-aware via `get_pkgmgr`, supports `-i`) | | `ppg` | processes | Look for the given pattern in running processes | | `ppn` | processes | List processes matching an exact command name | | `ppu` | processes | List processes owned by a specific user | diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 32a8f02..9dbf7cd 100755 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -7,6 +7,32 @@ Versions follow `MAJOR.MINOR.PATCH-REVISION_STAGE_N` (e.g. `3.99.1-4_rc_1`). --- +## [3.99.2-4_rc_2] — 2026-04-21 + +### Fixed +- **`prompt.sh`** — `\$Last_Command` in PS1 was escaped, preventing the exit + code from ever appearing in the prompt (the local variable no longer exists + when PS1 is rendered by bash). Removed the backslash so the value is embedded + at `set_prompt` build time. +- **`filefct.sh` — `file_stats()`** — a stray unconditional `shift` after + `esac` doubled-shifted arguments already shifted by each `case` branch; + successive options such as `-H -d` were silently skipped. +- **`packages.sh` — `pkgs()`** — replaced the unreliable binary-presence test + (`command -v dpkg / rpm`) with the new `get_pkgmgr` function. Also corrected + a typo in the "no package manager" error message (`avialable` → `available`). +- **`processes.sh` — `kt()`** — copy-paste error: usage error message read + `"Usage: ppg "` instead of `"Usage: kt "`. + +### Added +- **`packages.sh` — `get_pkgmgr()`** — new exported helper that detects the + active package manager of the running distribution. Detection first reads + `/etc/os-release` (`ID` then `ID_LIKE`), then falls back to a + fixed-priority binary scan. Supported families: `apt`, `dnf`, `yum`, + `zypper`, `pacman`, `apk`, `portage`, `xbps`, `nix`. Returns 1 when + nothing is identified. Available to all future commands in `packages.sh`. + +--- + ## [3.99.1-4_rc_1] — 2026 ### Added diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 52348f9..e254675 100755 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -29,9 +29,48 @@ to target). Stale forks cause avoidable merge conflicts. --- -## 3. Development environment +## 3. Branch policy -| Requirement | Minimum version | Notes | +| Branch | Purpose | +|---|---| +| `master` | Main development branch — new features and enhancements go here | +| `` (e.g. `3.x`) | Maintenance branch for a released version — bugfixes backported from `master` | + +**New functionality** must always target `master`. + +**Bugfixes** must target the branch where the bug was introduced: +- If the bug exists in a released version, open the fix against that version's + maintenance branch first, then cherry-pick onto `master`. +- If the bug is only in `master` (unreleased), fix it directly on `master`. +- During a release-candidate cycle, bugfixes go on the `x.*` branch and are + merged back into `master` before the final release. + +Do **not** add new features to a maintenance branch. + +--- + +## 4. Versioning scheme + +Versions follow the format **`MAJOR.MINOR.PATCH`** where the `MINOR` number +conveys the development stage of the next major release: + +| Minor range | Stage | Rules | +|---|---|---| +| `x.90.y` | **Alpha** toward `x+1` | Stays on `master`. Development is open: new features are welcome, regressions are acceptable. | +| `x.95.y` | **Beta** toward `x+1` | The `x+1.*` maintenance branch is created at this point. No regression unless absolutely necessary; new features still allowed. | +| `x.99.y` | **RC** toward `x+1` | Bugfixes only. No new features. No regression allowed. Becomes `x+1.0.0` when stable. | + +Examples: `3.90.1` is the first alpha toward `4.0`, `3.99.2` is the second +release candidate for `4.0`. + +The `PATCH` number increments freely within a stage. A bump in `MINOR` +(e.g. `90` → `95`) always indicates a stage promotion in development phase. + +Any experimental version must have it's dedicated branch. + +--- + +## 5. Development environment |---|---|---| | Bash | 4.3 | Namerefs (`local -n`) required | | shellcheck | any recent | Run before every commit | @@ -52,7 +91,7 @@ brew install shellcheck --- -## 4. Code style +## 6. Code style ### General rules - **Bash only** — no external interpreters in core modules. Python or Perl is @@ -62,8 +101,8 @@ brew install shellcheck - **`[[ … ]]`** for all conditionals — not `[ … ]`. - **`(( … ))`** for arithmetic — not `$(( … ))` in conditionals. - **`local`** for all function-internal variables — avoid polluting the - environment. -- **`printf`** instead of `echo` wherever the format matters. + environment. Prefer upper case for global and lowercase for local. +- **`printf`** instead of `echo` all the time. - **Never `eval`** — use namerefs (`local -n`), `${!varname}` indirection, or `declare -g` instead. - **No hardcoded defaults** — wire every configurable value through @@ -100,7 +139,7 @@ Add the `load_conf` call near the top after any variable declarations. --- -## 5. Configuration keys +## 7. Configuration keys When adding a configurable default: @@ -110,7 +149,7 @@ When adding a configurable default: --- -## 6. Theming +## 8. Theming New theme files go in `profile.d/themes/` with a `.theme` extension. They are **parsed, not executed** — do not add shell logic. @@ -118,7 +157,7 @@ See the existing themes and `README.md §4.4` for the allowed syntax. --- -## 7. Running shellcheck +## 9. Running shellcheck ```bash shellcheck -x profile.sh profile.d/*.sh @@ -130,7 +169,7 @@ comment explaining why the suppression is necessary. --- -## 8. Submitting a contribution +## 10. Submitting a contribution ### Via Git (preferred) 1. Contact the maintainer to obtain push access, or fork on the Gitea instance. @@ -156,7 +195,7 @@ Reference issue numbers if applicable: closes #42. --- -## 9. What will be rejected +## 11. What will be rejected - Code requiring packages not in a minimal Debian or CentOS install. - Use of `eval`, `source`-based config loading, or other code-injection vectors. @@ -166,6 +205,6 @@ Reference issue numbers if applicable: closes #42. --- -## 10. Financial contributions +## 12. Financial contributions Contact the maintainer by mail if you wish to make a financial contribution. diff --git a/doc/LICENSE b/doc/LICENSE new file mode 100755 index 0000000..4b01ed9 --- /dev/null +++ b/doc/LICENSE @@ -0,0 +1,29 @@ +Copyright 2021-2026 Geoffray Levasseur + +This software is distributed under the BSD-3-Clause license with the +following terms and conditions: + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/todo.md b/doc/todo.md index dcafe5b..f7b273b 100755 --- a/doc/todo.md +++ b/doc/todo.md @@ -15,9 +15,6 @@ version-bump. - [ ] **Bash completion** — add a `profile.d/completion/` directory and write `_profile_upgrade`, `_taz`, `_utaz`, `_meteo`, etc. completions so that `` works on all public functions. **[medium]** -- [ ] **`shellcheck` clean pass** — run `shellcheck -x profile.sh profile.d/*.sh` - and address every remaining warning (currently a handful of SC2034 and SC2086 - items). Integrate as a pre-commit hook. **[easy]** --- @@ -70,10 +67,6 @@ version-bump. (configurable via `MYEXTIP_FALLBACK_URL`) when the primary times out. **[easy]** -### packages -- [ ] **Additional backends** — add support for `pacman` (Arch), `apk` (Alpine), - `xbps-query` (Void), and `brew` (macOS). **[medium]** - ### processes - [ ] **`ku` dry-run flag** — add `-n` / `--dry-run` to print what would be killed without acting. **[easy]** diff --git a/version b/version index 644e860..eb70128 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.99.1-4_rc_1 +3.99.2-4_rc_2