Report if item(s) are missing during build-ufd
This commit is contained in:
parent
64db679a4d
commit
6eb75c38a3
1 changed files with 7 additions and 2 deletions
|
|
@ -50,7 +50,9 @@ def build_ufd():
|
||||||
args = docopt(DOCSTRING)
|
args = docopt(DOCSTRING)
|
||||||
log.update_log_path(dest_name='build-ufd', timestamp=True)
|
log.update_log_path(dest_name='build-ufd', timestamp=True)
|
||||||
try_print = std.TryAndPrint()
|
try_print = std.TryAndPrint()
|
||||||
|
try_print.add_error(FileNotFoundError)
|
||||||
try_print.catch_all = False
|
try_print.catch_all = False
|
||||||
|
try_print.verbose = True
|
||||||
try_print.indent = 2
|
try_print.indent = 2
|
||||||
|
|
||||||
# Show header
|
# Show header
|
||||||
|
|
@ -190,6 +192,7 @@ def confirm_selections(update=False):
|
||||||
def copy_source(source, items, overwrite=False):
|
def copy_source(source, items, overwrite=False):
|
||||||
"""Copy source items to /mnt/UFD."""
|
"""Copy source items to /mnt/UFD."""
|
||||||
is_image = source.is_file()
|
is_image = source.is_file()
|
||||||
|
items_not_found = False
|
||||||
|
|
||||||
# Mount source if necessary
|
# Mount source if necessary
|
||||||
if is_image:
|
if is_image:
|
||||||
|
|
@ -202,13 +205,15 @@ def copy_source(source, items, overwrite=False):
|
||||||
try:
|
try:
|
||||||
io.recursive_copy(i_source, i_dest, overwrite=overwrite)
|
io.recursive_copy(i_source, i_dest, overwrite=overwrite)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# Going to assume (hope) that this is fine
|
items_not_found = True
|
||||||
pass
|
|
||||||
|
|
||||||
# Unmount source if necessary
|
# Unmount source if necessary
|
||||||
if is_image:
|
if is_image:
|
||||||
linux.unmount('/mnt/Source')
|
linux.unmount('/mnt/Source')
|
||||||
|
|
||||||
|
# Raise exception if item(s) were not found
|
||||||
|
raise FileNotFoundError('One or more items not found')
|
||||||
|
|
||||||
|
|
||||||
def create_table(dev_path, use_mbr=False):
|
def create_table(dev_path, use_mbr=False):
|
||||||
"""Create GPT or DOS partition table."""
|
"""Create GPT or DOS partition table."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue