Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#25808 - [ltris] can't be upgraded due to /var/games/ltris.hscr and is built twice

Attached to Project: Community Packages
Opened by Heiko Baums (cyberpatrol) - Monday, 29 August 2011, 10:19 GMT
Last edited by Jaroslav Lichtblau (Dragonlord) - Sunday, 18 December 2011, 17:13 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
ltris can't be upgraded, because /var/games/ltris.hscr is already existing in the filesystem.

If my tests ran correctly this can be avoided by removing
touch /var/games/ltris.hscr
from post_install() in ltris.install.

Without it /var/games/ltris.hscr is automatically created if it doesn't exist. Otherwise it's kept untouched.

To be on the safe side a backup=('var/games/ltris.hscr') could be added to the PKGBUILD, but I think it's not necessary.

And I'm not sure if it's necessary to run
./configure --prefix=/usr --localstatedir=/var/games
make
for a second time after make install in package(). I guess it's forgotten to be removed.
This task depends upon

Closed by  Jaroslav Lichtblau (Dragonlord)
Sunday, 18 December 2011, 17:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in ltris 1.0.18-1
Comment by Jonathan Liu (net147) - Monday, 29 August 2011, 10:40 GMT
I think just need to add var/games/ltris.hscr to backup array.
Comment by Heiko Baums (cyberpatrol) - Monday, 29 August 2011, 11:06 GMT
No, in this case this doesn't help, because this file is unnecessarily created by touch in post_install() which is not taken into account by backup. In fact backup isn't necessary, because the file is created automatically if it doesn't exist and untouched if it already exists. But if it's created automatically - I guess by make install - it gets wrong file permissons so that the chown and chmod commands need to be kept in ltris.install.
Comment by Jonathan Liu (net147) - Monday, 29 August 2011, 11:12 GMT
The touch command does not create ltris.hscr. /var/games/ltris.hscr is already in the binary package.
Comment by Jonathan Liu (net147) - Monday, 29 August 2011, 11:13 GMT
The touch command only seems to create it if it was deleted at some point after installing the package.
Comment by Heiko Baums (cyberpatrol) - Monday, 29 August 2011, 11:24 GMT
That ltris.hscr is already in the binary package is the reason why the touch command is not necessary. This file is not deleted after installing the package. Maybe it was the case in older versions, but not in the recent version. It's only installed if it doesn't exist anymore. But the touch command is the reason why ltris can't be updated with the error message that /var/games/ltris.hscr already exists in the filesystem. This also prevents users from being able to update the whole system by pacman -Syu.

Believe me, I've tested it.
Comment by Heiko Baums (cyberpatrol) - Monday, 29 August 2011, 12:32 GMT
Thought about it again. I think the reason is/was in fact the touch command, which was probably necessary in previous versions, and the fact that it was called in post_install() instead of the PKGBUILD. Files which are created by post_install() aren't recognized by pacman as belonging to the package. Now this file is created by make install, installed by the PKGBUILD and belongs to the package. So pacman claims that this file already exists in the filesystem.

So the touch command can and should be removed from post_install().
Since I made my tests with pacman -U resp. makepkg -ci I don't know the behaviour of pacman -Syu. So I would suggest adding backup to the PKGBUILD.
Any other command (chown and chmod) in ltris.install should also be moved to the PKGBUILD.
The file ltris.install can then be removed.

Maybe this could be added to pre_upgrade():
if [ -f /var/games/ltris.hscr ]; then
mv /var/games/ltris.hscr /var/games/ltris.hscr.save
echo "/var/games/ltris.hscr.save was created"
fi
Or something like that. Of course, ltris.install needs to be kept then.

And, of course, the lines
./configure --prefix=/usr --localstatedir=/var/games
make
should be removed from package().

Loading...