From 5b109ffb18d1790557594c149056971c98b6c625 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 21 May 2012 23:54:52 -0400 Subject: Support '-S' and '-b' options. --- (limited to 'src') diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 7b53fa6..18991e7 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -26,7 +26,8 @@ print_usage() { cat <&2 exit 1; @@ -64,6 +67,14 @@ fi eval set -- "${opts}" while true; do case "${1}" in + -S) + source_only=true + shift + ;; + -b) + binary_only=true + shift + ;; -r) uid0_cmd=${2} shift 2 @@ -99,6 +110,10 @@ while true; do esac done +if ${source_only} && ${binary_only}; then + printf 'opkbuild: Error: Cannot combine -S and -b\n' >&2 + exit 1 +fi if [ -z "${uid0_cmd}" ]; then uid0_cmd=fakeroot fi @@ -284,6 +299,10 @@ oh-checkbuilddeps -s "${status_override}" || error "${srcpkg}-src" printf '\n' +# TODO: This should maybe go in the library. + +if ! ${binary_only}; then + # Build *-src package. printf 'opkbuild: Attempting to build package "%s"...\n' "${srcpkg}-src" printf 'opkbuild: Installing files for package "%s"...\n' "${srcpkg}-src" @@ -305,6 +324,12 @@ done ( ${uid0_cmd} rm -Rf ${srcpkg}-src.data;) || error "${srcpkg}-src" printf 'opkbuild: Package "%s" complete!\n\n' "${srcpkg}-src" +fi + +# TODO: This should maybe go in the library. + +if ! ${source_only}; then + # Build other binary packages. for binpkgdir in ../*.pkg/; do binpkg=${binpkgdir#'../'} @@ -381,6 +406,8 @@ for binpkgdir in ../*.pkg/; do fi done +fi + # Clean up tmp. cd .. rm -Rf tmp -- cgit v0.9.1