Pushed v2.4.1.
It should fix this error now and in the future.
- Added
PYTHONDONTWRITEBYTECODE=1 to yabsnap.sh to stop runtime generation of bytecode files as root; since they are part of the package.
- Switched from optimized (.opt-1.pyc) to standard (.pyc) filenames to bypass the current update conflict.
- Modified the .install cleanup to purge legacy .opt-1.pyc files during the upgrade.
Ack. It is likely because of Python version change inbetween. The current PKGBUILD does not seem to handle it. Let me look into fixing it.
Itmw, a workaround is to uninstall and reinstall.
After the latest update, the installation fails with an error.
Error: Failed to complete transaction (conflicting files)
yabsnap: '/usr/share/yabsnap/code/__pycache__/__init__.cpython-314.opt-1.pyc' exists in the filesystem
yabsnap: '/usr/share/yabsnap/code/mechanisms/__pycache__/bcachefs_mechanism.cpython-314.opt-1.pyc' exists in the filesystem
...
Made the change - update should work without breaking, switched to -O, took ownership, also added a .install line to delete previous .pyc files after the upgrade.
I think I pulled it off. Please LMK if you encounter anything bad! 🤞
Sorry I didn't see your note -
But using --overwrite also requires user's action, essentially similar to 1.
I'd like to avoid breaking this for unsuspecting users if I can save it.
pacman has the --overwrite option. You can use a glob to allow all files that have the same prefix to be overwritten.
Yes, but if I do that, since the __pycache__ dirs were not previously owned, it creates a conflict. What's the best way around it?
error: failed to commit transaction (conflicting files)
yabsnap: /usr/share/yabsnap/code/__pycache__/__init__.cpython-313.pyc exists in filesystem
yabsnap: /usr/share/yabsnap/code/__pycache__/auto_cleanup_without_ttl.cpython-313.pyc exists in filesystem
...
Can you please precompile the python files so they don't have to be compiled on first use.
Currently it only works incidentally as yabsnap is commonly run as root so files can be written into /usr/share/yabsnap/code/. Secondly these pyc files are not associated with a package and show up as lost files and are also not cleaned up on package removal.
To do this you can use the build-in python module "compileall" on the yabsnap python package root in the PKGBUILD.
Interesting. I made a small change and pushed 2.2.5-2. Would you kindly retry?