From: Sage Weil Date: Sat, 12 Feb 2011 22:01:30 +0000 (-0800) Subject: look for dists in $path/../dists X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=57e5d3ac89de94476e9e6df4c9341628944877e1;p=ceph-build.git look for dists in $path/../dists --- diff --git a/gen_reprepro_conf.sh b/gen_reprepro_conf.sh index f35db318..8b037391 100755 --- a/gen_reprepro_conf.sh +++ b/gen_reprepro_conf.sh @@ -1,17 +1,27 @@ #!/bin/sh -path=$1 -comp=$2 - -dists=`cat $path/conf/dists` -components=`cat $path/conf/components` +path="$1" +comp="$2" + +if [ -e "$path/conf/dists" ]; then + dists=`cat $path/conf/dists` +else if [ -e "$path/../dists" ]; then + dists=`cat $path/../dists` +else + dists="$3" +fi -if [ -n "$comp" ]; then - if grep -v "\b$comp\b" $path/conf/components ; then - echo "adding component $comp" - components="$components $comp" - echo $components > $path/conf/components +if [ -e "$path/conf/components" ]; then + components=`cat $path/conf/components` + if [ -n "$comp" ]; then + if grep -v "\b$comp\b" $path/conf/components ; then + echo "adding component $comp" + components="$components $comp" + echo $components > $path/conf/components + fi fi +else + components="$comp" fi echo "dists $dists"