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

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

CVSweb <webmaster@jp.NetBSD.org>