Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.87k stars 9.59k forks source link

Still more opt-related detritus left after `brew rm` #2992

Closed chdiza closed 7 years ago

chdiza commented 7 years ago

brew rm jpeg leaves broken symlinks behind. To reproduce:

$ brew install jpeg
$ brew rm jpeg

The observe that the broken symlinks /usr/local/opt/libjp{,e}g are still hanging around. brew prune will remove them, but that shouldn't be necessary.

Also, (and strangely) sometimes only one of those dead symlinks is present, namely libjpg.

It might, for all I know, have something to do with the fact that I also have graphicsmagick and libtiff installed, and both of those have jpeg as a dep.

The goods:

Doctor says my system is "ready to brew". And,

HOMEBREW_VERSION: 1.3.0-15-g2ad03b8
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2ad03b8eb30ca69bf4b45c1cfc1ca619e49b9a04
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 6071fea8d51c9b3c5e71cfd9c2649f6732be7e0a
Core tap last commit: 51 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/hb
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.13.4 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: N/A
macOS: 10.12.6-x86_64
Xcode: 8.3.3
CLT: 8.3.2.0.1.1492020469
X11: N/A

I reported this once before in #2427, and it was fixed. I guess it's back now.

apjanke commented 7 years ago

I can reproduce on my current laptop "toast", and I don't have graphicsmagick or libtiff installed. None of my currently installed formulae use jpeg.

$ brew ls
browser     fontconfig  gdbm        isl     openmotif   pstree      zsh
dos2unix    fortune     gettext     libmpc      openssl     tree
duti        freetype    git     libpng      openssl@1.1 watch
exercism    gcc     gmp     mpfr        pcre        wget

$ brew install jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-8d.sierra.bottle.2.tar.gz
Already downloaded: /Users/janke/Library/Caches/Homebrew/jpeg-8d.sierra.bottle.2.tar.gz
==> Pouring jpeg-8d.sierra.bottle.2.tar.gz
==> Using the sandbox
🍺  /usr/local/Cellar/jpeg/8d: 19 files, 708.3KB
[~]
$ brew rm jpeg
Uninstalling /usr/local/Cellar/jpeg/8d... (19 files, 708.3KB)
[~]
$ ls -d /usr/local/opt/libj*
/usr/local/opt/libjpeg /usr/local/opt/libjpg
[~]
$ brew uses jpeg --installed
[~]
$

I can't currently brew prune to test that part, because I'm getting a conflict with an externally-installed GhostScript.

$ brew prune
Error: Permission denied - /usr/local/share/ghostscript/9.19/Resource/CIDFSubst/ipaexg.ttf

On my system, brew doctor spams me about files from Tcl, GhostScript, and R, but things look okay otherwise.