Annotation of pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8, revision 1.14
1.14 ! wiz 1: .\" $NetBSD: pkg_rolling-replace.8,v 1.13 2008/06/08 17:29:01 gdt Exp $
1.12 tnn 2: .Dd May 22, 2008
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.7 tnn 10: .Op Fl hnrsuv
1.14 ! wiz 11: .Op Fl X Ar pkgs
1.1 gdt 12: .Op Fl x Ar pkgs
13: .Sh DESCRIPTION
14: .Nm
1.2 wiz 15: runs
16: .Dq make replace
1.7 tnn 17: on packages that have been marked to have unsafe dependencies or have
18: been marked to be rebuilt.
19: Optionally it can replace any outdated packages (as reported by
1.1 gdt 20: .Xr pkg_chk 8 )
21: as well.
22: .Pp
1.2 wiz 23: Whenever
24: .Dq make replace
25: is run on a package, all installed packages
26: that depend on it are marked with the
1.7 tnn 27: .Dq unsafe_depends_strict=YES
1.8 wiz 28: flag.
29: If the version of the replaced package has changed, this indicates
1.7 tnn 30: that it may no longer be ABI-compatible so
1.2 wiz 31: .Dq unsafe_depends=YES
1.7 tnn 32: is also set for all packages that depend on it.
1.2 wiz 33: Running
1.1 gdt 34: .Nm
35: with no arguments will restore such packages to a safe state by
36: building a dependency graph, running
37: .Xr tsort 1
1.2 wiz 38: on it, and running
39: .Dq make replace
40: in the resulting topological order.
1.1 gdt 41: The dependency graph and topological sort are re-calculated after each
1.2 wiz 42: .Dq make replace ,
43: in case it causes additional packages to be marked unsafe.
1.1 gdt 44: .Pp
45: The user can mark additional packages to be rebuilt by setting the
1.2 wiz 46: .Dq rebuild=YES
47: flag on them using the command
48: .Dl % pkg_admin set rebuild=YES Aq pkg
1.1 gdt 49: .Pp
50: If the
51: .Fl u
52: option is given,
53: .Nm
54: will use
1.12 tnn 55: .Xr pkg_chk 8
1.1 gdt 56: to check for packages for which the version in pkgsrc is different
1.2 wiz 57: than the installed version, and run
58: .Dq make replace
59: on those packages as well (tsorting them along with the unsafe/rebuild
60: packages).
1.1 gdt 61: (Usually this results in packages being upgraded to newer versions,
62: assuming the pkgsrc tree is more recent than the currently installed
63: packages.)
64: .Ss Options
65: .Bl -tag -width xxxxxxxx
66: .It Fl h
67: Brief help.
68: .It Fl n
1.2 wiz 69: Display actions that would be taken, but don't actually run
70: .Dq make replace
71: or change any flags on installed packages.
72: This option attempts to calculate the new packages that would be
73: marked unsafe after each
74: .Dq make replace .
1.7 tnn 75: .It Fl r
76: Just replace packages, do not build binary packages.
77: .It Fl s
1.8 wiz 78: Enable strict mode.
79: This makes
1.7 tnn 80: .Nm
1.8 wiz 81: look at
1.7 tnn 82: .Dq unsafe_depends_strict
83: tags instead of
84: .Dq unsafe_depends
1.8 wiz 85: tags.
86: This will replace packages more aggressively and can be used to solve
1.7 tnn 87: shared library problems.
1.1 gdt 88: .It Fl u
89: Use
90: .Xl pkg_chk 8
91: to check for outdated packages, and replace those too.
92: .It Fl v
93: Verbose output.
1.14 ! wiz 94: .It Fl X Ar pkgs
! 95: Exclude the comma-separated list of package base names
! 96: from being rebuilt for any reason.
1.1 gdt 97: .It Fl x Ar pkgs
1.9 apb 98: Exclude the comma-separated list of package base names
99: from the check for outdated packages.
100: This has no effect if the
1.1 gdt 101: .Fl u
1.9 apb 102: flag is not given,
103: and does not prevent packages from being rebuilt for any other reason
104: (such as being a dependency of another package that is also rebuilt,
105: or having any of the
1.14 ! wiz 106: .Xr pkg_admin 1
1.9 apb 107: .Dq unsafe_depends ,
108: .Dq unsafe_depends_strict ,
109: or
110: .Dq rebuild
111: variables set to
112: .Dq YES ) .
1.1 gdt 113: .El
114: .Sh ENVIRONMENT
115: .Nm
116: uses the following environment variables.
117: .Bl -tag -width xxxx
1.3 tnn 118: .It Ev MAKECONF
119: Path to
120: .Pa mk.conf .
121: Defaults to
1.11 apb 122: .Pa @MAKECONF@ , @PREFIX@/etc/mk.conf ,
1.5 tnn 123: or
1.11 apb 124: .Pa /etc/mk.conf .
1.1 gdt 125: .It Ev PKGSRCDIR
1.2 wiz 126: Base of pkgsrc tree.
1.11 apb 127: If not set in the environment, then this variable is read from
128: .Pa ${MAKECONF} .
129: If it is still not set, and if the current working directory
130: appears to be inside a pkgsrc tree, then this variable
131: is set to the base of that pkgsrc tree.
132: Finally, if
1.3 tnn 133: .Pa /usr/pkgsrc
1.11 apb 134: appears to contain a pkgsrc tree, then that is used as a last resort.
1.1 gdt 135: .It Ev PKG_DBDIR
136: pkgsrc database directory.
137: If not set in environment then defaults to
1.2 wiz 138: .Pa /var/db/pkg .
1.1 gdt 139: .El
1.14 ! wiz 140: .Sh EXAMPLES
! 141: To update all packages on the system and ensure correct shared library
! 142: dependencies:
! 143: .Bd -literal -offset indent
! 144: pkg_rolling-replace -rsuv
! 145: .Ed
! 146: .Pp
! 147: To update all packages on the system, do as little rebuilding as possible,
! 148: and also produce binary packages:
! 149: .Bd -literal -offset indent
! 150: pkg_rolling-replace -uv
! 151: .Ed
! 152: .Pp
! 153: To update gtk2+ and all packages that depend on it, except openoffice2:
! 154: .Bd -literal -offset indent
! 155: pkg_admin set rebuild=YES gtk2+
! 156: pkg_rolling-replace -rsv -X openoffice2
! 157: .Ed
! 158: .Pp
! 159: To mark all packages that compiled against X11 as needing rebuild
! 160: (used after switching to X11_TYPE=modular):
! 161: .Bd -literal -offset indent
! 162: cd /var/db/pkg \*[Am]\*[Am] grep "blddep x11-links" */* | cut -d/ -f1 | \\
! 163: sort -u | xargs pkg_admin set rebuild=YES
! 164: .Ed
1.1 gdt 165: .Sh AUTHORS
1.2 wiz 166: .An -nosplit
1.1 gdt 167: .An Nick Goffee
168: .Aq ngoffee@bbn.com ,
169: with initial idea and many suggestions from
170: .An Greg Troxel
171: .Aq gdt@ir.bbn.com .
1.8 wiz 172: The options
173: .Fl s
174: and
175: .Fl r
176: were added by
1.7 tnn 177: .An Tobias Nygren
178: .Aq tnn@NetBSD.org .
1.1 gdt 179: .Sh BUGS
180: .Nm
181: does not run fully automatically when any significant number of
182: packages need to be replaced.
CVSweb <webmaster@jp.NetBSD.org>