@@ -424,6 +424,18 @@ def diff_metal(diff_from, diff_to):
424
424
git_diff (mount_dir_from , mount_dir_to )
425
425
426
426
427
+ def diff_metal_du (diff_from , diff_to ):
428
+ for mount_dir_from , mount_dir_to in diff_metal_helper (diff_from , diff_to ):
429
+ cmd = ['find' , '.' , '-type' , 'd' , '-exec' , 'du' , '-sh' , '{}' , ';' ]
430
+ diff_cmd_outputs (cmd , mount_dir_from , mount_dir_to , strategy = DiffCmdOutputStrategy .CD )
431
+
432
+
433
+ def diff_metal_ls (diff_from , diff_to ):
434
+ for mount_dir_from , mount_dir_to in diff_metal_helper (diff_from , diff_to ):
435
+ cmd = ['find' , '.' ]
436
+ diff_cmd_outputs (cmd , mount_dir_from , mount_dir_to , strategy = DiffCmdOutputStrategy .CD )
437
+
438
+
427
439
def diff_cmd_outputs (cmd , path_from , path_to , strategy : DiffCmdOutputStrategy = DiffCmdOutputStrategy .TEMPLATE ):
428
440
workingdir = None
429
441
with tempfile .NamedTemporaryFile (prefix = cmd [0 ] + '-' ) as from_output , \
@@ -485,6 +497,10 @@ DIFFERS = [
485
497
needs_ostree = OSTreeImport .NO , function = diff_metal_partitions ),
486
498
Differ ("metal" , "Diff metal disk image content" ,
487
499
needs_ostree = OSTreeImport .NO , function = diff_metal ),
500
+ Differ ("metal-du" , "Compare directory usage of metal disk image content" ,
501
+ needs_ostree = OSTreeImport .NO , function = diff_metal_du ),
502
+ Differ ("metal-ls" , "Compare directory listing of metal disk image content" ,
503
+ needs_ostree = OSTreeImport .NO , function = diff_metal_ls ),
488
504
]
489
505
490
506
if __name__ == '__main__' :
0 commit comments