@@ -416,6 +416,18 @@ def diff_metal(diff_from, diff_to):
416416 git_diff (mount_dir_from , mount_dir_to )
417417
418418
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+
419431def diff_cmd_outputs (cmd , path_from , path_to , strategy = 'template' ):
420432 workingdir = os .getcwd ()
421433 with tempfile .NamedTemporaryFile (prefix = cmd [0 ] + '-' ) as from_output , \
@@ -478,6 +490,10 @@ DIFFERS = [
478490 needs_ostree = OSTreeImport .NO , function = diff_metal_partitions ),
479491 Differ ("metal" , "Diff metal disk image content" ,
480492 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 ),
481497]
482498
483499if __name__ == '__main__' :
0 commit comments