Annotation of pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8, revision 1.16

1.16    ! tnn         1: .\" $NetBSD: pkg_rolling-replace.8,v 1.15 2009/11/13 19:40:55 sno Exp $
        !             2: .Dd November 13, 2009
1.1       gdt         3: .Dt PKG_ROLLING-REPLACE 8
1.2       wiz         4: .Os
1.1       gdt         5: .Sh NAME
                      6: .Nm pkg_rolling-replace
                      7: .Nd rebuild or update packages using 'make replace' in tsorted order
                      8: .Sh SYNOPSIS
                      9: .Nm
1.15      sno        10: .Op Fl hFknrsuv
                     11: .Op Fl L Ar path
1.14      wiz        12: .Op Fl X Ar pkgs
1.1       gdt        13: .Op Fl x Ar pkgs
                     14: .Sh DESCRIPTION
                     15: .Nm
1.2       wiz        16: runs
                     17: .Dq make replace
1.7       tnn        18: on packages that have been marked to have unsafe dependencies or have
                     19: been marked to be rebuilt.
                     20: Optionally it can replace any outdated packages (as reported by
1.1       gdt        21: .Xr pkg_chk 8 )
                     22: as well.
                     23: .Pp
1.2       wiz        24: Whenever
                     25: .Dq make replace
                     26: is run on a package, all installed packages
                     27: that depend on it are marked with the
1.7       tnn        28: .Dq unsafe_depends_strict=YES
1.8       wiz        29: flag.
                     30: If the version of the replaced package has changed, this indicates
1.7       tnn        31: that it may no longer be ABI-compatible so
1.2       wiz        32: .Dq unsafe_depends=YES
1.7       tnn        33: is also set for all packages that depend on it.
1.2       wiz        34: Running
1.1       gdt        35: .Nm
                     36: with no arguments will restore such packages to a safe state by
                     37: building a dependency graph, running
                     38: .Xr tsort 1
1.2       wiz        39: on it, and running
                     40: .Dq make replace
                     41: in the resulting topological order.
1.1       gdt        42: The dependency graph and topological sort are re-calculated after each
1.2       wiz        43: .Dq make replace ,
                     44: in case it causes additional packages to be marked unsafe.
1.1       gdt        45: .Pp
                     46: The user can mark additional packages to be rebuilt by setting the
1.2       wiz        47: .Dq rebuild=YES
                     48: flag on them using the command
                     49: .Dl % pkg_admin set rebuild=YES Aq pkg
1.1       gdt        50: .Pp
                     51: If the
                     52: .Fl u
                     53: option is given,
                     54: .Nm
                     55: will use
1.12      tnn        56: .Xr pkg_chk 8
1.1       gdt        57: to check for packages for which the version in pkgsrc is different
1.2       wiz        58: than the installed version, and run
                     59: .Dq make replace
                     60: on those packages as well (tsorting them along with the unsafe/rebuild
                     61: packages).
1.1       gdt        62: (Usually this results in packages being upgraded to newer versions,
                     63: assuming the pkgsrc tree is more recent than the currently installed
                     64: packages.)
                     65: .Ss Options
                     66: .Bl -tag -width xxxxxxxx
                     67: .It Fl h
                     68: Brief help.
