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 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() # main()
# #
@ -498,7 +510,7 @@ chroot)
chroot_handler chroot dummy chroot_handler chroot dummy
;; ;;
clean) clean)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $? chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $?
else else
@ -518,7 +530,7 @@ remove-autodeps)
;; ;;
fetch|extract|build|configure|install|install-destdir|build-pkg) fetch|extract|build|configure|install|install-destdir|build-pkg)
BEGIN_INSTALL=1 BEGIN_INSTALL=1
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG
else else
@ -526,38 +538,38 @@ fetch|extract|build|configure|install|install-destdir|build-pkg)
fi fi
;; ;;
remove|remove-destdir) remove|remove-destdir)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
remove_pkg $XBPS_CROSS_BUILD remove_pkg $XBPS_CROSS_BUILD
;; ;;
list) list)
$XBPS_QUERY_CMD -l $XBPS_QUERY_CMD -l
;; ;;
show) show)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg show_pkg
;; ;;
show-files) show-files)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_files show_pkg_files
;; ;;
show-deps) show-deps)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_deps show_pkg_deps
;; ;;
show-build-deps) show-build-deps)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_build_deps show_pkg_build_deps
;; ;;
show-options) show-options)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_options show_pkg_options
;; ;;
show-shlib-provides) show-shlib-provides)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_shlib_provides show_pkg_shlib_provides
;; ;;
show-shlib-requires) show-shlib-requires)
setup_pkg $XBPS_TARGET_PKG $XBPS_CROSS_BUILD read_pkg
show_pkg_shlib_requires show_pkg_shlib_requires
;; ;;
zap) zap)