From 2e837e561d9919ef692abe2de7973d025dff065a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 01:35:00 -0400 Subject: ob-unpacksource: Improve upstream archive counting --- (limited to 'src') diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh index 26bb537..cec8213 100644 --- a/src/ob-unpacksource.sh +++ b/src/ob-unpacksource.sh @@ -33,17 +33,17 @@ unpack_native() get_upstream_archive() { upstream_ar_base="${OPK_SOURCE}-${OPK_SOURCE_VERSION_UPSTREAM}.orig.tar" - upstream_ar="$(find '..' -name "${upstream_ar_base}*")" - case "$(echo "${upstream_ar}" | grep -v '^$' | wc -l)" in - 0) + upstream_ar="$(printf '%s ' "../${upstream_ar_base}"*)" + case "${upstream_ar}" in + "../${upstream_ar_base}*") ob_info "$(ob_get_msg 'no_sources')" return 1 ;; - 1) - return 0 + *' '*) + ob_error "$(ob_get_msg 'multiple_upstream_sources')" ;; *) - ob_error "$(ob_get_msg 'multiple_upstream_sources')" + return 0 ;; esac } -- cgit v0.9.1