-
Notifications
You must be signed in to change notification settings - Fork 16
/
portshaker.d.5.in
252 lines (252 loc) · 5.52 KB
/
portshaker.d.5.in
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
.\" $Id$
.Dd September 30, 2008
.Dt PORTSHAKER.D 5
.Os
.Sh NAME
.Nm portshaker.d/
.Nd format of
.Xr portshaker 8
sources update scripts
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
The
.Nm
directory contains shell scripts used to maintain
.Xr portshaker 8
.Ar target
ports trees. Each script correspond to a
.Ar source
ports tree, and provide the required functions required by
.Xr portshaker 8
to merge to
.Ar target
ports trees.
.Ss Syntax
In order to ease development,
.Xr portshaker 8
provides the
.Ar portshaker.subr
scripts that contains all the logic for managing
.Ar source
ports trees. In order to configure a
.Ar source
ports tree, you have to source that file, specify how the
ports tree has to be fetched (see bellow), and run the
.Ar run_portshaker_command()
function as detailed in the EXAMPLES section.
.Pp
The script is in charge of consuming any argument up to (and including) the first --. These arguments are separated by a column in
.Xr portshaker.conf 5
(e.g.
.Va github:account:project ) .
.Pp
The following variable are available to configure how the
.Ar source
ports tree has to be fetched:
.Bl -tag -width svn_checkout_subtrees
.It Ar method
.Pq Vt str
Update method. Should be one of
.Va csup ,
.Va cvs ,
.Va portsnap ,
.Va git ,
.Va hg
(mercurial),
.Va rsync ,
.Va svn ,
or
.Va svn+subtrees .
.It Ar csup_supfile
.Pq Vt str
supfile to provide to
.Xr csup 1
when
.Dq Ar method Ns Li = Ns Vt csup .
.It Ar cvs_root
.Pq Vt str
CVSROOT string to use for checking-out the ports tree when
.Dq Ar method Ns Li = Ns Va cvs .
.It Ar cvs_module
.Pq Vt str
cvs module to checkout when
.Dq Ar method Ns Li = Ns Va cvs .
.It Ar git_clone_uri
.Pq Vt str
git URI to clone when
.Dq Ar method Ns Li = Ns Vt git .
.It Ar git_branch
.Pq Vt str
branch to track when
.Dq Ar method Ns Li = Ns Vt git .
.It Ar git_submodules
.Pq Vt str
fetch submodules when
.Dq Ar method Ns Li = Ns Vt git .
.It Ar git_submodules_branch
.Pq Vt str
submodule branch to track when
.Dq Ar method Ns Li = Ns Vt git .
.It Ar hg_clone_uri
.Pq Vt str
mercurial URI to clone when
.Dq Ar method Ns Li = Ns Vt hg .
.It Ar rsync_source_path
.Pq Vt str
path to copy data from when
.Dq Ar method Ns Li = Ns Va rsync .
.It Ar rsync_extra_args
.Pq Vt str
extra arguments to pass to
.Xr rsync 1
when
.Dq Ar method Ns Li = Ns Va rsync .
.It Ar svn_checkout_path
.Pq Vt str
URI to checkout the ports tree from when
.Dq Ar method Ns Li = Ns Vt svn
or
.Dq Ar method Ns Li = Ns Vt svn+subtrees .
.It Ar svn_checkout_subtrees
.Pq Vt str
Whitespace separated list of subdirectories
.Ar path[@rev]
beneath the
.Ar svn_checkout_path
which will be checked out when
.Dq Ar method Ns Li = Ns Vt svn+subtrees .
.El
.Ss Special consideration when Dq Ar method Ns Li = Ns Vt csup
When updating a
.Ar source
ports tree using the
.Ar csup
method, the
.Ar source
ports tree name has to be
.Ar ports
because the remote collection is named likely.
.Xr portshaker 8
will ensure this condition is met before attempting to perform any update.
.Ss Hooking
An update script may define the
.Ao Ar port_tree Ac Ns Ar _pre Ns Ao Ar action Ac Ns ()
and
.Ao Ar port_tree Ac Ns Ar _post Ns Ao Ar action Ac Ns ()
function hooks, where
.Va action
is one of
.Vt update , Vt clone_to , Vt copy_to Li or Vt merge_to .
.Sh EXAMPLES
To configure the official FreeBSD ports tree as a
.Ar source
ports tree, create a
.Ar @@PREFIX@@/etc/portshaker.d/ports
shell script containing:
.Bd -literal
#!/bin/sh
\&. @@PREFIX@@/share/portshaker/portshaker.subr
if [ "$1" != '--' ]; then
err 1 "Extra arguments"
fi
shift
method="portsnap"
run_portshaker_command "$@"
.Ed
.Pp
To configure the BSD# ports tree as a
.Ar source
ports tree, create a
.Ar @@PREFIX@@/etc/portshaker.d/bsd_sharp
shell script containing:
.Bd -literal
#!/bin/sh
\&. @@PREFIX@@/share/portshaker/portshaker.subr
if [ "$1" != '--' ]; then
err 1 "Extra arguments"
fi
shift
method="svn"
svn_checkout_path="http://bsd-sharp.googlecode.com/svn/trunk/"
run_portshaker_command "$@"
.Ed
.Pp
If you want only a subset of ports from the (huge) FreeBSD tree as a
.Ar source
ports tree (probably to merge with some other tree), create a
.Ar @@PREFIX@@/etc/portshaker.d/freebsd_subset
shell script containing:
.Bd -literal
#!/bin/sh
\&. @@PREFIX@@/share/portshaker/portshaker.subr
if [ "$1" != '--' ]; then
err 1 "Extra arguments"
fi
shift
method="svn+subtrees"
svn_checkout_path="svn://svn.freebsd.org/ports/head"
svn_checkout_subtrees="
emulators/mame
net/samba34@319916
"
run_portshaker_command "$@"
.Ed
.Pp
To setup a dynamic redports
.Ar source
ports tree, create a
.Ar @@PREFIX@@/etc/portshaker.d/redports
shell script containing:
.Bd -literal
#!/bin/sh
\&. /usr/local/share/portshaker/portshaker.subr
if [ "$1" != '--' ]; then
err 1 "Extra arguments"
fi
shift
username="$1"
extra_info=":${username}"
shift
method="svn"
svn_checkout_path="http://svn.redports.org/${username}"
run_portshaker_command "$@"
.Ed
.Pp
You can then specify the
.Ar foo
and
.Ar bar
ports tree at redports specifying the
.Ar redports:foo
and
.Ar redports:bar
.Ar source
ports tree in your
.Ar portshaker.conf
configuration file.
.Pp
To use git as the
.Ar source
ports tree using submodules, create a
.Ar @@PREFIX@@/etc/portshaker.d/git_ports
shell script containing:
.Bd -literal
#!/bin/sh
\&. /usr/local/share/portshaker/portshaker.subr
if [ "$1" != '--' ]; then
err 1 "Extra arguments"
fi
shift
method="git"
git_clone_uri="[email protected]:freebsd/freebsd-ports.git"
git_branch="master"
git_submodules="yes"
git_submodules_branch="development"
run_portshaker_command "$@"
.Sh SEE ALSO
.Xr csup 1 ,
.Xr portshaker 8 ,
.Xr portshaker.conf 5
.Sh AUTHORS
.An Romain Tartière Aq [email protected]