Meson: Allow meson.add_custom_uninstall_script()

Created on 21 Jun 2017  路  2Comments  路  Source: mesonbuild/meson

Although very similar to #371 , some install scripts do not only generate files, but require a certain command to be run again. A specific case is 'gtk-update-icon-cache', which should be run again after the icons have been removed.

enhancement help wanted

Most helpful comment

I guess it should be meson.add_uninstall_script() (for analogy with meson.add_install_script()), right?

I don't understand how one doesn't always need an uninstall script if one needs an install script.

All 2 comments

I guess it should be meson.add_uninstall_script() (for analogy with meson.add_install_script()), right?

I don't understand how one doesn't always need an uninstall script if one needs an install script.

Suppose we implemented meson.add_uninstall_script(). Then, the default uninstall target would still print this status message

Uninstall finished.

Deleted: 0
Failed: 0

Remember that files created by custom scripts have not been removed.

鈥hich makes no sense if you have a custom uninstall script. :-(

Should it run at all (e.g. based on whether it actually has something to delete), or should it print something else?

A hacky way to fix it is to fake the content of meson-logs/install-log.txt in your custom install script, so that meson can take care of the deletion. Then, a custom uninstall script would only be needed for rerunning commands (if any).

Was this page helpful?
0 / 5 - 0 ratings