1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
.\" $NetBSD: pkg_rolling-replace.8,v 1.6 2007/08/07 20:46:43 wiz Exp $
.Dd May 11, 2007
.Dt PKG_ROLLING-REPLACE 8
.Os
.Sh NAME
.Nm pkg_rolling-replace
.Nd rebuild or update packages using 'make replace' in tsorted order
.Sh SYNOPSIS
.Nm
.Op Fl hnuv
.Op Fl x Ar pkgs
.Sh DESCRIPTION
.Nm
runs
.Dq make replace
on packages that have been marked with the
.Dq unsafe_depends=YES
flag or the
.Dq rebuild=YES
flag, optionally replacing any outdated packages (as reported by
.Xr pkg_chk 8 )
as well.
.Pp
Whenever
.Dq make replace
is run on a package, all installed packages
that depend on it are marked with the
.Dq unsafe_depends=YES
flag, which indicates that they may no longer be ABI-compatible
with the replaced package.
Running
.Nm
with no arguments will restore such packages to a safe state by
building a dependency graph, running
.Xr tsort 1
on it, and running
.Dq make replace
in the resulting topological order.
The dependency graph and topological sort are re-calculated after each
.Dq make replace ,
in case it causes additional packages to be marked unsafe.
.Pp
The user can mark additional packages to be rebuilt by setting the
.Dq rebuild=YES
flag on them using the command
.Dl % pkg_admin set rebuild=YES Aq pkg
.Pp
If the
.Fl u
option is given,
.Nm
will use
.Xl pkg_chk 8
to check for packages for which the version in pkgsrc is different
than the installed version, and run
.Dq make replace
on those packages as well (tsorting them along with the unsafe/rebuild
packages).
(Usually this results in packages being upgraded to newer versions,
assuming the pkgsrc tree is more recent than the currently installed
packages.)
.Ss Options
.Bl -tag -width xxxxxxxx
.It Fl h
Brief help.
.It Fl n
Display actions that would be taken, but don't actually run
.Dq make replace
or change any flags on installed packages.
This option attempts to calculate the new packages that would be
marked unsafe after each
.Dq make replace .
.It Fl u
Use
.Xl pkg_chk 8
to check for outdated packages, and replace those too.
.It Fl v
Verbose output.
.It Fl x Ar pkgs
Exclude the comma-separated list of packages from the update check
when
.Fl u
is given (does not exclude unsafe or rebuild-requested packages).
.El
.Sh ENVIRONMENT
.Nm
uses the following environment variables.
.Bl -tag -width xxxx
.It Ev MAKECONF
Path to
.Pa mk.conf .
Defaults to
.Pa /etc/mk.conf
or
.Pa ${PREFIX}/etc/mk.conf
(if using bmake).
.It Ev PKGSRCDIR
Base of pkgsrc tree.
Defaults to value configured in MAKECONF or
.Pa /usr/pkgsrc
if unset.
.It Ev PKG_DBDIR
pkgsrc database directory.
If not set in environment then defaults to
.Pa /var/db/pkg .
.El
.Sh AUTHORS
.An -nosplit
.An Nick Goffee
.Aq ngoffee@bbn.com ,
with initial idea and many suggestions from
.An Greg Troxel
.Aq gdt@ir.bbn.com .
.Sh BUGS
.Nm
does not run fully automatically when any significant number of
packages need to be replaced.
|