nih
Материал из Xgu.ru
nih (от англ. Not Invented Here — изобретено не здесь) — высокоуровневый интерфейс управления пакетами (такой как apt, yum и тому подобное).
В качестве низкоуровневой системы управления пакетами nih использует pkgsrc.
Написан на shell.
Находится в состоянии активной разработки. Функции nih clean и nih audit не реализованы.
Главный плюс по сравнению с Apt это волшебный поиск [1].
| Содержание | 
[править] Инсталляция пакета
# nih install vim
Getting installed packages...
Generating the update plan...
    R:1 U:1 A:0
    R:2 U:1 A:1
    R:2 U:1 A:1
---------------------- UPDATE PLAN -------------------------
The following packages will be removed
The following packages will be installed
    editors/vim (vim-7.2.442)
         Vim editor (vi clone) without GUI
The following packages will be installed as auto-removable
    editors/vim-share (vim-share-7.2.442)
         Data files for the vim editor (vi clone)
Proceed (y/N)? y
Downloading package vim-7.2.442...
Downloading package vim-share-7.2.442...
Installing package vim-share-7.2.442 as a dependency...
pkg_add: Warning: package `vim-share-7.2.442' was built for a platform:
pkg_add: NetBSD/x86_64 5.0.2 (pkg) vs. NetBSD/x86_64 5.1 (this host)
Installing package vim-7.2.442...
pkg_add: Warning: package `vim-7.2.442' was built for a platform:
pkg_add: NetBSD/x86_64 5.0.2 (pkg) vs. NetBSD/x86_64 5.1 (this host)
Updating pkgdb...
Done.
sandbox-5-3
# nih install editors/emacs20 
Getting installed packages...
Generating the update plan...
    R:1 U:1 A:0
    R:1 U:1 A:0
c: conflict emacs-[0-9]* editors/emacs20 emacs-20.7nb14 <- editors/emacs22 emacs-22.3nb11
u: unicity emacs <- editors/emacs22 editors/emacs20
# nih install editors/emacs20 -emacs
Getting installed packages...
Generating the update plan...
    R:2 U:1 A:0
    R:2 U:1 A:0
---------------------- UPDATE PLAN -------------------------
The following packages will be removed
    graphics/jpeg (jpeg-8b)
         IJG's jpeg compression utilities
    graphics/libungif (libungif-4.1.4nb1)
         Tools and library routines for working with GIF images
    graphics/png (png-1.4.5)
         Library for manipulating PNG images
    graphics/tiff (tiff-3.9.4nb1)
         Library and tools for reading and writing TIFF data files
    x11/libICE (libICE-1.0.6)
         Inter Client Exchange (ICE) library for X
    x11/libSM (libSM-1.1.1nb1)
         X Session Management Library
    x11/libX11 (libX11-1.3.5)
         Base X libraries from modular Xorg X11
    x11/libXau (libXau-1.0.6)
         Authorization Protocol for X from X.org
    x11/libXaw (libXaw-1.0.7)
         X Athena Widgets Library from modular Xorg X11
    x11/libXdmcp (libXdmcp-1.0.3)
         X Display Manager Control Protocol library from X.org
    x11/libXext (libXext-1.1.1)
         X Extension library
    x11/libXmu (libXmu-1.0.5)
         X Miscellaneous Utilities library
    x11/libXpm (libXpm-3.5.8)
         X PixMap Library from modular Xorg X11
    x11/libXt (libXt-1.0.8)
         X Toolkit Intrinsics library
    x11/libxcb (libxcb-1.7)
         X protocol C-language Binding
    //
    editors/emacs22 (emacs-22.3nb11)
         GNU editing macros (editor)
The following packages will be installed
    editors/emacs20 (emacs-20.7nb14)
         GNU editing macros (editor)
The following packages will be installed as auto-removable
Proceed (y/N)? y
Removing package emacs-22.3nb11...
emacs-22.3nb11: unregistering info file /usr/pkg/info/ada-mode
emacs-22.3nb11: unregistering info file /usr/pkg/info/autotype
emacs-22.3nb11: unregistering info file /usr/pkg/info/calc
emacs-22.3nb11: unregistering info file /usr/pkg/info/ccmode
emacs-22.3nb11: unregistering info file /usr/pkg/info/cl
emacs-22.3nb11: unregistering info file /usr/pkg/info/dired-x
emacs-22.3nb11: unregistering info file /usr/pkg/info/ebrowse
emacs-22.3nb11: unregistering info file /usr/pkg/info/ediff
emacs-22.3nb11: unregistering info file /usr/pkg/info/efaq
emacs-22.3nb11: unregistering info file /usr/pkg/info/eintr
...
emacs-22.3nb11: unregistering info file /usr/pkg/info/viper
emacs-22.3nb11: unregistering info file /usr/pkg/info/widget
emacs-22.3nb11: unregistering info file /usr/pkg/info/woman
Removing package libXaw-1.0.7...
Removing package libXpm-3.5.8...
Removing package libXmu-1.0.5...
Removing package libXt-1.0.8...
Removing package libXext-1.1.1...
Removing package libX11-1.3.5...
Removing package libungif-4.1.4nb1...
Removing package libxcb-1.7...
Removing package tiff-3.9.4nb1...
Removing package png-1.4.5...
Removing package libXau-1.0.6...
Removing package libXdmcp-1.0.3...
Removing package jpeg-8b...
Removing package libSM-1.1.1nb1...
Removing package libICE-1.0.6...
Installing package emacs-20.7nb14...
pkg_add: Warning: package `emacs-20.7nb14' was built for a platform:
pkg_add: NetBSD/x86_64 5.0_STABLE (pkg) vs. NetBSD/x86_64 5.1 (this host)
emacs-20.7nb14: registering info file /usr/pkg/info/ccmode
emacs-20.7nb14: registering info file /usr/pkg/info/cl
emacs-20.7nb14: registering info file /usr/pkg/info/dired-x
...
Updating pkgdb...
Done.
[править] Удаление пакета
# nih remove vim
The following packages will be removed:
    vim-7.2.442         Vim editor (vi clone) without GUI
The following dependent packages will be removed:
Remove them (y/N)? y
The following packages were installed as auto-removed
and are no longer needed:
    vim-share-7.2.442    Data files for the vim editor (vi clone)
Remove them (y/N)? y
Recursively (y/N)? y
[править] Просмотр состояния
# nih status
Format of the output:
SIGN PKGPATH PKGBASE VERSION1 [VERSION2]
     SIGN:      newer version is available
            >   only older version is available
            =   the same version is available
            -   package disappeared or was renamed
            +   package has been renamed (also see '-' sign)
          [0-9] package is registered at least twice (problem?)
     VERSION1: version of installed package,
     VERSION2: (if any) - version of available package
**********************************************************************
  > www/ikiwiki                    ikiwiki         3.20101201   3.20100926  
  > pkgtools/pkg_install           pkg_install     20101212     20100915    
  - wip/pkg_status                 pkg_status      0.13                     
  - wip/pkg_summary-utils          pkg_summary-utils 0.50beta6                
  > net/youtube-dl                 youtube-dl      20101209     20100804    
sandbox-5-3 /
# nih status -aq > devel/glib2 glib2 2.26.1nb1 2.24.2 >U www/ikiwiki ikiwiki 3.20101201 3.20100926 > time/p5-DateTime p5-DateTime 0.6600 0.6200 > converters/p5-MIME-Base64 p5-MIME-Base64 3.13 3.09nb1 > www/p5-URI p5-URI 1.56 1.55 > devel/p5-gettext p5-gettext 1.05nb5 1.05nb4 > devel/pcre pcre 8.11 8.10 >U pkgtools/pkg_install pkg_install 20101212 20100915 -U wip/pkg_status pkg_status 0.13 -U wip/pkg_summary-utils pkg_summary-utils 0.50beta6 - wip/runawk runawk 1.2.0 > databases/shared-mime-info shared-mime-info 0.90 0.71 > databases/sqlite3 sqlite3 3.7.4 3.7.2 >U net/youtube-dl youtube-dl 20101209 20100804
[править] Поиск пакета
# nih search dns server net/dhisd - DynDNS server net/fpdns - Fingerprinting DNS servers net/maradns - Secure DNS server for *NIX systems net/mydns-mysql - MySQL-based DNS server net/mydns-pgsql - PostgreSQL-based DNS server net/nsd - Authoritative-only DNS server net/powerdns-recursor(pdns-recursor) - PowerDNS resolver/recursing nameserver net/powerdns - Modern, advanced and high performance nameserver net/rootprobe - Root DNS server performance analysis net/unbound - DNS resolver and recursive server sysutils/wbm-bind8 - Webmin module for managing ISC BIND 8.x DNS servers
Другой пример:
# nih search dictionary -chinese -japanese -korean -spell inputmethod/dbskkd-cdb - SKK dictionary server based on cdb textproc/dict-client - Dictionary Service Protocol client textproc/dict-dictionaries(dict-data) - Dictionary data for DICTD textproc/dict-server - Dictionary Service Protocol server textproc/dictem - Dictionary client (RFC-2229) for [X]Emacs textproc/ebview - GTK2 based EPWING dictionary browser textproc/emacs-dict-client - Emacs package for talking to a dictionary server audio/festlex-cmu - CMU American English pronunciation dictionary for Festival audio/festlex-oald - Oxford Advanced Learner's pronunciation dictionary for Festival audio/festlex-ogi - Composite pronunciation dictionary from ogi.edu for festival inputmethod/kasumi - Dictionary management tool for anthy misc/lookup - Electric dictionary agent for Emacs inputmethod/multiskkserv - Simple skk multi-dictionary server inputmethod/skk-jisyo - Dictionary collection for SKK inputmethod/skk-jisyo-cdb - Dictionary collection for SKK inputmethod/skkserv - Dictionary server for Simple Kana-Kanji conversion programs inputmethod/skktools - SKK dictionary manipulation tools textproc/xfce4-dict-plugin - Xfce dictionary server plugin
 
