aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-05-11 13:25:55 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-05-11 13:25:55 +0200
commitca71525e575f809c77d84550a3e8abc100dfb5a4 (patch)
tree8fd4d632070bbb188b284bbb97189426d2ded1a5
parentb3c98a0f9dae4eb1e6078df4a0c55a9e892ae56e (diff)
Allow package names to not be explicitly defined as configuration values
-rw-r--r--CHANGELOG.md4
-rw-r--r--lib/util/pkg.bash6
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4034fa7..dcfa169 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
# Changelog
+
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -16,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
warning if one is not set for a node.
- `svc_enable()` now checks for the `rc.d` file to exist before running `grep`
on it.
+- `pkg_*()` functions no longer _require_ a `pkg.*` value to be defined. If one
+ is not set explicitly, a warning will be generated, but the original name
+ passed to the `pkg_*()` function will be used by the host's package manager.
## [1.0.0] - 2022-05-06
diff --git a/lib/util/pkg.bash b/lib/util/pkg.bash
index 618ce6a..de70f78 100644
--- a/lib/util/pkg.bash
+++ b/lib/util/pkg.bash
@@ -6,12 +6,12 @@ pkg() {
local action=$1 ; shift
local pkg
- pkg="$(config "pkg.$1")" ; shift
+ pkg="$(config "pkg.$1")"
if [[ -z $pkg ]]
then
- crit "$system" "No package name for $pkg"
- return 1
+ warn "$system" "No explicit package name for $1"
+ pkg="$1"
fi
if [[ "$(type -t "pkg_$action")" != "function" ]]