diff options
author | P. J. McDermott <pjm@nac.net> | 2012-05-21 23:54:52 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-05-22 00:07:16 (EDT) |
commit | 5b109ffb18d1790557594c149056971c98b6c625 (patch) | |
tree | 61c8e0202fd8f8842e3145160e1cac770316d78f /src | |
parent | cb9f794cc59ac058bcd1ad751c68a60a507c9bb9 (diff) |
Support '-S' and '-b' options.
Diffstat (limited to 'src')
-rw-r--r-- | src/opkbuild.sh | 31 |
1 files changed, 29 insertions, 2 deletions
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 <<EOF -Usage: ${1} [-r assume-uid0-cmd] [-a host-architecture] [-p host-platform] \ +Usage: ${1} [-S|-b] [-r assume-uid0-cmd] \ +[-a host-architecture] [-p host-platform] \ [-s status-override] [-d] EOF } @@ -56,7 +57,9 @@ error() exit 1 } -opts=$(getopt -n "${0}" -o 'r:a:p:ds:V' -- "${@}") +source_only=true +binary_only=true +opts=$(getopt -n "${0}" -o 'Sbr:a:p:ds:V' -- "${@}") if [ ${?} -ne 0 ]; then print_usage "${0}" >&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 |