On 2023-01-13 10:12, Ralf Mardorf wrote:
Hi,
how about a PKGBUILD that contains a script similar to
if an old instance isn't already installed then install it for the very first time and exit else install it to a different path
No, you can't do this. At the time a package is created it doesn't necessarily have access to even inspect the eventual target system. Sometimes it looks like you can when hacking on a PKGBUILD locally, but it is incorrect usage that is guaranteed *NOT* to work in the field. I suggest a split package (or two package) approach with careful use of version numbers in depends/provides statements such that the current package always requires the one-prior version provided by the legacy package. The legacy package should be setup to run in an alternative location & name such that it doesn't conflict with the current version. Then tweak the upgrade script for use in post_install to use the legacy package locations appropriately. The PostreSQL packaging has a similar setup.