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]