From 73c84ad4b583356b0d8d29b2c1bbca254ddc1275 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 24 Feb 2024 12:59:53 -0500 Subject: [PATCH] xbps-src: print_cross_targets properly without `XBPS_DISTDIR` set because it is called in `usage()`, before `XBPS_DISTDIR` is set by `xbps-src`, it would only work if `XBPS_DISTDIR` is set by the user. --- xbps-src | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xbps-src b/xbps-src index b3f61d53dc4..97ca0bc5564 100755 --- a/xbps-src +++ b/xbps-src @@ -9,6 +9,13 @@ print_cross_targets() { } usage() { + # copied from main logic because this is run before XBPS_DISTDIR is set normally + local _distdir="$(readlink -f "${0%/*}")" + if [ "${_distdir}" = "." ]; then + readonly XBPS_DISTDIR="$(pwd -P)" + else + readonly XBPS_DISTDIR="${_distdir}" + fi cat << _EOF $PROGNAME: [options] [arguments]