LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   WARNING: Unique directory /usr/share/ghostscript/9.54.0/Resource/Init/ contains new files (https://www.linuxquestions.org/questions/slackware-14/warning-unique-directory-usr-share-ghostscript-9-54-0-resource-init-contains-new-files-4175701169/)

emmet 09-27-2021 05:58 PM

WARNING: Unique directory /usr/share/ghostscript/9.54.0/Resource/Init/ contains new files
 
During the zen moments of watching slackpkg upgrade-all output scroll by, I noticed a few warning messages, which boil down to the one in the title. So I looked.

Code:

eford@dimholt:~$ ls -l /usr/share/ghostscript/9.54.0/Resource/Init/
total 8
-rw-r--r-- 1 root root 6774 Mar 31 15:57 cidfmap

Eh, some file created, probably in the course of ghostscript installation. Google says ghostscript generates a font mapping of some sort and stores it in cidfmap. A nothing burger, but a bit of cruft left behind.

The date is odd, though. My system was freshly built on August 10, which, if my calculations are correct, comes after March 31. So the file is older than the package installation, but not part of the package manifest. Curious.

The new version of ghostscript has the same file, created today, but prior to my update ritual.

Code:

eford@dimholt:~$ ls -l /usr/share/ghostscript/9.55.0/Resource/Init/cidfmap
-rw-r--r-- 1 root root 6774 Sep 27 14:01 /usr/share/ghostscript/9.55.0/Resource/Init/cidfmap

eford@dimholt:~$ sudo cat /var/log/secure|grep "upgrade\-all"
Sep 27 17:44:31 dimholt sudo:    eford : TTY=pts/3 ; PWD=/home/eford ; USER=root ; COMMAND=/usr/sbin/slackpkg upgrade-all

The package manifest for the new version of ghostscript does not contain this file, but it circles around it:

Code:

eford@dimholt:~$ grep cidfmap /var/log/packages/ghostscript-9.55.0-x86_64-1
usr/share/ghostscript/9.55.0/Resource/Init/FAPIcidfmap
usr/share/ghostscript/9.55.0/Resource/Init/cidfmap.default.ghostscript-9.55.0
usr/share/ghostscript/9.55.0/Resource/Init/cidfmap.new

My hypothesis, therefore, is that future warnings await me and will likely reveal themselves sometime after version 9.56.0 of ghostscipt is released. For the moment...

Code:

eford@dimholt:~$ sudo rm -r /usr/share/ghostscript/9.54.0
I know; I'm a wild man.

avian 09-28-2021 12:13 AM

Interesting.. I've had my install for quite some time.

Code:

/usr/share/ghostscript# ls -l
total 36
drwxr-xr-x 3 root root 4096 Oct 17  2019 9.27
drwxr-xr-x 3 root root 4096 Mar 15  2020 9.50
drwxr-xr-x 3 root root 4096 Mar 21  2020 9.51
drwxr-xr-x 3 root root 4096 Sep 14  2020 9.52
drwxr-xr-x 3 root root 4096 Sep 16  2020 9.53.0
drwxr-xr-x 3 root root 4096 Sep 28  2020 9.53.1
drwxr-xr-x 3 root root 4096 Oct  3  2020 9.53.2
drwxr-xr-x 3 root root 4096 Apr  1 22:51 9.53.3
drwxr-xr-x 7 root root 4096 Apr  1 06:57 9.54.0
lrwxrwxrwx 1 root root  22 Feb 17  2021 fonts -> /usr/share/fonts/Type1

So lets see whats in every old version's folder

Code:

find 9.27 9.50 9.51 9.52 9.53*
9.27
9.27/Resource
9.27/Resource/Init
9.27/Resource/Init/cidfmap
9.50
9.50/Resource
9.50/Resource/Init
9.50/Resource/Init/cidfmap
9.51
9.51/Resource
9.51/Resource/Init
9.51/Resource/Init/cidfmap
9.52
9.52/Resource
9.52/Resource/Init
9.52/Resource/Init/cidfmap
9.53.0
9.53.0/Resource
9.53.0/Resource/Init
9.53.0/Resource/Init/cidfmap
9.53.1
9.53.1/Resource
9.53.1/Resource/Init
9.53.1/Resource/Init/cidfmap
9.53.2
9.53.2/Resource
9.53.2/Resource/Init
9.53.2/Resource/Init/cidfmap
9.53.3
9.53.3/Resource
9.53.3/Resource/Init
9.53.3/Resource/Init/cidfmap

Seems cidfmap is left behind every time. I think ill be doing some rm -rf's myself.

rkelsen 09-28-2021 01:19 AM

cidfmap gets treated like any other config file. It has a ".new" extension in the Slackware package. This ensures that upgrading the package doesn't overwrite any custom config you might have.

So when you remove the package, it gets left behind. This is expected.

Quote:

Originally Posted by emmet
For the moment...
Code:

eford@dimholt:~$ sudo rm -r /usr/share/ghostscript/9.54.0
I know; I'm a wild man.

Wild as in Daniel Boone? Or Jed Clampett? Either way, that's the right way to "fix" it... provided that you don't have any customisations in there that you want to keep.

avian 09-28-2021 01:52 AM

Quote:

Originally Posted by rkelsen (Post 6287401)
cidfmap gets treated like any other config file. It has a ".new" extension in the Slackware package. This ensures that upgrading the package doesn't overwrite any custom config you might have.

So when you remove the package, it gets left behind. This is expected.

Sure, but when you upgrade a package, most packages upgrade to the same destination. So .new files work as expected, i.e. you are asked to consider a newer *.new file if you've made changes to your old config files etc. Because ghostscript creates a new folder each time (that includes the version number), it doesn't seem to act like other packages.

Doesn't really bother me to be honest, I was happy to manually remove unneeded old files. But its an interesting catch by the original poster. I wonder if there is a better way to handle the cidfmap.new file with the ghostscript doinst.sh script?

marav 09-28-2021 02:03 AM

I probably found the culprit in ghostscript.SlackBuild

line 185
Code:

# And finally, pray for upstream to quit drinking while coding. ;-)
:doh:

avian 09-28-2021 02:11 AM

Quote:

Originally Posted by marav (Post 6287408)
I probably found the culprit in ghostscript.SlackBuild

line 185
Code:

# And finally, pray for upstream to quit drinking while coding. ;-)
:doh:

Hilarious :D

rkelsen 09-28-2021 02:13 AM

Quote:

Originally Posted by avian (Post 6287407)
I wonder if there is a better way to handle the cidfmap.new file with the ghostscript doinst.sh script?

There might be... but this could be one of those situations where the solution is worse than the issue itself. You say that you've had your installation for "quite some time," and after all of that time, it was carrying 64Kb of excess config files. Is that a big problem?

avian 09-28-2021 02:56 AM

Quote:

Originally Posted by rkelsen (Post 6287410)
There might be... but this could be one of those situations where the solution is worse than the issue itself. You say that you've had your installation for "quite some time," and after all of that time, it was carrying 64Kb of excess config files. Is that a big problem?

I absolutely agree with everything you said.

But if there is an elegant solution that isn't worse than the issue itself, it would be nice. I certain wont lose sleep over it either way!

allend 09-28-2021 03:15 AM

On the principle of no surprise, I think it is best to leave things as is. Consider a user that has modified the config then decides to reinstall the existing package. The user would expect the existing config to be preserved. Clearing out this stale config is something I have done before.

avian 09-28-2021 03:53 AM

Quote:

Originally Posted by allend (Post 6287422)
On the principle of no surprise, I think it is best to leave things as is. Consider a user that has modified the config then decides to reinstall the existing package. The user would expect the existing config to be preserved. Clearing out this stale config is something I have done before.

Yeah you are almost certainly correct. I dont mind occasionally deleting stale files. Not suggesting anything, just thinking aloud. What if the cidfmap file is stored in a fixed location, say under /etc/ghostscript or /usr/share/ghostscript/ghostscript-settings or something. Then the ghostscript package can have a symbolic link to the file. Would allow one to automatically carry over modifications when upgrading (or reinstalling), and allow the symbolic link to be deleted when upgrading not leaving stale directories?

I'm sure that's probably well into the "could be one of those situations where the solution is worse than the issue itself" territory rkelsen mentioned.

Anyway, allend, as a fellow Melbournian, might be time to baton down the hatches, I hear we are in for a bunch of wild weather tonight.

allend 09-28-2021 08:07 AM

@avian - :hattip:
Wild weather? Nah, just some spring wind and rain. I could slip on one of my Slackware T-shirts. There was a long period when I thought I was the only one in Melbourne with those.

igadoter 09-28-2021 05:19 PM

I see no problem at all. It works s expected. Besides couple of rules there is no rules at all in Slackware. Now I can recall only two rules. Init system and using generic kernel. Beside that nothing comes to my mind. Shortly: there is no expected way for work. Rather we expect Slackware to be stable even supporting our own phantasies. Let OP has hope that accidents that something caught it's eyes in log won't happen often. In other case, well, managing system may became very boring.

rkelsen 09-28-2021 05:39 PM

Quote:

Originally Posted by allend (Post 6287466)
I could slip on one of my Slackware T-shirts. There was a long period when I thought I was the only one in Melbourne with those.

I'd highly doubt that. Back in the day, there was a whole section of Linux Users of Victoria dedicated to Slackware. I met a few of them back in the late 90s/early 2000s. One of them put a particular version of Slackware onto a CD for me, but I can't remember which. Maybe 7.1 or 8.0. Anyhow, he had access to high speed broadband at his office, and his employer let him download it. I was still on dial up at home, and my employer had stricter rules about using the internet.

I'm in the NW part of the metro area and that rain hasn't started here yet. By the look of the radar it might not happen for a few more hours.

Xsane 10-04-2021 04:02 PM

This was discussed before here:
https://www.linuxquestions.org/quest...er-4175666296/

None of the replies in either thread have changed my opinion that the dot new handler should not be used for config files with the version number it their path. It causes inconsistent behavior, leaves cruft in the filesystem and doesn't solve any problem.

rkelsen 10-04-2021 09:18 PM

Quote:

Originally Posted by Xsane (Post 6289092)
None of the replies in either thread have changed my opinion that the dot new handler should not be used for config files with the version number it their path. It causes inconsistent behavior, leaves cruft in the filesystem and doesn't solve any problem.

The amount of "cruft" is 8kb each time you upgrade this program. A small amount compared to the hours someone might have spent customising this file...

Ideally, the upstream authors should stop changing the file's location.


All times are GMT -5. The time now is 11:50 AM.