Skip to content
Snippets Groups Projects
Commit 8317da34 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Collapse --acl and --xattr into --extended-filesystem-attributes to cover all...

Collapse --acl and --xattr into --extended-filesystem-attributes to cover all of these extended attributes, defaulting the new option to false (ie. to not check these very expensive external calls).
parent 9e3abf9d
No related branches found
No related tags found
No related merge requests found
Pipeline #220478 passed
...@@ -194,7 +194,7 @@ def compare_meta(path1, path2): ...@@ -194,7 +194,7 @@ def compare_meta(path1, path2):
if os.path.islink(path1) or os.path.islink(path2): if os.path.islink(path1) or os.path.islink(path2):
return [d for d in differences if d is not None] return [d for d in differences if d is not None]
if Config().acl: if Config().extended_filesystem_attributes:
try: try:
differences.append( differences.append(
Difference.from_operation(Getfacl, path1, path2, short=True) Difference.from_operation(Getfacl, path1, path2, short=True)
...@@ -204,7 +204,6 @@ def compare_meta(path1, path2): ...@@ -204,7 +204,6 @@ def compare_meta(path1, path2):
"Unable to find 'getfacl', some directory metadata differences might not be noticed." "Unable to find 'getfacl', some directory metadata differences might not be noticed."
) )
if Config().xattr:
try: try:
lsattr1 = lsattr(path1) lsattr1 = lsattr(path1)
lsattr2 = lsattr(path2) lsattr2 = lsattr(path2)
......
...@@ -311,18 +311,13 @@ def create_parser(): ...@@ -311,18 +311,13 @@ def create_parser():
"systems.", "systems.",
) )
group3.add_argument( group3.add_argument(
"--acl", "--extended-filesystem-attributes",
"--no-acl", "--no-extended-filesystem-attributes",
action=BooleanAction, action=BooleanAction,
default=True, default=False,
help="Examine POSIX ACLs (default: True)", help="Check potentially-expensive filesystem extended "
) "attributes such as POSIX ACLs, lsattr(1) attributes etc. "
group3.add_argument( "(default: False)",
"--xattr",
"--no-xattr",
action=BooleanAction,
default=True,
help="Examine extended attributes (default: True)",
) )
group3.add_argument( group3.add_argument(
"--diff-mask", "--diff-mask",
...@@ -659,8 +654,9 @@ def configure(parsed_args): ...@@ -659,8 +654,9 @@ def configure(parsed_args):
Config().exclude_directory_metadata = ( Config().exclude_directory_metadata = (
parsed_args.exclude_directory_metadata parsed_args.exclude_directory_metadata
) )
Config().acl = parsed_args.acl Config().extended_filesystem_attributes = (
Config().xattr = parsed_args.xattr parsed_args.extended_filesystem_attributes
)
Config().diff_masks = parsed_args.diff_masks Config().diff_masks = parsed_args.diff_masks
Config().compute_visual_diffs = PresenterManager().compute_visual_diffs() Config().compute_visual_diffs = PresenterManager().compute_visual_diffs()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment