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