Sun Mar 5 20:23:59 2023 UTC ()
pkg_rolling-replace: Fix PKG_DBDIR in manpage


(triaxx)
diff -r1.50 -r1.51 pkgsrc/pkgtools/pkg_rolling-replace/Makefile
diff -r1.22 -r1.23 pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8

cvs diff -r1.50 -r1.51 pkgsrc/pkgtools/pkg_rolling-replace/Makefile (switch to unified diff)

--- pkgsrc/pkgtools/pkg_rolling-replace/Makefile 2021/06/28 19:33:23 1.50
+++ pkgsrc/pkgtools/pkg_rolling-replace/Makefile 2023/03/05 20:23:58 1.51
@@ -1,55 +1,55 @@ @@ -1,55 +1,55 @@
1# $NetBSD: Makefile,v 1.50 2021/06/28 19:33:23 mcf Exp $ 1# $NetBSD: Makefile,v 1.51 2023/03/05 20:23:58 triaxx Exp $
2 2
3PKGNAME= pkg_rolling-replace-0.24.13 3PKGNAME= pkg_rolling-replace-0.24.13
4CATEGORIES= pkgtools 4CATEGORIES= pkgtools
5 5
6MAINTAINER= gdt@NetBSD.org 6MAINTAINER= gdt@NetBSD.org
7COMMENT= Replace/upgrade packages in-place 7COMMENT= Replace/upgrade packages in-place
8LICENSE= modified-bsd 8LICENSE= modified-bsd
9 9
10DEPENDS+= pkg_chk>=1.76:../../pkgtools/pkg_chk 10DEPENDS+= pkg_chk>=1.76:../../pkgtools/pkg_chk
11DEPENDS+= pkg_tarup>=1.6.6:../../pkgtools/pkg_tarup 11DEPENDS+= pkg_tarup>=1.6.6:../../pkgtools/pkg_tarup
12 12
13USE_TOOLS+= patch 13USE_TOOLS+= patch
14 14
15WRKSRC= ${WRKDIR} 15WRKSRC= ${WRKDIR}
16NO_BUILD= yes 16NO_BUILD= yes
17USE_LANGUAGES= # none 17USE_LANGUAGES= # none
18 18
19INSTALLATION_DIRS= sbin ${PKGMANDIR}/man8 19INSTALLATION_DIRS= sbin ${PKGMANDIR}/man8
20 20
21PKG_CHK?= ${PREFIX}/sbin/pkg_chk 21PKG_CHK?= ${PREFIX}/sbin/pkg_chk
22 22
23SUBST_CLASSES+= tools 23SUBST_CLASSES+= tools
24SUBST_STAGE.tools= pre-configure 24SUBST_STAGE.tools= pre-configure
25SUBST_MESSAGE.tools= Substituting tool locations. 25SUBST_MESSAGE.tools= Substituting tool locations.
26SUBST_FILES.tools= pkg_rolling-replace.sh 26SUBST_FILES.tools= pkg_rolling-replace.sh
27SUBST_VARS.tools= PREFIX PKG_ADMIN_CMD PKG_INFO_CMD MAKE PKG_CHK AWK MKDIR SETENV 27SUBST_VARS.tools= PREFIX PKG_ADMIN_CMD PKG_INFO_CMD MAKE PKG_CHK AWK MKDIR SETENV
28 28
29SUBST_CLASSES+= prefix 29SUBST_CLASSES+= prefix
30SUBST_STAGE.prefix= pre-configure 30SUBST_STAGE.prefix= pre-configure
31SUBST_MESSAGE.prefix= Substituting PREFIX location. 31SUBST_MESSAGE.prefix= Substituting PREFIX location.
32SUBST_FILES.prefix= pkg_rolling-replace.8 32SUBST_FILES.prefix= pkg_rolling-replace.8
33SUBST_VARS.prefix= PREFIX 33SUBST_VARS.prefix= PKG_DBDIR PREFIX
34 34
35SUBST_CLASSES+= makeconf 35SUBST_CLASSES+= makeconf
36SUBST_STAGE.makeconf= pre-configure 36SUBST_STAGE.makeconf= pre-configure
37SUBST_MESSAGE.makeconf= Recording default path of mk.conf. 37SUBST_MESSAGE.makeconf= Recording default path of mk.conf.
38SUBST_FILES.makeconf= pkg_rolling-replace.sh pkg_rolling-replace.8 38SUBST_FILES.makeconf= pkg_rolling-replace.sh pkg_rolling-replace.8
39SUBST_SED.makeconf= -e 's,@MAKECONF@,${MAKE:T:Mbmake:S/bmake/${PREFIX}/g}/etc/mk.conf,g' 39SUBST_SED.makeconf= -e 's,@MAKECONF@,${MAKE:T:Mbmake:S/bmake/${PREFIX}/g}/etc/mk.conf,g'
40 40
41REPLACE_SH+= pkg_rolling-replace.sh 41REPLACE_SH+= pkg_rolling-replace.sh
42 42
43.include "../../mk/bsd.prefs.mk" 43.include "../../mk/bsd.prefs.mk"
44 44
45do-extract: 45do-extract:
46 cp ${FILESDIR}/pkg_rolling-replace.sh ${WRKSRC} 46 cp ${FILESDIR}/pkg_rolling-replace.sh ${WRKSRC}
47 cp ${FILESDIR}/pkg_rolling-replace.8 ${WRKSRC} 47 cp ${FILESDIR}/pkg_rolling-replace.8 ${WRKSRC}
48 48
49do-install: 49do-install:
50 ${INSTALL_SCRIPT} ${WRKSRC}/pkg_rolling-replace.sh \ 50 ${INSTALL_SCRIPT} ${WRKSRC}/pkg_rolling-replace.sh \
51 ${DESTDIR}${PREFIX}/sbin/pkg_rolling-replace 51 ${DESTDIR}${PREFIX}/sbin/pkg_rolling-replace
52 ${INSTALL_MAN} ${WRKSRC}/pkg_rolling-replace.8 \ 52 ${INSTALL_MAN} ${WRKSRC}/pkg_rolling-replace.8 \
53 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/pkg_rolling-replace.8 53 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/pkg_rolling-replace.8
54 54
55.include "../../mk/bsd.pkg.mk" 55.include "../../mk/bsd.pkg.mk"

cvs diff -r1.22 -r1.23 pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8 (switch to unified diff)

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