Deleted Added
full compact
pkg_delete.1 (34809) pkg_delete.1 (41866)
1.\"
2.\" FreeBSD install - a package for the installation and maintainance
3.\" of non-core utilities.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 33 unchanged lines hidden (view full) ---

42command may execute scripts or programs provided by a package file,
43your system may be susceptible to ``trojan horses'' or other subtle
44attacks from miscreants who create dangerous package files.
45.Pp
46You are advised to verify the competence and identity of those who
47provide installable package files. For extra protection, examine all
48the package control files in the package record directory (
49.Pa /var/db/pkg/<pkg-name>/ ).
1.\"
2.\" FreeBSD install - a package for the installation and maintainance
3.\" of non-core utilities.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 33 unchanged lines hidden (view full) ---

42command may execute scripts or programs provided by a package file,
43your system may be susceptible to ``trojan horses'' or other subtle
44attacks from miscreants who create dangerous package files.
45.Pp
46You are advised to verify the competence and identity of those who
47provide installable package files. For extra protection, examine all
48the package control files in the package record directory (
49.Pa /var/db/pkg/<pkg-name>/ ).
50Pay particular
51attention to any +INSTALL, +DEINSTALL, +REQUIRE or +MTREE_DIRS files,
52and inspect the +CONTENTS file for
50Pay particular attention to any +INSTALL, +POST-INSTALL, +DEINSTALL,
51+POST-DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS
52file for
53.Cm @cwd ,
54.Cm @mode
55(check for setuid),
56.Cm @dirrm ,
57.Cm @exec ,
58and
59.Cm @unexec
60directives, and/or use the

--- 31 unchanged lines hidden (view full) ---

92the package.
93.It Fl f
94Force removal of the package, even if a dependency is recorded or the
95deinstall or require script fails.
96.El
97
98.Pp
99.Sh TECHNICAL DETAILS
53.Cm @cwd ,
54.Cm @mode
55(check for setuid),
56.Cm @dirrm ,
57.Cm @exec ,
58and
59.Cm @unexec
60directives, and/or use the

--- 31 unchanged lines hidden (view full) ---

92the package.
93.It Fl f
94Force removal of the package, even if a dependency is recorded or the
95deinstall or require script fails.
96.El
97
98.Pp
99.Sh TECHNICAL DETAILS
100.Nm Pkg_delete
100.Nm pkg_delete
101does pretty much what it says. It examines installed package records in
102.Pa /var/db/pkg/<pkg-name> ,
103deletes the package contents, and finally removes the package records.
104.Pp
105If a package is required by other installed packages,
106.Nm
107will list those dependent packages and refuse to delete the package
108(unless the

--- 26 unchanged lines hidden (view full) ---

135It is this script's responsibility to clean up any additional messy details
136around the package's installation, since all
137.Nm
138knows how to do is delete the files created in the original distribution.
139The
140.Nm deinstall
141script is called as:
142.Bd -filled -offset indent -compact
101does pretty much what it says. It examines installed package records in
102.Pa /var/db/pkg/<pkg-name> ,
103deletes the package contents, and finally removes the package records.
104.Pp
105If a package is required by other installed packages,
106.Nm
107will list those dependent packages and refuse to delete the package
108(unless the

--- 26 unchanged lines hidden (view full) ---

135It is this script's responsibility to clean up any additional messy details
136around the package's installation, since all
137.Nm
138knows how to do is delete the files created in the original distribution.
139The
140.Nm deinstall
141script is called as:
142.Bd -filled -offset indent -compact
143.Cm deinstall
143.Cm script
144.Ar <pkg-name>
145.Ar DEINSTALL
146.Ed
144.Ar <pkg-name>
145.Ar DEINSTALL
146.Ed
147Passing the keyword
147where
148.Ar pkg-name
149is the name of the package in question and
148.Ar DEINSTALL
150.Ar DEINSTALL
149lets you potentially write only one program/script that handles all
150aspects of installation and deletion.
151is a keyword denoting this as the pre-deinstallation phase.
152
153.Cm Note:
154The
155.Ar DEINSTALL
156keyword will not appear if separate scripts for deinstall and post-deinstall
157are given during package creation time (using the
158.Cm Fl k
159and
160.Cm Fl K
161flags to
162.Xr pkg_create 1 ).
151.Pp
163.Pp
164If a
165.Cm post-deinstall
166script exists for the package, it is executed
167.Cm after
168all files are removed. It is this script's responsibility to clean up any
169additional messy details around the package's installation, and leave the
170system (hopefully) in the same state that it was prior to the installation
171of the package.
172
173The
174.Nm post-deinstall
175script is called as:
176.Bd -filled -offset indent -compact
177.Cm script
178.Ar <pkg-name>
179.Ar POST-DEINSTALL
180.Ed
181where
182.Ar pkg-name
183is the name of the package in question and
184.Ar POST-DEINSTALL
185is a keyword denoting this as the post-deinstallation phase.
186
187.Cm Note:
188The
189.Ar POST-DEINSTALL
190keyword will not appear if separate scripts for deinstall and post-deinstall
191are given during package creation time (using the
192.Cm Fl k
193and
194.Cm Fl K
195flags to
196.Xr pkg_create 1 ).
197
198Reasoning behind passing keywords such as
199.Ar DEINSTALL
200and
201.Ar POST-DEINSTALL
202is that it lets you potentially write only one program/script that handles
203all aspects of installation and deletion.
204
205But experience has proved that this is a lot more difficult to maintain and
206is not as advantageous as having separate scripts that handle each aspect of
207installation and deinstallation.
208.Pp
152All scripts are called with the environment variable
153.Ev PKG_PREFIX
154set to the installation prefix (see the
155.Fl p
156option above). This allows a package author to write a script
157that reliably performs some action on the directory where the package
158is installed, even if the user might have changed it by specifying the
159.Fl p

--- 17 unchanged lines hidden ---
209All scripts are called with the environment variable
210.Ev PKG_PREFIX
211set to the installation prefix (see the
212.Fl p
213option above). This allows a package author to write a script
214that reliably performs some action on the directory where the package
215is installed, even if the user might have changed it by specifying the
216.Fl p

--- 17 unchanged lines hidden ---