1.15      sno        69: .It Fl F
                     70: Just fetches the sources of all mismatched packages required to be updated
                     71: (and it's dependencies).
                     72: .It Fl k
                     73: Keep on going, even on error during handling current package.
                     74: Warning: This could (potential will) rebuild package depending
                     75: on the failed package, anyway. This may cause a broken tree.
                     76: Use with caution!
1.1       gdt        77: .It Fl n
1.2       wiz        78: Display actions that would be taken, but don't actually run
                     79: .Dq make replace
                     80: or change any flags on installed packages.
                     81: This option attempts to calculate the new packages that would be
                     82: marked unsafe after each
                     83: .Dq make replace .
1.7       tnn        84: .It Fl r
                     85: Just replace packages, do not build binary packages.
                     86: .It Fl s
1.8       wiz        87: Enable strict mode.
                     88: This makes
1.7       tnn        89: .Nm
1.8       wiz        90: look at
1.7       tnn        91: .Dq unsafe_depends_strict
                     92: tags instead of
                     93: .Dq unsafe_depends
1.8       wiz        94: tags.
                     95: This will replace packages more aggressively and can be used to solve
1.7       tnn        96: shared library problems.
1.1       gdt        97: .It Fl u
                     98: Use
                     99: .Xl pkg_chk 8
                    100: to check for outdated packages, and replace those too.
                    101: .It Fl v
                    102: Verbose output.
1.15      sno       103: .It Fl L Ar path
                    104: Logs each build (each command output from the commands which are run for
                    105: packages) to given path. The full log file name is composed from the path
                    106: given by this argument, the category name of the package and the package
                    107: name:
                    108: .Dq given-path/category/pkgname .
                    109: The specified path must exists and being user writable of the invoking
                    110: user or any parent directory must be writable by the invoking user.
                    111: Potentially existing log in the same file name will be overwritten.
1.14      wiz       112: .It Fl X Ar pkgs
                    113: Exclude the comma-separated list of package base names
                    114: from being rebuilt for any reason.
1.1       gdt       115: .It Fl x Ar pkgs
1.9       apb       116: Exclude the comma-separated list of package base names
                    117: from the check for outdated packages.
                    118: This has no effect if the
1.1       gdt       119: .Fl u
1.9       apb       120: flag is not given,
                    121: and does not prevent packages from being rebuilt for any other reason
                    122: (such as being a dependency of another package that is also rebuilt,
                    123: or having any of the
1.14      wiz       124: .Xr pkg_admin 1
1.9       apb       125: .Dq unsafe_depends ,
                    126: .Dq unsafe_depends_strict ,
                    127: or
                    128: .Dq rebuild
                    129: variables set to
                    130: .Dq YES ) .
1.1       gdt       131: .El
                    132: .Sh ENVIRONMENT
                    133: .Nm
                    134: uses the following environment variables.
                    135: .Bl -tag -width xxxx
1.3       tnn       136: .It Ev MAKECONF
                    137: Path to
                    138: .Pa mk.conf .
                    139: Defaults to
1.11      apb       140: .Pa @MAKECONF@ , @PREFIX@/etc/mk.conf ,
1.5       tnn       141: or
1.11      apb       142: .Pa /etc/mk.conf .
1.1       gdt       143: .It Ev PKGSRCDIR
1.2       wiz       144: Base of pkgsrc tree.
1.11      apb       145: If not set in the environment, then this variable is read from
                    146: .Pa ${MAKECONF} .
                    147: If it is still not set, and if the current working directory
                    148: appears to be inside a pkgsrc tree, then this variable
                    149: is set to the base of that pkgsrc tree.
                    150: Finally, if
1.3       tnn       151: .Pa /usr/pkgsrc
1.11      apb       152: appears to contain a pkgsrc tree, then that is used as a last resort.
1.1       gdt       153: .It Ev PKG_DBDIR
                    154: pkgsrc database directory.
                    155: If not set in environment then defaults to
1.2       wiz       156: .Pa /var/db/pkg .
1.1       gdt       157: .El
1.14      wiz       158: .Sh EXAMPLES
                    159: To update all packages on the system and ensure correct shared library
                    160: dependencies:
                    161: .Bd -literal -offset indent
                    162: pkg_rolling-replace -rsuv
                    163: .Ed
                    164: .Pp
                    165: To update all packages on the system, do as little rebuilding as possible,
                    166: and also produce binary packages:
                    167: .Bd -literal -offset indent
                    168: pkg_rolling-replace -uv
                    169: .Ed
                    170: .Pp
1.15      sno       171: To fetch all distfiles for the packages requiring an update on the system
                    172: (packages with different version numbers than installed), and exit after it:
                    173: .Bd -literal -offset indent
                    174: pkg_rolling-replace -F
                    175: .Ed
                    176: .Pp
1.14      wiz       177: To update gtk2+ and all packages that depend on it, except openoffice2:
                    178: .Bd -literal -offset indent
                    179: pkg_admin set rebuild=YES gtk2+
                    180: pkg_rolling-replace -rsv -X openoffice2
                    181: .Ed
                    182: .Pp
1.15      sno       183: To force rebuild of gtk2+ and all packages that depend on it, keep
                    184: going on even if one package fails, except openoffice2 - log to
                    185: .Dq /var/log/pkg_rr :
                    186: .Bd -literal -offset indent
                    187: pkg_admin set rebuild=YES gtk2+
                    188: pkg_rolling-replace -krsv -L /var/log/pkg_rr -X openoffice2
                    189: .Ed
                    190: .Pp
1.14      wiz       191: To mark all packages that compiled against X11 as needing rebuild
                    192: (used after switching to X11_TYPE=modular):
                    193: .Bd -literal -offset indent
                    194: cd /var/db/pkg \*[Am]\*[Am] grep "blddep x11-links" */* | cut -d/ -f1 | \\
                    195: sort -u | xargs pkg_admin set rebuild=YES
                    196: .Ed
1.1       gdt       197: .Sh AUTHORS
1.2       wiz       198: .An -nosplit
1.1       gdt       199: .An Nick Goffee
                    200: .Aq ngoffee@bbn.com ,
                    201: with initial idea and many suggestions from
                    202: .An Greg Troxel
                    203: .Aq gdt@ir.bbn.com .
1.8       wiz       204: The options
                    205: .Fl s
                    206: and
                    207: .Fl r
                    208: were added by
1.7       tnn       209: .An Tobias Nygren
                    210: .Aq tnn@NetBSD.org .
1.15      sno       211: The options
                    212: .Fl k ,
                    213: .Fl F
                    214: and
                    215: .Fl L
                    216: were added by
                    217: .An Jens Rehsack
                    218: .Aq sno@NetBSD.org .
1.1       gdt       219: .Sh BUGS
                    220: .Nm
                    221: does not run fully automatically when any significant number of
                    222: packages need to be replaced.
1.15      sno       223: .Pp
                    224: .Nm
                    225: does not run fully automatically when the PKGNAME of a package
                    226: changes.

CVSweb <webmaster@jp.NetBSD.org>