pushed
On 06/25/2014 02:46 PM, Mike McLean wrote:
From 5dc529359f59906716f50249cbaee000e747b7b7 Mon Sep 17 00:00:00 2001 From: Mike McLean mikem@redhat.com Date: Wed, 25 Jun 2014 15:42:08 -0400 Subject: [PATCH] don't assume specfile name matches package name in get_sources
get_sources.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/get_sources.sh b/get_sources.sh index 5533cfe..f1dd30c 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -47,23 +47,19 @@ do done
# check metadata file and extract package name -found=0 shopt -s nullglob -for meta in .*.metadata -do
- pn=${meta%.metadata}
- pn=${pn#.}
- if [ -e "SPECS/$pn.spec" ]
- then
found=1
break
- fi
-done -if (( $found != 1 )) +set -- .*.metadata +if (( $# == 0 )) then
- echo 'Missing metadata or spec. Please run from inside a sources git repo'
- echo 'Missing metadata. Please run from inside a sources git repo' exit 1
+elif (( $# > 1 )) +then
- echo "Warning: multiple metadata files found. Using $1"
fi +meta=$1 +pn=${meta%.metadata} +pn=${pn#.}
if [ ! -d .git ] || [ ! -d SPECS ]; then echo 'You need to run this from inside a sources git repo' -- 1.8.3.1