homebrew-rmtree, 删除公式及其未使用的依赖项

分享于 

7分钟阅读

GitHub

  繁體 雙語
Remove a formula and its unused dependencies
  • 源代码名称:homebrew-rmtree
  • 源代码网址:http://www.github.com/beeftornado/homebrew-rmtree
  • homebrew-rmtree源代码文档
  • homebrew-rmtree源代码下载
  • Git URL:
    git://www.github.com/beeftornado/homebrew-rmtree.git
    Git Clone代码到本地:
    git clone http://www.github.com/beeftornado/homebrew-rmtree
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/beeftornado/homebrew-rmtree
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    自制 rmtree

    删除公式及其未使用的依赖项

    是什么?

    它是用于 Homebrew的外部命令插件,提供新的命令,rmtree,卸载该公式,卸载它的任何依赖项,而不安装任何依赖于它们的公式。 命令将从 命令行 上指定的一个递归地检查所有依赖项。

    这是个棘手的事情,所以这个命令有一个警告。

    警告警告

    有一些公式不指定它们的所有依赖关系。 这意味着这个命令可能会删除你仍需要的东西,不会删除你不再需要的东西。 一般情况下它很好。 直到有人出现了一个巧妙的方法,你需要注意你卸载的内容。 公式也可以依赖于你想要保留的某些内容,而它的他事实上也取决于它的( 除了你)。 请参见使用忽略某些公式被删除。

    安装

    点击这里存储库并通过 brew 自己安装。

    
    $ brew tap beeftornado/rmtree
    
    
    
    

    点击它之后,就可以使用上面描述的命令。

    用法

    尽管脚本的名称是 brew-rmtree.rb,但是 Homebrew 外部命令可以这样的方式调用它,你可以将它作为。 ( 它与内置在 Homebrew 中的一个子命令完全

    示例

    典型的用例,将删除 mpv

    
    $ brew rmtree mpv
    
    
    ==> Examining installed formulae required by mpv...
    
    
     - 43/43
    
    
    
    Can safely be removed
    
    
    ----------------------
    
    
    automake
    
    
    lua
    
    
    mpg123
    
    
    mpv-player/mpv/libass-ct
    
    
    
    Proceed?[y/N]: y
    
    
    ==> Cleaning up packages safe to remove
    
    
    
    Uninstalling/usr/local/Cellar/mpv/0.9.2... (342 files, 35M)
    
    
    
    Uninstalling/usr/local/Cellar/automake/1.15... (130 files, 3.2M)
    
    
    
    Uninstalling/usr/local/Cellar/libass-ct/HEAD... (9 files, 440K)
    
    
    
    Uninstalling/usr/local/Cellar/lua/5.2.4... (81 files, 1.1M)
    
    
    
    Uninstalling/usr/local/Cellar/mpg123/1.22.2... (16 files, 656K)
    
    
    
    

    试图移除其他事物所需要的东西

    
    $ brew rmtree python
    
    
    python can't be removed because other formula depend on it:
    
    
    mpv-player/mpv/mpv, newt, node, postgresql, sip, yasm
    
    
    $ brew rmtree --force python
    
    
    ... (I'm not going to run this but it would remove python)
    
    
    
    

    想看看会发生什么而不做任何改变?

    
    $ brew rmtree --dry-run mpv
    
    
    This is a dry-run, nothing will be deleted
    
    
    Examining installed formulae required by mpv...43/43 ������������
    
    
    
    Can safely be removed
    
    
    ----------------------
    
    
    automake
    
    
    lua
    
    
    mpg123
    
    
    mpv-player/mpv/libass-ct
    
    
    
    Won't be removed
    
    
    -----------------
    
    
    autoconf is used by pyenv, homebrew/dupes/rsync
    
    
    cairo is used by pango
    
    
    cmake is used by eigen, mysql, homebrew/science/opencv, zbackup
    
    
    faac is used by ffmpeg
    
    
    ffmpeg is used by homebrew/science/opencv
    
    
    fontconfig is used by imagemagick, pango
    
    
    freetype is used by graphviz, imagemagick
    
    
    fribidi is used by libass
    
    
    gettext is used by newt
    
    
    git is used by homebrew/headonly/arcanist, caskroom/cask/brew-cask, beeftornado/rmtree/brew-rmtree, go, gobject-introspection, mongodb, x264
    
    
    glib is used by atk, gdk-pixbuf, pango
    
    
    gobject-introspection is used by atk, gdk-pixbuf, gtk+, pango
    
    
    harfbuzz is used by pango
    
    
    icu4c is used by node, sqlite
    
    
    jpeg is used by gdk-pixbuf, imagemagick, jasper, homebrew/science/opencv, wxmac
    
    
    lame is used by ffmpeg
    
    
    libass is used by ffmpeg
    
    
    libffi is used by glib
    
    
    libgpg-error is used by libksba
    
    
    libogg is used by libvorbis
    
    
    libpng is used by gdk-pixbuf, graphviz, imagemagick, homebrew/science/opencv, pngquant, s-lang, wxmac
    
    
    libtiff is used by gdk-pixbuf, imagemagick, homebrew/science/opencv, wxmac
    
    
    libtool is used by imagemagick
    
    
    libvo-aacenc is used by ffmpeg
    
    
    libvorbis is used by ffmpeg
    
    
    libvpx is used by ffmpeg
    
    
    little-cms2 is used by imagemagick
    
    
    openssl is used by freetds, libevent, mongodb, mysql, node, postgresql, wget, zbackup
    
    
    pixman is used by cairo
    
    
    pkg-config is used by atk, cloog, homebrew/versions/cloog018, freetds, gdk-pixbuf, graphviz, gtk+, imagemagick, libevent, node, homebrew/science/opencv, openexr, pango, pngquant, pyenv, tmux
    
    
    python is used by newt, node, postgresql, sip, yasm
    
    
    texi2html is used by ffmpeg
    
    
    webp is used by imagemagick
    
    
    x264 is used by ffmpeg
    
    
    x265 is used by ffmpeg
    
    
    xvid is used by ffmpeg
    
    
    xz is used by atk, coreutils, gdk-pixbuf, gtk+, hicolor-icon-theme, imagemagick, isl, mpfr, nasm, pango, watch, wget, zbackup
    
    
    yasm is used by ffmpeg
    
    
    
    

    命令行选项

    选项说明
    --force重写要删除的顶级公式的依赖项检查。 如果试图删除'ruby'例如,你很可以能无法做到这一点,因为它的他fomulae将它的指定为依赖项。 这里选项将允许你删除'ruby'。 这不会忽略公式子级的依赖项检查。 如果'ruby'依赖'git',那么'git'仍然不会被删除。
    --ignore忽略删除的某些依赖项。 这里选项必须出现在要移除的公式之后。
    --dry-run进行干净的操作。完成整个过程而不实际删除任何内容。 这给了你一个机会,可以观察到什么包将被删除和一个机会,忽略它们当你实际。
    --quiet无输出

    for  form  DEP  依赖  
    相关文章