From da2660e7848dd12a252f05b6028a40c548443c54 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jun 25 2014 19:49:32 +0000 Subject: don't assume specfile name matches package name in get_sources --- 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'