Skip to content

Commit 6192725

Browse files
committed
Add in ability to add_file with a udf_path.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
1 parent 682275a commit 6192725

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tools/pycdlib-explorer

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,19 +336,19 @@ class PyCdlibCmdLoop(cmd.Cmd):
336336
print('The write command supports one and only one parameter.')
337337
return False
338338

339-
out_name = split[0]
340-
341-
self.iso.write(out_name)
339+
self.iso.write(split[0])
342340

343341
return False
344342

345343
def help_add_file(self):
346344
"""The help method for the 'add_file' command."""
347-
print('> add_file <iso_path> <src_filename> [rr_name=<rr_name>] [joliet_path=<joliet_path>]')
345+
print('> add_file <iso_path> <src_filename> [rr_name=<rr_name>] [joliet_path=<joliet_path>] [udf_path=<udf_path>]')
348346
print('Add the contents of <src_filename> to the ISO at the location specified in <iso_path>.')
349347
print('If the ISO is a Rock Ridge ISO, <rr_name> must be specified; otherwise, it must not be.')
350348
print('If the ISO is not a Joliet ISO, <joliet_path> must not be specified. If the ISO is a')
351-
print('Joliet ISO, <joliet_path> is optional, but highly recommended to supply.')
349+
print('Joliet ISO, <joliet_path> is optional, but highly recommended.')
350+
print('If the ISO is not a UDF ISO, <udf_path> must not be specified. If the ISO is a')
351+
print('UDF ISO, <udf_path> is optional, but highly recommended.')
352352

353353
def do_add_file(self, line):
354354
"""
@@ -364,11 +364,12 @@ class PyCdlibCmdLoop(cmd.Cmd):
364364
src_path = split[1]
365365
rr_name = None
366366
joliet_path = None
367+
udf_path = None
367368

368369
for arg in split[2:]:
369370
keyval = arg.split('=')
370371
if len(keyval) != 2:
371-
print('Invalid key/val pair, must be rr_name=<rr_name> or joliet_path=<joliet_path>')
372+
print('Invalid key/val pair, must be rr_name=<rr_name>, joliet_path=<joliet_path>, or udf_path=<udf_path>')
372373
return False
373374

374375
key = keyval[0]
@@ -378,8 +379,10 @@ class PyCdlibCmdLoop(cmd.Cmd):
378379
rr_name = val
379380
elif key == 'joliet_path':
380381
joliet_path = val
382+
elif key == 'udf_path':
383+
udf_path = val
381384
else:
382-
print('Unknown key, must be rr_name=<rr_name> or joliet_path=<joliet_path>')
385+
print('Unknown key, must be rr_name=<rr_name>, joliet_path=<joliet_path>, or udf_path=<udf_path>')
383386
return False
384387

385388
if self.iso.has_rock_ridge() and rr_name is None:
@@ -390,7 +393,7 @@ class PyCdlibCmdLoop(cmd.Cmd):
390393
tmp = self.cwds['iso9660'] + '/' + iso_path
391394
iso_path = pycdlib.utils.normpath(tmp).decode('ascii')
392395

393-
self.iso.add_file(src_path, iso_path, rr_name=rr_name, joliet_path=joliet_path)
396+
self.iso.add_file(src_path, iso_path, rr_name=rr_name, joliet_path=joliet_path, udf_path=udf_path)
394397

395398
return False
396399

0 commit comments

Comments
 (0)