xbps-src: re-add support for looking in templates in cwd.

This commit is contained in:
Juan RP 2014-03-23 09:04:05 +01:00
parent c343fbf42a
commit ae8458d875
1 changed files with 22 additions and 10 deletions

View File

@ -275,6 +275,18 @@ exit_func() {
exit 2
}
basename_cwd() {
echo $(basename $(pwd))
}
read_pkg() {
if [ -z "${XBPS_TARGET_PKG}" ]; then
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
XBPS_TARGET_PKG=$(basename_cwd)
fi
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
}
#
# main()
#
@ -498,7 +510,7 @@ chroot)
chroot_handler chroot dummy
;;
clean)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $?
else
@ -518,7 +530,7 @@ remove-autodeps)
;;
fetch|extract|build|configure|install|install-destdir|build-pkg)
BEGIN_INSTALL=1
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG
else
@ -526,38 +538,38 @@ fetch|extract|build|configure|install|install-destdir|build-pkg)
fi
;;
remove|remove-destdir)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
remove_pkg $XBPS_CROSS_BUILD
;;
list)
$XBPS_QUERY_CMD -l
;;
show)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg
;;
show-files)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_files
;;
show-deps)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_deps
;;
show-build-deps)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_build_deps
;;
show-options)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_options
;;
show-shlib-provides)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_shlib_provides
;;
show-shlib-requires)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD
read_pkg
show_pkg_shlib_requires
;;
zap)