This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=bdb8781b45e2f01a97598f7db6cabec5b281fa70 commit bdb8781b45e2f01a97598f7db6cabec5b281fa70 Author: Guillem Jover <[email protected]> AuthorDate: Tue Jan 7 00:41:24 2025 +0100 src/sh: Document library interface basics and the version when introduced This should help a bit with potential external users. --- src/sh/dpkg-error.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sh/dpkg-error.sh b/src/sh/dpkg-error.sh index bf959b3b8..43d79dbd9 100644 --- a/src/sh/dpkg-error.sh +++ b/src/sh/dpkg-error.sh @@ -17,7 +17,12 @@ # # shellcheck shell=sh -# Set a default program name. +# This shell library (since dpkg 1.20.1) provides reporting support. +# +# Symbols starting with «_dpkg_» are considered private and should not +# be used outside this shell library. + +# Set a default program name (since 1.22.12). : "${PROGNAME:=$(basename "$0")}" # Standard ANSI colors and attributes. @@ -72,27 +77,32 @@ fi _dpkg_fmt_prog="$_dpkg_color_prog$PROGNAME$_dpkg_color_clear" # This function is deprecated and kept only for backwards compatibility. +# Supported since dpkg 1.20.1. # Deprecated since dpkg 1.22.12. setup_colors() { : } +# Supported since dpkg 1.20.1. debug() { if [ -n "$DPKG_DEBUG" ]; then echo "$_dpkg_fmt_prog: debug: $*" >&2 fi } +# Supported since dpkg 1.20.1. error() { echo "$_dpkg_fmt_prog: ${_dpkg_color_error}error${_dpkg_color_clear}: $*" >&2 exit 1 } +# Supported since dpkg 1.20.1. warning() { echo "$_dpkg_fmt_prog: ${_dpkg_color_warn}warning${_dpkg_color_clear}: $*" >&2 } +# Supported since dpkg 1.20.1. badusage() { echo "$_dpkg_fmt_prog: ${_dpkg_color_error}error${_dpkg_color_clear}: $1" >&2 echo >&2 -- Dpkg.Org's dpkg

