mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
buildserver: make sure cachedir is accessible to VM instance
It seems that KVM/QEMU's 9p sharing is more sensitive to file perms. If ~/.cache is 0700, then ~/.cache/fdroidserver cannot be mounted in the guest
This commit is contained in:
parent
0ae2df6646
commit
f306e32636
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
import requests
|
||||
import stat
|
||||
import sys
|
||||
import subprocess
|
||||
import time
|
||||
|
@ -89,6 +90,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['apt_package_cache']:
|
||||
config['aptcachedir'] = cachedir + '/apt/archives'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue