[BACK]Return to pkg_delete.cat1 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / delete

File: [cvs.NetBSD.org] / pkgsrc / pkgtools / pkg_install / files / delete / Attic / pkg_delete.cat1 (download)

Revision 1.24, Sun Aug 16 21:10:15 2009 UTC (10 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3
Changes since 1.23: +5 -2 lines

Add a new command for pkg_admin: findbest. It takes one or more patterns
and searches for the best match in PKG_PATH, just like pkg_add would.
It prints the URLs of the best match for each pattern to stdout.

Rewrite the config file parser to read the file only once.

PKG_DELETE(1)           NetBSD General Commands Manual           PKG_DELETE(1)

     ppkkgg__ddeelleettee -- a utility for deleting previously installed software pack-
     age distributions

     ppkkgg__ddeelleettee [--AADDFFffkkNNnnOORRrrVVvv] [--KK _p_k_g___d_b_d_i_r] [--PP _d_e_s_t_d_i_r] [--pp _p_r_e_f_i_x]
                _p_k_g_-_n_a_m_e _._._.

     The ppkkgg__ddeelleettee command is used to delete packages that have been previ-
     ously installed with the pkg_add(1) command.  The given packages are
     sorted, so that the dependencies of a package are deleted after the pack-
     age.  Before any action is executed, ppkkgg__ddeelleettee checks for packages that
     are marked as pprreesseerrvveedd or have depending packages left.  If the --kk flag
     is given, preserved packages are removed from the list of packages to
     remove.  Unless the --ff flag is given, ppkkgg__ddeelleettee stops on the first

     _S_i_n_c_e _t_h_e ppkkgg__ddeelleettee _c_o_m_m_a_n_d _m_a_y _e_x_e_c_u_t_e _s_c_r_i_p_t_s _o_r _p_r_o_g_r_a_m_s _p_r_o_v_i_d_e_d _b_y
     _a _p_a_c_k_a_g_e _f_i_l_e_, _y_o_u_r _s_y_s_t_e_m _m_a_y _b_e _s_u_s_c_e_p_t_i_b_l_e _t_o _`_`_T_r_o_j_a_n _h_o_r_s_e_s_'_' _o_r
     _o_t_h_e_r _s_u_b_t_l_e _a_t_t_a_c_k_s _f_r_o_m _m_i_s_c_r_e_a_n_t_s _w_h_o _c_r_e_a_t_e _d_a_n_g_e_r_o_u_s _p_a_c_k_a_g_e _f_i_l_e_s_.

     _Y_o_u _a_r_e _a_d_v_i_s_e_d _t_o _v_e_r_i_f_y _t_h_e _c_o_m_p_e_t_e_n_c_e _a_n_d _i_d_e_n_t_i_t_y _o_f _t_h_o_s_e _w_h_o _p_r_o_-
     _v_i_d_e _i_n_s_t_a_l_l_a_b_l_e _p_a_c_k_a_g_e _f_i_l_e_s_.  _F_o_r _e_x_t_r_a _p_r_o_t_e_c_t_i_o_n_, _e_x_a_m_i_n_e _a_l_l _t_h_e
     _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s _i_n _t_h_e _p_a_c_k_a_g_e _r_e_c_o_r_d _d_i_r_e_c_t_o_r_y
     _(_/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>_/_)_.  _P_a_y _p_a_r_t_i_c_u_l_a_r _a_t_t_e_n_t_i_o_n _t_o _a_n_y _+_I_N_S_T_A_L_L _o_r
     _+_D_E_I_N_S_T_A_L_L _f_i_l_e_s_, _a_n_d _i_n_s_p_e_c_t _t_h_e _+_C_O_N_T_E_N_T_S _f_i_l_e _f_o_r @@ccwwdd_, @@mmooddee _(_c_h_e_c_k
     _f_o_r _s_e_t_u_i_d_)_, @@ddiirrrrmm_, @@eexxeecc_, _a_n_d @@uunneexxeecc _d_i_r_e_c_t_i_v_e_s_, _a_n_d_/_o_r _u_s_e _t_h_e
     pkg_info(_1) _c_o_m_m_a_n_d _t_o _e_x_a_m_i_n_e _t_h_e _i_n_s_t_a_l_l_e_d _p_a_c_k_a_g_e _c_o_n_t_r_o_l _f_i_l_e_s_.

     The following command line options are supported:

     _p_k_g_-_n_a_m_e _._._.
             The named packages are deinstalled, wildcards can be used, see
             pkg_info(1).  If no version is given, the one currently installed
             will be removed.  If the --FF flag is given, one or more (absolute)
             filenames may be specified and the Package Database will be con-
             sulted for the package to which the given file belongs.  These
             packages are then deinstalled.

     --AA      Recursively remove all automatically installed packages that were
             needed by the given packages and are no longer required.  See
             also the --RR flag.

     --DD      If a deinstallation script exists for a given package, do not
             execute it.

     --FF      Any pkg-name given will be interpreted as pathname which is sub-
             sequently transformed in a (real) package name via the Package
             Database.  That way, packages can be deleted by giving a filename
             instead of the package-name.

     --ff      Force removal of the package, even if a dependency is recorded or
             the deinstall script fails.

     --ffff     Force removal of the package, even if the package is marked as a
             pprreesseerrvveedd package.  Note that this is a dangerous operation.  See
             also the --kk option.

     --KK _p_k_g___d_b_d_i_r
             Set _p_k_g___d_b_d_i_r as the package database directory.  If this option
             isn't specified, then the package database directory is taken
             from the value of the environment variable PKG_DBDIR if it's set,
             otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g.

     --kk      Silently skip all packages that are marked as pprreesseerrvveedd.

     --NN      Remove the package's registration and its entries from the pack-
             age database, but leave the files installed.  Don't run any dein-
             stall scripts or @unexec lines either.

     --nn      Don't actually deinstall a package, just report the steps that
             would be taken if it were.

     --OO      Only delete the package's entries from the package database, do
             not touch the package or its files itself.

     --pp _d_e_s_t_d_i_r
             Prefix all file and directory names with _d_e_s_t_d_i_r.  For packages
             without install scripts this has the same behavior as using

     --pp _p_r_e_f_i_x
             Set _p_r_e_f_i_x as the directory in which to delete files from any
             installed packages which do not explicitly set theirs.  For most
             packages, the prefix will be set automatically to the installed
             location by pkg_add(1).

     --RR      Recursively remove all packages that were needed by the given
             packages and that have no other dependencies left.  This option
             overrides the --AA flag.

     --rr      Recursively remove all packages that require one of the packages

     --VV      Print version number and exit.

     --vv      Turn on verbose output.

     ppkkgg__ddeelleettee does pretty much what it says.  It examines installed package
     records in _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>, deletes the package contents, and
     finally removes the package records (if an alternate package database
     directory is specified, then it overrides the _/_v_a_r_/_d_b_/_p_k_g path shown

     If a package is required by other installed packages, ppkkgg__ddeelleettee will
     list those dependent packages and refuse to delete the package (unless
     the --ff option is given).

     If a package has been marked as a pprreesseerrvveedd package, it will not be able
     to be deleted (unless more than one occurrence of the --ff option is

     If a filename is given instead of a package name, the package of which
     the given file belongs to can be deleted if the --FF Flag is given.  The
     filename needs to be absolute, see the output produced by the pkg_info
     --aaFF command.

     If a ddeeiinnssttaallll script exists for the package, it is executed before and
     after any files are removed.  It is this script's responsibility to clean
     up any additional messy details around the package's installation, since
     all ppkkgg__ddeelleettee knows how to do is delete the files created in the origi-
     nal distribution.  The ddeeiinnssttaallll script is called as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _V_I_E_W_-_D_E_I_N_S_T_A_L_L
     before removing the package from a view, and as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _D_E_I_N_S_T_A_L_L
     before deleting all files and as:
           ddeeiinnssttaallll <_p_k_g_-_n_a_m_e> _P_O_S_T_-_D_E_I_N_S_T_A_L_L
     after deleting them.  Passing the keywords _V_I_E_W_-_D_E_I_N_S_T_A_L_L, _D_E_I_N_S_T_A_L_L and
     _P_O_S_T_-_D_E_I_N_S_T_A_L_L lets you potentially write only one program/script that
     handles all aspects of installation and deletion.

     All scripts are called with the environment variable PKG_PREFIX set to
     the installation prefix (see the --pp option above).  This allows a package
     author to write a script that reliably performs some action on the direc-
     tory where the package is installed, even if the user might have changed
     it by specifying the --pp option when running ppkkgg__ddeelleettee or pkg_add(1).
     The scripts are also called with the PKG_METADATA_DIR environment vari-
     able set to the location of the _+_* meta-data files, and with the
     PKG_REFCOUNT_DBDIR environment variable set to the location of the pack-
     age reference counts database directory.  If the --PP flag was given to
     ppkkgg__ddeelleettee, PKG_DESTDIR will be set to _d_e_s_t_d_i_r.

     PKG_DBDIR  If the --KK flag isn't given, then PKG_DBDIR is the location of
                the package database directory.  The default package database
                directory is _/_v_a_r_/_d_b_/_p_k_g.

                Location of the package reference counts database directory.
                The default location is the path to the package database
                directory with ``.refcount'' appended to the path, e.g.

     pkg_add(1), pkg_admin(1), pkg_create(1), pkg_info(1), pkgsrc(7)

     Jordan Hubbard
             most of the work
     John Kohl
             refined it for NetBSD
     Hubert Feyrer
             NetBSD wildcard dependency processing, pkgdb, recursive "down"
             delete, etc.
     Joerg Sonnenberger
             Rewrote most of the code to compute correct order of deinstalla-
             tion and to improve error handling.

NetBSD 5.0                      August 16, 2009                     NetBSD 5.0