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