You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow xattr components to target existing repo namespaces #65
When using user.component xattr to tag files that are generated at install time (e.g. .pyc bytecode), I would like to group those files in the parent RPM that created it, however chunkah always places xattr-claimed files into the xattr/ namespace, creating a separate component from the RPM-owned files.
For example
The google-cloud-cli RPM generates 200ish MB of .pyc files at install time, which is not "owned" by the RPM. They will be updated together, so should ideally be in the same component & layer.
If we allowed the user.component to include a repo prefix, e.g. "rpm/google-cloud-cli", and this would be joined into an RPM component of that name. I think it's pretty safe that, if a component name includes "rpm/" or "apt/" etc, that the user would want this behaviour.
Would also help (though not the perfect solution for) #35
$ rpm -qp 2576e31740f3fa7261bf41676ad7a4f51fef1af2a99c952e648f1432670595d4-google-cloud-cli-557.0.0-1.x86_64.rpm --scripts
warning: 2576e31740f3fa7261bf41676ad7a4f51fef1af2a99c952e648f1432670595d4-google-cloud-cli-557.0.0-1.x86_64.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID f09c394c3e1ba8d5: NOKEY
postinstall scriptlet (using /bin/sh):
# Perform post-process after an installation.
if [ "$1" -eq "1" ]; then
gcloud components post-process --force-recompile
fi
preuninstall scriptlet (using /bin/sh):
# Manually remove .pyc files since they are not created until post-process
rpm -ql google-cloud-sdk | grep \.py$ | while read file
do
rm -f "${file}"[co] >/dev/null
# rm python3 pyc files
rm -f `dirname ${file}`/__pycache__/`basename ${file} .py`\.*py[co]
done
rm -rf /usr/lib64/google-cloud-sdk/.install/help_text
# remove any empty __pycache__ dirs under /usr/lib/google-cloud-sdk/
find /usr/lib64/google-cloud-sdk/ -type d -name __pycache__ -empty -print0 \
| xargs --null --no-run-if-empty rmdir
postuninstall scriptlet (using /bin/sh):
# Perform post-process after an upgrade.
if [ "$1" -eq "1" ]; then
gcloud components post-process --force-recompile
fi
I suspect the --force-recompile there is what's doing this. Not against supporting something like this, but it's also quite weird. Fedora-derived RPMs do ship the .pyc files proper as part of the payload, but even if google-cloud-cli doesn't want to do that, it could at least register the paths as %ghost files.
The general feature request itself seems reasonable though. Perhaps a cleaner way to do this however is to support a mechanism for forcing some components to always be together. That generalizes beyond xattrs. Need to think about it.
Activity
jlebon commentedon Feb 24, 2026
I suspect the
--force-recompilethere is what's doing this. Not against supporting something like this, but it's also quite weird. Fedora-derived RPMs do ship the.pycfiles proper as part of the payload, but even if google-cloud-cli doesn't want to do that, it could at least register the paths as%ghostfiles.The general feature request itself seems reasonable though. Perhaps a cleaner way to do this however is to support a mechanism for forcing some components to always be together. That generalizes beyond xattrs. Need to think about it.