Since quicpkg uses python's tarfile module which does not support xattrs, we have a couple of options: 1) We can still use python's tarfile if we can use it to emulate the ways that GNU tar and/or bsdtar store xattrs. 2) We can use GNU tar and/or bsdtar. The --files-from option allows us to add files without the need to copy them to a temp directory first. Special quickpkg --include-config=n handling can be implemented by creating a tree of empty config files in a temporary directory, and using the GNU tar --transform option or bsdtar -s option to correct their path in the resulting tar file.
It appears that GNU tar represents xattrs as pax headers that python's tarfile module is capable of manipulating.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_550006 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/c57cfb9ca6582f39a224a691b068fae2
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1032cbf4c218741df1c57767fead2d00cc6321d9
Released in portage-2.2.21