[Bug 237369] pkg delete removes required NLS directories
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Apr 18 21:04:26 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237369
Bug ID: 237369
Summary: pkg delete removes required NLS directories
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: ports-bugs at FreeBSD.org
Reporter: se at FreeBSD.org
A port I maintain (math/gh-bc) installs POSIX message catalog files below
${PREFIX}/share/nls/ .
While the installation succeeds first time, it fails after the package has been
de-installed, since the directory ${PREFIX}/share/nls/C has been removed.
That directory is not directly used in the package, but it is the symlink
target of ${PREFIX}/share/nls/en_US.US-ASCII where a message catalog is
installed by the port/package and removed by pkg delete.
To reproduce:
Make sure there is no message catalog file in ${PREFIX}/share/nls/C , then:
pkg install gh-bc
pkg delete gh-bc
---> the empty directory ${PREFIX}/share/nls/C has been deleted
pkg install gh-bc
---> the installation fails due to a file that is to be installed in
${PREFIX}/share/nls/en_US.US-ASCII/ which points to the no longer existing
${PREFIX}/share/nls/C (which is not automatically created).
IMHO, pkg delete should not delete ${PREFIX}/share/nls/C (which is not even
contained in pkg-plist of the port) when this directory has become empty (after
the last message catalog has been deleted).
As is, the de-installation of the gh-bc port will cause surprising breakage on
users' systems (and the cause is not obvious from the error messages of the
failed installation attempt, see last line of the following log):
# ls -l /usr/local/share/nls/C /usr/local/share/nls/en_US.US-ASCII
lrwxr-xr-x 1 root wheel 1 May 25 2011 /usr/local/share/nls/en_US.US-ASCII
-> C
/usr/local/share/nls/C:
total 0
# pkg add /usr/packages/All/gh-bc-1.2.4.txz
Installing gh-bc-1.2.4...
Extracting gh-bc-1.2.4: 100%
# pkg delete gh-bc
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages
in the universe):
Installed packages to be REMOVED:
gh-bc-1.2.4
Number of packages to be removed: 1
Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling gh-bc-1.2.4...
[1/1] Deleting files for gh-bc-1.2.4: 100%
# ls -l /usr/local/share/nls/C /usr/local/share/nls/en_US.US-ASCII
ls: /usr/local/share/nls/C: No such file or directory
lrwxr-xr-x 1 root wheel 1 May 25 2011 /usr/local/share/nls/en_US.US-ASCII
-> C
# pkg add /usr/packages/All/gh-bc-1.2.4.txz
Installing gh-bc-1.2.4...
Extracting gh-bc-1.2.4: 69%
pkg: Fail to create hardlink:
/usr/local/share/nls/en_US.US-ASCII/.bc.cat.cbNr0pGVY6yN:No such file or
directory
Extracting gh-bc-1.2.4: 100%
Failed to install the following 1 package(s): /usr/packages/All/gh-bc-1.2.4.txz
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list