Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.7] download-extensions: Strip out user.* xattrs #2406

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/download-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ dependenciesdir = f'{edestdir}/dependencies'
os.mkdir(dependenciesdir)


# Recursively remove all user.* xattrs from files and directories
# https://bugzilla.redhat.com/show_bug.cgi?id=2000195
def strip_user_xattrs_recurse(path):
removed = 0
for root, subdirs, files in os.walk(path):
for name in files + subdirs:
path = os.path.join(root, name)
for xname in os.listxattr(path):
if not xname.startswith('user.'):
continue
os.removexattr(path, xname)
removed += 1
if removed > 0:
print(f"Removed {removed} user.* xattrs")


# Downloads packages from specified repos
def yumdownload(destdir, pkgs):
# FIXME eventually use rpm-ostree for this
Expand Down Expand Up @@ -65,3 +81,5 @@ for (name, ext) in extensions['extensions'].items():

# Create the yum/dnf repo
cmdlib.run_verbose(['createrepo_c', '--no-database', '.'], cwd=edestdir)

strip_user_xattrs_recurse(edestdir)