diff options
Diffstat (limited to 'src/xbs')
-rw-r--r-- | src/xbs/Makefile | 2 | ||||
-rwxr-xr-x | src/xbs/xbs | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/xbs/Makefile b/src/xbs/Makefile index fcb8ac2..ea5e924 100644 --- a/src/xbs/Makefile +++ b/src/xbs/Makefile @@ -1,2 +1,2 @@ -pkgconfdir = $(sysconfdir) +pkgconfdir = $(sysconfdir)/xbs include ../../common.mk diff --git a/src/xbs/xbs b/src/xbs/xbs index ae424af..34d8945 100755 --- a/src/xbs/xbs +++ b/src/xbs/xbs @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +default_libdir=/usr/lib/xbs + . libremessages . $(librelib conf) @@ -38,7 +40,9 @@ usage() { bullet 'with the `-b` flag' prose 'Later items take precidence over earlier ones.' echo - prose 'It looks for a helper program at `/lib/xbs/helper-${BUILDSYSTEM}`.' + prose 'It looks for a helper programs named helper-${BUILDSYSTEM}, in + the directory `%q` by default, but this directory can be changed + with the environmental variable XBS_LIBDIR.' "$default_libdir" echo print 'Options:' flag "-b $(_ BUILDSYSTEM)" 'BUILDSYSTEM instead of the one configured in @@ -57,8 +61,8 @@ usage() { flag "move $(_ 'FROMREPO TOREPO PKGBASE')" \ 'Move a pkgbase from one repo to another' flag "releasepath $(_ 'PKGBASE REPO ARCH')" \ - 'Print the path to the staged version of pkgbase. Exit with a - non-zero value if PKGBASE is not staged for that REPO-ARCH' + 'Print the path to the staged version of pkgbase, or exit with + non-zero if not released' } status() { @@ -110,10 +114,17 @@ main() { if [[ -z $BUILDSYSTEM ]]; then load_files xbs || return 1 - check_vars xbs BUILDSYSTEM || return 1 + check_vars xbs BUILDSYSTEM || { + prose 'or specify the `-b` flag.' >&2 + return 1 + } fi - HELPER="/lib/xbs/helper-${BUILDSYSTEM}" + if [[ -z $XBS_LIBDIR ]]; then + export XBS_LIBDIR=$default_libdir + fi + + HELPER="${XBS_LIBDIR}/helper-${BUILDSYSTEM}" if [[ ! -x "$HELPER" ]]; then error 'No helper for build system found: %s' "$BUILDSYSTEM" return 1; |