Overview

Request 1072269 accepted

- Rewrite the script to Python:
* the current script is quite slow and delays libreoffice package
build where we install all packages and then uninstall them
* the script uses linkfile=${file/${datadir}/${libdir}} for replacement
of $datadir prefix with $libdir (if the $file path starts with $datadir;
if not, we end up with an empty string and we execute various shell
scripts with it
* the Python implementation should be more readable
* the Python version runs about 200s faster when it comes to libreoffice
package build (on a recent Ryzen 9 machine)


Danilo Spinella's avatar

Thank you for your change and improvement. I'll take some time to properly read and review both scripts before accepting.


Martin Liška's avatar
author source maintainer

Sure! If I see correctly, the script is run by the root user, so I don't put various x.unlink() and x.rmdir() ..


Martin Liška's avatar
author source maintainer

I've just made a script that I verify both scripts do the same: https://gist.github.com/marxin/35c0560c39d4fec0cee230c572090de4

podman build -t test -f Dockerfile --no-cache &>/tmp/1
podman build -t test -f Dockerfile2 --no-cache &>/tmp/2
diff -u /tmp/[12]

Martin Liška's avatar
author source maintainer

... and one can see the last step takes ~50s right now and 2s with the Python version of the script


Martin Liška's avatar
author source maintainer

This makes the build faster, but more importantly, it makes much installation and uninstallation whenever somebody installs libreoffice.


Request History
Martin Liška's avatar

marxin created request

- Rewrite the script to Python:
* the current script is quite slow and delays libreoffice package
build where we install all packages and then uninstall them
* the script uses linkfile=${file/${datadir}/${libdir}} for replacement
of $datadir prefix with $libdir (if the $file path starts with $datadir;
if not, we end up with an empty string and we execute various shell
scripts with it
* the Python implementation should be more readable
* the Python version runs about 200s faster when it comes to libreoffice
package build (on a recent Ryzen 9 machine)


Danilo Spinella's avatar

dspinella accepted request

Thank you! :)

openSUSE Build Service is sponsored by