@@ -416,6 +416,18 @@ def diff_metal(diff_from, diff_to):
416
416
git_diff (mount_dir_from , mount_dir_to )
417
417
418
418
419
+ def diff_metal_du (diff_from , diff_to ):
420
+ for mount_dir_from , mount_dir_to in diff_metal_helper (diff_from , diff_to ):
421
+ cmd = ['find' , '.' , '-type' , 'd' , '-exec' , 'du' , '-sh' , '{}' , ';' ]
422
+ diff_cmd_outputs (cmd , mount_dir_from , mount_dir_to , strategy = 'cd' )
423
+
424
+
425
+ def diff_metal_ls (diff_from , diff_to ):
426
+ for mount_dir_from , mount_dir_to in diff_metal_helper (diff_from , diff_to ):
427
+ cmd = ['find' , '.' ]
428
+ diff_cmd_outputs (cmd , mount_dir_from , mount_dir_to , strategy = 'cd' )
429
+
430
+
419
431
def diff_cmd_outputs (cmd , path_from , path_to , strategy = 'template' ):
420
432
workingdir = os .getcwd ()
421
433
with tempfile .NamedTemporaryFile (prefix = cmd [0 ] + '-' ) as from_output , \
@@ -478,6 +490,10 @@ DIFFERS = [
478
490
needs_ostree = OSTreeImport .NO , function = diff_metal_partitions ),
479
491
Differ ("metal" , "Diff metal disk image content" ,
480
492
needs_ostree = OSTreeImport .NO , function = diff_metal ),
493
+ Differ ("metal-du" , "Compare directory usage of metal disk image content" ,
494
+ needs_ostree = OSTreeImport .NO , function = diff_metal_du ),
495
+ Differ ("metal-ls" , "Compare directory listing of metal disk image content" ,
496
+ needs_ostree = OSTreeImport .NO , function = diff_metal_ls ),
481
497
]
482
498
483
499
if __name__ == '__main__' :
0 commit comments