chiark / gitweb /
buildserver: only check cache permissions when using libvirt
authorHans-Christoph Steiner <hans@eds.org>
Fri, 23 Sep 2016 13:19:15 +0000 (15:19 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Fri, 23 Sep 2016 13:20:05 +0000 (15:20 +0200)
VirtualBox runs as the same user as `fdroid`, so the cache does not need to
be accessible by the world.  On libvirt, libvirtd runs the VMs as its own
user, so in that case, the cache dirs must have permissions to let that
user access them.

makebuildserver

index 5c29fbd9fc677d1b2db9f50fe541420df62e5eec..a5328f87f99aec845f8752bab3d8a7d4cffe07ea 100755 (executable)
@@ -105,14 +105,15 @@ cachedir = config['cachedir']
 if not os.path.exists(cachedir):
     os.makedirs(cachedir, 0o755)
 
-tmp = cachedir
-while tmp != '/':
-    mode = os.stat(tmp).st_mode
-    if not (stat.S_IXUSR & mode and stat.S_IXGRP & mode and stat.S_IXOTH & mode):
-        print('ERROR:', tmp, 'will not be accessible to the VM!  To fix, run:')
-        print('  chmod a+X', tmp)
-        sys.exit(1)
-    tmp = os.path.dirname(tmp)
+if config['vm_provider'] == 'libvirt':
+    tmp = cachedir
+    while tmp != '/':
+        mode = os.stat(tmp).st_mode
+        if not (stat.S_IXUSR & mode and stat.S_IXGRP & mode and stat.S_IXOTH & mode):
+            print('ERROR:', tmp, 'will not be accessible to the VM!  To fix, run:')
+            print('  chmod a+X', tmp)
+            sys.exit(1)
+        tmp = os.path.dirname(tmp)
 
 if config['apt_package_cache']:
     config['aptcachedir'] = cachedir + '/apt/archives'