]> xenbits.xensource.com Git - osstest.git/commitdiff
Add some sanity checks for presence of Repos configuration flight-58916 flight-58936 flight-58941 flight-58942 flight-58943 flight-58944 flight-58945 flight-58946 flight-58947 flight-58948 flight-58949 flight-58950 flight-58951 flight-58952 flight-58953 flight-58954 flight-58955 flight-58956 flight-58957 flight-58958 flight-58959 flight-58960 flight-58961 flight-58963 flight-58964 flight-58965 flight-58966 flight-58967 flight-58968 flight-58969 flight-58970
authorIan Campbell <ian.campbell@citrix.com>
Tue, 23 Jun 2015 09:54:10 +0000 (10:54 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 12:05:48 +0000 (13:05 +0100)
By providing an explicit fetch method in cri-getconfig which checks
things.

Without this then anything which uses cr-daily-branch produces the
rather cryptic:

    + test -f daily.xsettings
    ++ ./ap-print-url xen-unstable
    with-lock-ex ./ap-print-url: /lock: Permission denied
    + treeurl=
    FAILED rc=255

Which has caught out one or two people using standalone mode.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-and-Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
README
cri-getconfig
cri-lock-repos
standalone

diff --git a/README b/README
index 44e298997f561a767d5a574a4eb7be54a3e504c2..c3508a399640aa476b1fb2f98aaef5a5b8755e73 100644 (file)
--- a/README
+++ b/README
@@ -422,6 +422,11 @@ Stash
 Images
 Logs
 
+Repos              Full path to a temporary directory where repositories
+                   can be cloned. This is needed for anything which uses
+                   cr-daily-branch, including "./standalone make-flight"
+                   and "standalone-generate-dump-flight-runvars".
+
 DebianSuite
 GuestDebianSuite   defaults to DebianSuite
 
index a19b900c0a10013f1071e5e508783a2555c26eb9..0589bf072937fd1e5d5a278a9bbb554f955790da 100644 (file)
@@ -24,3 +24,18 @@ getconfig () {
                 print $c{"'$1'"} or die $!;
         '
 }
+
+getrepos() {
+       local repos=`getconfig Repos`
+       if [ -z "$repos" ] ; then
+               echo "Repos must be configured in $config" >&2
+               exit 1
+       fi
+       if [ ! -d "$repos" ] ; then
+               # Is likely an absolute path, so don't create automatically,
+               # just in case...
+               echo "Repos $repos does not exist" >&2
+               exit 1
+       fi
+       echo $repos
+}
index 7d10c87a1cc591b2b99f01995bb85067e74fc928..c8269f35e36897ac375df339bec0b09e8d5cd19c 100644 (file)
@@ -19,7 +19,7 @@
 
 . cri-common
 
-repos=`getconfig Repos`
+repos=`getrepos`
 repos_lock="$repos/lock"
 
 if [ "x$OSSTEST_REPOS_LOCK_LOCKED" != "x$repos_lock" ]; then
index 17fa40cb960881c6f7c8b338bc3e12dc077fd68a..b5c97c8913555b27c9c46d68527980086d1b7ec2 100755 (executable)
@@ -142,6 +142,12 @@ need_host() {
     fi
 }
 
+check_repos() {
+    # We don't care about the answer, just the error checking and
+    # logging to stderr.
+    OSSTEST_CONFIG=$config getrepos >/dev/null
+}
+
 ensure_logs() {
     if [ ! -d "logs" ] ; then
        mkdir "logs"
@@ -171,6 +177,7 @@ case $op in
        ;;
 
     make-flight)
+        check_repos
         need_flight
 
         if [ $# -lt 1 ] ; then