Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ideascube
ARCHIVED Kiwix Hotspot
Commits
de34346d
Commit
de34346d
authored
Sep 25, 2018
by
rgaudin
Browse files
Fixed space required assesment bug in CLI (was only accounting for image size)
parent
ca5c2a97
Pipeline
#77235
passed with stage
in 327 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
de34346d
...
...
@@ -4,6 +4,7 @@
* Disabled some logs on target system to increase SD card lifespan
* Updated Wikifundi language packs (2018-09-24)
* Added a Cache Folder Management tool
* Fixed space required assements issue on CLI mode
2.0-rc11
* Fixed an unmount issue on Linux
...
...
kiwix-hotspot/cli.py
View file @
de34346d
...
...
@@ -290,7 +290,7 @@ avail_space_in_build_dir = get_free_space_in_dir(args.build_dir)
try
:
# how much space do we need to build the image?
space_required_to_build
=
get_required_building_space
(
collection
,
cache_folder
,
args
.
size
collection
,
cache_folder
,
args
.
output_
size
)
# how large should the image be?
required_image_size
=
get_required_image_size
(
collection
)
...
...
@@ -310,20 +310,21 @@ if args.size < base_image_size:
if
args
.
output_size
<
required_image_size
:
print
(
"image size ({img}) is not large enough for the content ({req})"
.
format
(
"image size ({img}
/{img2}
) is not large enough for the content ({req})"
.
format
(
img
=
human_readable_size
(
args
.
size
,
False
),
img2
=
human_readable_size
(
args
.
output_size
,
False
),
req
=
human_readable_size
(
required_image_size
,
False
),
),
file
=
sys
.
stderr
,
)
sys
.
exit
(
3
)
if
avail_space_in_build_dir
<
args
.
output_size
:
if
avail_space_in_build_dir
<
space_required_to_build
:
print
(
"Not enough space available at {dir} ({free}) to build image ({
img
})"
.
format
(
"Not enough space available at {dir} ({free}) to build image ({
req
})"
.
format
(
dir
=
args
.
build_dir
,
free
=
human_readable_size
(
avail_space_in_build_dir
),
img
=
human_readable_size
(
args
.
size
),
req
=
human_readable_size
(
space_required_to_build
),
),
file
=
sys
.
stderr
,
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment