Bug 30609 - Script error in nethack fonts package.
Summary: Script error in nethack fonts package.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
: 31696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-05 17:38 CEST by Nicholas Longo
Modified: 2023-03-24 06:57 CET (History)
8 users (show)

See Also:
Source RPM: nethack-3.6.6-4.mga8, nethack-3.6.6-6.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Nicholas Longo 2022-07-05 17:38:54 CEST
Description of problem:
Installing nethack on a bare bones system runs into error.

Version-Release number of selected component (if applicable):
nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch

How reproducible:
Install nethack on a barebones system lacking X11.  (In this case I am using the docker image.)

In which case I get the error: 

/usr/share/fonts/nethack/: scandir: No such file or directory
ln: failed to create symbolic link '/etc/X11/fontpath.d/nethack': No such file or directory
warning: %post(nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch) scriptlet failed, exit status 1
ERROR: 'script' failed for nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch

As far as I can tell the package "nethack-bitmap-fonts" is creating a folder "/usr/share/fonts/nethack-bitmap-fonts" not "/usr/share/fonts/nethack", so the scripts in the "nethack-bitmap-fonts-core" rpm are trying to link to the wrong place?

Also this leads to errors removing the package.  You get the error:

rm: cannot remove '/etc/X11/fontpath.d/nethack': No such file or directory
rm: cannot remove '/usr/share/fonts/nethack/fonts.dir': No such file or directory
error: %preun(nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch) scriptlet failed, exit status 1
ERROR: 'script' failed for nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
error: nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch: erase failed

If any reading this hits the uninstall error, the following worked for me. 
mkdir -p /usr/share/fonts/nethack/
touch /usr/share/fonts/nethack/fonts.dir
mkdir -p /etc/X11/fontpath.d/
touch /etc/X11/fontpath.d/nethack
urpme nethack-bitmap-fonts-core

Steps to Reproduce:
1. Run docker image.  
2. As root, run "urpmi nethack"
3. The package nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch produces the error
/usr/share/fonts/nethack/: scandir: No such file or directory
ln: failed to create symbolic link '/etc/X11/fontpath.d/nethack': No such file or directory
warning: %post(nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch) scriptlet failed, exit status 1
ERROR: 'script' failed for nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
Comment 1 Marja Van Waes 2022-07-06 11:18:46 CEST
Assigning to all packagers collectively, since there is no registered maintainer for nethack (the source package for which nethack-bitmap-fonts-core)

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs
Source RPM: nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch => nethack-3.6.6-4.mga8

Comment 2 Marja Van Waes 2022-07-06 11:21:05 CEST
Oops, I hadn't seen bug 30612.

Assigning back to BugSquad for now.

Assignee: pkg-bugs => bugsquad

Comment 3 Lewis Smith 2022-07-07 20:13:14 CEST
Thank you Nicholas for the report.
Test installing this on a full system appeared to work, but actually doing it resulted in:
 2/3: nethack-bitmap-fonts-core
 /usr/share/fonts/nethack/: scandir: No such file or directory

After removing 'nethack', which left 2 orphans:
 $ sudo urpme --auto-orphans
To satisfy dependencies, the following 2 packages will be removed (50KB):
  nethack-bitmap-fonts-3.6.6-4.mga8.noarch
  nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
Tynnu 2 becyn? (y/N) y
wrthi'n tynnu nethack-bitmap-fonts-3.6.6-4.mga8.noarch nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
rm: cannot remove '/usr/share/fonts/nethack/fonts.dir': No such file or directory
error: %preun(nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch) scriptlet failed, exit status 1
ERROR: 'script' failed for nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
error: nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch: erase failed
wrthi'n tynnu'r pecyn nethack-bitmap-fonts-3.6.6-4.mga8.noarch.
      1/1: wrthi'n tynnu nethack-bitmap-fonts-3.6.6-4.mga8.noarch
                                 #############################################
so it pulled 'nethack-bitmap-fonts' OK.

Trying to remove the other:
 $ sudo urpme nethack-bitmap-fonts-core
wrthi'n tynnu nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
rm: cannot remove '/etc/X11/fontpath.d/nethack': No such file or directory
rm: cannot remove '/usr/share/fonts/nethack/fonts.dir': No such file or directory
error: %preun(nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch) scriptlet failed, exit status 1
ERROR: 'script' failed for nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch
error: nethack-bitmap-fonts-core-3.6.6-4.mga8.noarch: erase failed

All this conforms with the report, and happened on a system with X etc.

I think it is justified to forward this bug. I have put again 'all packagers', CC'ing tv and shlomi (if he is still with us) who dealt with similar problems on this package 2y ago.

Assignee: bugsquad => pkg-bugs
CC: (none) => shlomif, thierry.vignaud
See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=30612

Comment 4 sturmvogel 2023-03-18 07:31:17 CET
*** Bug 31696 has been marked as a duplicate of this bug. ***

CC: (none) => bittwister2

sturmvogel 2023-03-18 07:33:42 CET

Source RPM: nethack-3.6.6-4.mga8 => nethack-3.6.6-4.mga8, nethack-3.6.6-6.mga9.src.rpm
Version: 8 => Cauldron
Whiteboard: (none) => MGA8TOO

Comment 5 David GEIGER 2023-03-21 18:31:47 CET
Should be fixed in nethack-3.6.7-1.mga9.


Also for mga8, please test:

Packages in 8/Core/Updates_testing:
======================
nethack-3.6.7-1.mga8
nethack-bitmap-fonts-core-3.6.7-1.mga8.noarch.rpm
nethack-bitmap-fonts-3.6.7-1.mga8.noarch.rpm


From SRPMS:
nethack-3.6.7-1.mga8.src.rpm

Assignee: pkg-bugs => qa-bugs
CC: (none) => geiger.david68210

Comment 6 Thomas Andrews 2023-03-23 18:13:18 CET
I checked it out, and it seems to be fixed in Cauldron. Changing to a Mageia 8 bug.

Version: Cauldron => 8
CC: (none) => andrewsfarm
Whiteboard: MGA8TOO => (none)

Comment 7 Thomas Andrews 2023-03-23 19:54:12 CET
Well now, that's interesting...

MGA8-64 Plasma, in VirtualBox.

I installed nethack using MCC, which installed all three packages. Played the game, which while I didn't get far seemed fine. Then I again used MCC, launched from the panel icon, to attempt to remove nethack and dependencies once more. That seemed to go as it should, no errors, but when I went back to install it again before the update, nethack-bitmap-fonts-core was listed as still installed. Attempting to use urpme to remove it resulted in the error that Lewis saw, and an attempt to remove it with MCC launched from the command line didn't work, either - though the error message did show in the terminal window.

So I installed the packages that DID remove, and used qarepo to get the updates. Then I once again played the game, which again seemed fine. Then I used urpme to remove all the packages, which it did without any errors. Installed them again, and used MCC from the command line to remove them, again without errors.

So I'm going to give this an OK, and validate.

CC: (none) => sysadmin-bugs
Keywords: (none) => validated_update
Whiteboard: (none) => MGA8-64-OK

Dave Hodgins 2023-03-24 00:45:42 CET

Keywords: (none) => advisory
CC: (none) => davidwhodgins

Comment 8 Mageia Robot 2023-03-24 06:57:07 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2023-0028.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.