You are not logged in.
Hi,
I am maintaining a lot of octave-* packages on AUR. They currently do this in ocave-<pkg>.install:
post_install() {
octave -q -f --eval "pkg install -verbose -global /usr/share/octave/$_pack.tar.gz"
}
This is an ugly hack that was necessary because the install modifies /usr/share/octave/octave_packages, where it keeps a list of installed packages. I now found a way to do the install in build()/package(), and to update octave_packages in the post_install() step. This is clearly a better solution.
To demonstrate, I have updated octave-miscellaneous accordingly:
Old: https://github.com/drizzd/octave-forge- … cellaneous
New: https://github.com/drizzd/octave-forge- … cellaneous
Now, I have the old package installed, and I should update to the new package with:
pacman -U octave-miscellaneous-1.2.1-2-any.pkg.tar.xz
This results in the following error:
error: failed to commit transaction (conflicting files)
octave-miscellaneous: /usr/lib/octave/packages/miscellaneous-1.2.1/x86_64-unknown-linux-gnu-api-v49+/PKG_ADD exists in filesystem
[...]
The reason is, of course, that pacman does not remove the files installed in the post_install() step of the old package. I tried to remove the files in the pre_upgrade() function of the new package, but the error above happens before pre_upgrade() is called. The only workaround I could find was to remove the package and all the packages it depends on:
pacman -R octave-miscellaneous <packages which depend on octave-miscellaneous>
Is there any way I can do this such that not every user of octave-* packages has to do this?
Cheers,
Clemens
Offline
https://wiki.archlinux.org/index.php/PKGBUILD#install
Can you clean up in pre_remove or post_remove? It won't help with the currently installed packages.
Offline
https://wiki.archlinux.org/index.php/PKGBUILD#install
Can you clean up in pre_remove or post_remove? It won't help with the currently installed packages.
Nope - the remove (and thus install scripts) are run after conflict checking.
Offline
Ok, so I will instruct users to do this:
pacman -Rc octave-miscellaneous
pacman -U octave-miscellaneous-1.2.1-2-any.pkg.tar.xz
Last edited by drizzd (2015-06-10 08:14:33)
Offline
You could release a new "octave" package, that removes all untracked files for all the addons.
pre_upgrade() {
if (( $(vercmp 1.2.1-2 $2) < 0 )); then
pkg ...
fi
}
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline