From bd67b11a5787a02a605628aa222e737451330524 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 4 Jan 2021 09:44:10 +0000 Subject: pkg_get_base(): Return with success if cpt-base doesn't exist FossilOrigin-Name: cc958373d206ec3dd65008461a715120b25f05772b9a2d70539b3a53839569c2 --- src/cpt-lib.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 770e38d..4d81ffb 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -1826,7 +1826,9 @@ pkg_get_base() ( # Print the packages defined in the /etc/cpt-base file. # If an argument is given, it prints a space seperated list instead # of a list seperated by newlines. - [ -f "$CPT_ROOT/etc/cpt-base" ] || return 1 + + # cpt-base is an optional file, return with success if it doesn't exist. + [ -f "$CPT_ROOT/etc/cpt-base" ] || return 0 nonl=$1; set -- while read -r pkg _; do [ "${pkg##\#*}" ] || continue -- cgit v1.2.3