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