From 553e4236bc8f8f47c6ceb621b149145504ced402 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 3 Feb 2010 11:20:37 +0000 Subject: [PATCH] - take first spec Changed files: repackage.sh -> 1.31 --- repackage.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repackage.sh b/repackage.sh index 07a3fae..460f68a 100644 --- a/repackage.sh +++ b/repackage.sh @@ -87,6 +87,16 @@ specdump() { eval rpm-specdump $a || echo >&2 $? } +if [ $# = 0 ]; then + # if no spec name passed, glob *.spec + set -- *.spec + if [ ! -f "$1" -o $# -gt 1 ]; then + echo >&2 "ERROR: Too many or too few .spec files found" + echo >&2 "Usage: ${0##*/} PACKAGE.spec" + exit 1 + fi +fi + tmp=$(specdump "$@" | awk '$2 == "_target_cpu" {print $3}') if [ "$tmp" ]; then TARGET="$tmp" -- 2.44.0