]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
look for dists in $path/../dists
authorSage Weil <sage@newdream.net>
Sat, 12 Feb 2011 22:01:30 +0000 (14:01 -0800)
committerSage Weil <sage@newdream.net>
Sat, 12 Feb 2011 22:01:30 +0000 (14:01 -0800)
gen_reprepro_conf.sh

index f35db318c9b43ea8357f9d32550652cc0a5b258c..8b03739186b485525a08ad76a7902db6cac12d3b 100755 (executable)
@@ -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"