mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
upgrades: Check free space before dist-upgrade
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
bacfc4bcee
commit
0e9e80f435
@ -345,6 +345,13 @@ def _check_and_dist_upgrade(develop=False, test_upgrade=False):
|
|||||||
'not set.')
|
'not set.')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
output = subprocess.check_output(['df', '--output=avail,pcent', '/'])
|
||||||
|
output = output.decode().split('\n')[1].split()
|
||||||
|
free_space, free_percent = int(output[0]), int(output[1][:-1])
|
||||||
|
if free_space < 1000000 or free_percent < 10:
|
||||||
|
print('Not enough free space in /.')
|
||||||
|
return
|
||||||
|
|
||||||
print(f'Upgrading from {dist} to {codename}...')
|
print(f'Upgrading from {dist} to {codename}...')
|
||||||
if check_dist == 'testing':
|
if check_dist == 'testing':
|
||||||
with open(SOURCES_LIST, 'r') as sources_list:
|
with open(SOURCES_LIST, 'r') as sources_list:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user