aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-01-04 09:44:10 +0000
committermerakor <cem@ckyln.com>2021-01-04 09:44:10 +0000
commitbd67b11a5787a02a605628aa222e737451330524 (patch)
treeeebe5f61b55fb9ebe0d2fdf8199cc756448d561f
parent5bed6bb3ce3ea13adead455cbc7b0fc94818860b (diff)
downloadcpt-bd67b11a5787a02a605628aa222e737451330524.tar.gz
pkg_get_base(): Return with success if cpt-base doesn't exist
FossilOrigin-Name: cc958373d206ec3dd65008461a715120b25f05772b9a2d70539b3a53839569c2
-rw-r--r--src/cpt-lib.in4
1 files changed, 3 insertions, 1 deletions
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