Wed Jun 6 07:39:07 2012 UTC ()
Document that new packages should be 'cvs add'ed instead of imported.
Per the discussion on tech-pkg.


(wiz)
diff -r1.24 -r1.25 pkgsrc/doc/guide/files/submit.xml

cvs diff -r1.24 -r1.25 pkgsrc/doc/guide/files/submit.xml (switch to unified diff)

--- pkgsrc/doc/guide/files/submit.xml 2009/09/17 18:01:18 1.24
+++ pkgsrc/doc/guide/files/submit.xml 2012/06/06 07:39:07 1.25
@@ -1,243 +1,245 @@ @@ -1,243 +1,245 @@
1<!-- $NetBSD: submit.xml,v 1.24 2009/09/17 18:01:18 kano Exp $ --> 1<!-- $NetBSD: submit.xml,v 1.25 2012/06/06 07:39:07 wiz Exp $ -->
2 2
3<chapter id="submit"> <?dbhtml filename="submit.html"?> 3<chapter id="submit"> <?dbhtml filename="submit.html"?>
4<title>Submitting and Committing</title> 4<title>Submitting and Committing</title>
5 5
6<sect1 id="submitting-binary-packages"> 6<sect1 id="submitting-binary-packages">
7<title>Submitting binary packages</title> 7<title>Submitting binary packages</title>
8 8
9 <para>Our policy is that we accept binaries only from pkgsrc 9 <para>Our policy is that we accept binaries only from pkgsrc
10 developers to guarantee that the packages don't contain any 10 developers to guarantee that the packages don't contain any
11 trojan horses etc. This is not to annoy anyone but rather to 11 trojan horses etc. This is not to annoy anyone but rather to
12 protect our users! You're still free to put up your home-made 12 protect our users! You're still free to put up your home-made
13 binary packages and tell the world where to get them. NetBSD 13 binary packages and tell the world where to get them. NetBSD
14 developers doing bulk builds and wanting to upload them please 14 developers doing bulk builds and wanting to upload them please
15 see <xref linkend="bulk-upload"/>.</para> 15 see <xref linkend="bulk-upload"/>.</para>
16 16
17</sect1> 17</sect1>
18 18
19<sect1 id="submitting-your-package"> 19<sect1 id="submitting-your-package">
20<title>Submitting source packages (for non-NetBSD-developers)</title> 20<title>Submitting source packages (for non-NetBSD-developers)</title>
21 21
22 <para>First, check that your package is complete, compiles and 22 <para>First, check that your package is complete, compiles and
23 runs well; see <xref linkend="debug"/> and the rest of this 23 runs well; see <xref linkend="debug"/> and the rest of this
24 document. Next, generate an uuencoded gzipped &man.tar.1; 24 document. Next, generate an uuencoded gzipped &man.tar.1;
25 archive that contains all files that make up the package. 25 archive that contains all files that make up the package.
26 Finally, send this package to the pkgsrc bug tracking system, 26 Finally, send this package to the pkgsrc bug tracking system,
27 either with the &man.send-pr.1; command, or if you don't have 27 either with the &man.send-pr.1; command, or if you don't have
28 that, go to the web page 28 that, go to the web page
29 <ulink url="http://www.NetBSD.org/support/send-pr.html"/>, 29 <ulink url="http://www.NetBSD.org/support/send-pr.html"/>,
30 which contains some instructions and a link to a form where you 30 which contains some instructions and a link to a form where you
31 can submit packages. The 31 can submit packages. The
32 <filename role="pkg">sysutils/gtk-send-pr</filename> package is 32 <filename role="pkg">sysutils/gtk-send-pr</filename> package is
33 also available as a substitute for either of the above two tools. 33 also available as a substitute for either of the above two tools.
34 </para> 34 </para>
35 35
36 <para>In the form of the problem report, the category should be 36 <para>In the form of the problem report, the category should be
37 <quote>pkg</quote>, the synopsis should include the package name 37 <quote>pkg</quote>, the synopsis should include the package name
38 and version number, and the description field should contain a 38 and version number, and the description field should contain a
39 short description of your package (contents of the COMMENT 39 short description of your package (contents of the COMMENT
40 variable or DESCR file are OK). The uuencoded package data should 40 variable or DESCR file are OK). The uuencoded package data should
41 go into the <quote>fix</quote> field.</para> 41 go into the <quote>fix</quote> field.</para>
42 42
43 <para>If you want to submit several packages, please send a 43 <para>If you want to submit several packages, please send a
44 separate PR for each one, it's easier for us to track things 44 separate PR for each one, it's easier for us to track things
45 that way.</para> 45 that way.</para>
46 46
47 <para>Alternatively, you can also import new packages into 47 <para>Alternatively, you can also import new packages into
48 pkgsrc-wip (<quote>pkgsrc work-in-progress</quote>); see the 48 pkgsrc-wip (<quote>pkgsrc work-in-progress</quote>); see the
49 homepage at <ulink url="http://pkgsrc-wip.sourceforge.net/"/> 49 homepage at <ulink url="http://pkgsrc-wip.sourceforge.net/"/>
50 for details.</para> 50 for details.</para>
51 51
52</sect1> 52</sect1>
53 53
54<sect1 id="general-notes-for-changes"> 54<sect1 id="general-notes-for-changes">
55<title>General notes when adding, updating, or removing packages</title> 55<title>General notes when adding, updating, or removing packages</title>
56 56
57 <para>Please note all package additions, updates, moves, and 57 <para>Please note all package additions, updates, moves, and
58 removals in <filename>pkgsrc/doc/CHANGES-<replaceable>YYYY</replaceable></filename>. It's very 58 removals in <filename>pkgsrc/doc/CHANGES-<replaceable>YYYY</replaceable></filename>. It's very
59 important to keep this file up to date and conforming to the 59 important to keep this file up to date and conforming to the
60 existing format, because it will be used by scripts to 60 existing format, because it will be used by scripts to
61 automatically update pages on <ulink 61 automatically update pages on <ulink
62 url="http://www.NetBSD.org/">www.NetBSD.org</ulink> and other 62 url="http://www.NetBSD.org/">www.NetBSD.org</ulink> and other
63 sites. Additionally, check the 63 sites. Additionally, check the
64 <filename>pkgsrc/doc/TODO</filename> file and remove the entry 64 <filename>pkgsrc/doc/TODO</filename> file and remove the entry
65 for the package you updated or removed, in case it was mentioned 65 for the package you updated or removed, in case it was mentioned
66 there.</para> 66 there.</para>
67 67
68 <para>When the <varname>PKGREVISION</varname> of a package is 68 <para>When the <varname>PKGREVISION</varname> of a package is
69 bumped, the change should appear in 69 bumped, the change should appear in
70 <filename>pkgsrc/doc/CHANGES-<replaceable>YYYY</replaceable></filename> if it is security 70 <filename>pkgsrc/doc/CHANGES-<replaceable>YYYY</replaceable></filename> if it is security
71 related or otherwise relevant. Mass bumps that result from a 71 related or otherwise relevant. Mass bumps that result from a
72 dependency being updated should not be mentioned. In all other 72 dependency being updated should not be mentioned. In all other
73 cases it's the developer's decision.</para> 73 cases it's the developer's decision.</para>
74 74
75<para>There is a make target that helps in creating proper 75<para>There is a make target that helps in creating proper
76 <filename>CHANGES-<replaceable>YYYY</replaceable></filename> entries: <command>make 76 <filename>CHANGES-<replaceable>YYYY</replaceable></filename> entries: <command>make
77 changes-entry</command>. It uses the optional <varname>CTYPE</varname> 77 changes-entry</command>. It uses the optional <varname>CTYPE</varname>
78 and <varname>NETBSD_LOGIN_NAME</varname> variables. The general 78 and <varname>NETBSD_LOGIN_NAME</varname> variables. The general
79 usage is to first make sure that your <filename>CHANGES-<replaceable>YYYY</replaceable></filename> 79 usage is to first make sure that your <filename>CHANGES-<replaceable>YYYY</replaceable></filename>
80 file is up-to-date (to avoid having to resolve conflicts later-on) 80 file is up-to-date (to avoid having to resolve conflicts later-on)
81 and then to <command>cd</command> to the package directory. For 81 and then to <command>cd</command> to the package directory. For
82 package updates, <command>make changes-entry</command> is enough. 82 package updates, <command>make changes-entry</command> is enough.
83 For new packages, or package moves or removals, set the 83 For new packages, or package moves or removals, set the
84 <varname>CTYPE</varname> variable on the command line to "Added", 84 <varname>CTYPE</varname> variable on the command line to "Added",
85 "Moved", or "Removed". You can set <varname>NETBSD_LOGIN_NAME</varname> 85 "Moved", or "Removed". You can set <varname>NETBSD_LOGIN_NAME</varname>
86 in &mk.conf; if your local login name is 86 in &mk.conf; if your local login name is
87 not the same as your NetBSD login name. The target also automatically 87 not the same as your NetBSD login name. The target also automatically
88 removes possibly existing entries for the package in the 88 removes possibly existing entries for the package in the
89 <filename>TODO</filename> file. Don't forget to commit 89 <filename>TODO</filename> file. Don't forget to commit
90 the changes, e.g. by using <command>make changes-entry-commit</command>! 90 the changes, e.g. by using <command>make changes-entry-commit</command>!
91 If you are not using a checkout directly from cvs.NetBSD.org, but e.g. 91 If you are not using a checkout directly from cvs.NetBSD.org, but e.g.
92 a local copy of the repository, you can set USE_NETBSD_REPO=yes. This 92 a local copy of the repository, you can set USE_NETBSD_REPO=yes. This
93 makes the cvs commands use the main repository. 93 makes the cvs commands use the main repository.
94 </para> 94 </para>
95</sect1> 95</sect1>
96 96
97<sect1 id="committing-importing"> 97<sect1 id="committing-importing">
98<title>Committing: Importing a package into CVS</title> 98<title>Committing: Adding a package to CVS</title>
99<para>This section is only of interest for pkgsrc developers with write 99<para>This section is only of interest for pkgsrc developers with write
100 access to the pkgsrc repository. Please remember that cvs 100 access to the pkgsrc repository.</para>
101 imports files relative to the current working directory, and that 101<para>When the package is finished, <quote>cvs add</quote> the files.
102 the pathname that you 102Start by adding the directory and then files in the directory. Don't
103 give the <command>cvs import</command> command is so that it knows where 103forget to add the new package to the category's
104 to place the files in the repository. Newly created packages should be 104<filename>Makefile</filename>. Make sure you don't forget any files;
105 imported with a vendor tag of <quote>TNF</quote> and a release tag of 105you can check by running <quote>cvs status</quote>. An example:</para>
106 <quote>pkgsrc-base</quote>, e.g:</para> 
107 
108<programlisting> 106<programlisting>
109&uprompt; cd .../pkgsrc/category/pkgname 107&uprompt; cd .../pkgsrc/category
110&uprompt; cvs import pkgsrc/category/pkgname TNF pkgsrc-base 108&uprompt; cvs add pkgname
 109&uprompt; cd pkgname
 110&uprompt; cvs add DESCR Makefile PLIST distinfo buildlink3.mk patches
 111&uprompt; cvs add patches/p*
 112&uprompt; cvs status | less
 113&uprompt; cd ..
 114&uprompt; vi Makefile # add SUBDIRS+=pkgname line
 115&uprompt; cvs commit Makefile pkgname
111</programlisting> 116</programlisting>
112 117
113<para>Remember to move the directory from which you imported out of 
114 the way, or cvs will complain the next time you <quote>cvs 
115 update</quote> your source tree. Also don't forget to add the new 
116 package to the category's <filename>Makefile</filename>.</para> 
117 
118<para>The commit message of the initial import should include part of the 118<para>The commit message of the initial import should include part of the
119 <filename>DESCR</filename> file, so people reading the mailing lists know 119 <filename>DESCR</filename> file, so people reading the mailing lists know
120 what the package is/does.</para> 120 what the package is/does.</para>
121 121
122<para>For new packages, <quote>cvs import</quote> is preferred to <quote>cvs 122<para>Also mention the new package in
123 add</quote> because the former gets everything with a single command, 123<filename>pkgsrc/doc/CHANGES-20xx</filename>.</para>
124 and provides a consistent tag.</para> 124
 125<para>Previously, <quote>cvs import</quote> was suggested, but it was
 126much easier to get wrong than <quote>cvs add</quote>.</para>
125</sect1> 127</sect1>
126 128
127<sect1 id="updating-package"> 129<sect1 id="updating-package">
128<title>Updating a package to a newer version</title> 130<title>Updating a package to a newer version</title>
129<para>Please always put a concise, appropriate and relevant summary of the 131<para>Please always put a concise, appropriate and relevant summary of the
130 changes between old and new versions into the commit log when updating 132 changes between old and new versions into the commit log when updating
131 a package. There are various reasons for this:</para> 133 a package. There are various reasons for this:</para>
132 134
133<itemizedlist> 135<itemizedlist>
134<listitem> 136<listitem>
135<para>A URL is volatile, and can change over time. It may go away completely 137<para>A URL is volatile, and can change over time. It may go away completely
136 or its information may be overwritten by newer information.</para> 138 or its information may be overwritten by newer information.</para>
137</listitem> 139</listitem>
138 140
139<listitem> 141<listitem>
140<para>Having the change information between old and new versions in our CVS 142<para>Having the change information between old and new versions in our CVS
141 repository is very useful for people who use either cvs or anoncvs.</para> 143 repository is very useful for people who use either cvs or anoncvs.</para>
142</listitem> 144</listitem>
143 145
144<listitem> 146<listitem>
145<para>Having the change information between old and new versions in our CVS 147<para>Having the change information between old and new versions in our CVS
146 repository is very useful for people who read the pkgsrc-changes mailing 148 repository is very useful for people who read the pkgsrc-changes mailing
147 list, so that they can make tactical decisions about when to upgrade 149 list, so that they can make tactical decisions about when to upgrade
148 the package.</para> 150 the package.</para>
149</listitem> 151</listitem>
150</itemizedlist> 152</itemizedlist>
151 153
152<para>Please also recognize that, just because a new version of a package 154<para>Please also recognize that, just because a new version of a package
153 has been released, it should not automatically be upgraded in the CVS 155 has been released, it should not automatically be upgraded in the CVS
154 repository. We prefer to be conservative in the packages that are 156 repository. We prefer to be conservative in the packages that are
155 included in pkgsrc - development or beta packages are not really the 157 included in pkgsrc - development or beta packages are not really the
156 best thing for most places in which pkgsrc is used. Please use your 158 best thing for most places in which pkgsrc is used. Please use your
157 judgement about what should go into pkgsrc, and bear in mind that 159 judgement about what should go into pkgsrc, and bear in mind that
158 stability is to be preferred above new and possibly untested features.</para> 160 stability is to be preferred above new and possibly untested features.</para>
159</sect1> 161</sect1>
160 162
161<sect1 id="renaming-package"> 163<sect1 id="renaming-package">
162<title>Renaming a package in pkgsrc</title> 164<title>Renaming a package in pkgsrc</title>
163 165
164<para>Renaming packages is not recommended.</para> 166<para>Renaming packages is not recommended.</para>
165 167
166 168
167<para>When renaming packages, be sure to fix any references to old name 169<para>When renaming packages, be sure to fix any references to old name
168 in other Makefiles, options, buildlink files, etc.</para> 170 in other Makefiles, options, buildlink files, etc.</para>
169 171
170<para>Also When renaming a package, please define 172<para>Also When renaming a package, please define
171 <varname>SUPERSEDES</varname> to the package name and dewey version 173 <varname>SUPERSEDES</varname> to the package name and dewey version
172 pattern(s) of the previous package name. 174 pattern(s) of the previous package name.
173 This may be repeated for multiple renames. 175 This may be repeated for multiple renames.
174 The new package would be an exact replacement. 176 The new package would be an exact replacement.
175</para> 177</para>
176 178
177<para>Note that <quote>successor</quote> in the 179<para>Note that <quote>successor</quote> in the
178 CHANGES-<replaceable>YYYY</replaceable> file doesn't necessarily 180 CHANGES-<replaceable>YYYY</replaceable> file doesn't necessarily
179 mean that it <emphasis>supersedes</emphasis>, as that successor may 181 mean that it <emphasis>supersedes</emphasis>, as that successor may
180 not be an exact replacement but is a suggestion for the replaced 182 not be an exact replacement but is a suggestion for the replaced
181 functionality.</para> 183 functionality.</para>
182 184
183</sect1> 185</sect1>
184 186
185<sect1 id="moving-package"> 187<sect1 id="moving-package">
186<title>Moving a package in pkgsrc</title> 188<title>Moving a package in pkgsrc</title>
187 189
188<para>It is preferred that packages are not renamed or moved, but if needed 190<para>It is preferred that packages are not renamed or moved, but if needed
189 please follow these steps. 191 please follow these steps.
190</para> 192</para>
191 193
192<orderedlist> 194<orderedlist>
193<listitem><para>Make a copy of the directory somewhere else.</para></listitem> 195<listitem><para>Make a copy of the directory somewhere else.</para></listitem>
194 196
195<listitem><para>Remove all CVS dirs.</para> 197<listitem><para>Remove all CVS dirs.</para>
196<para>Alternatively to the first two steps you can also do:</para> 198<para>Alternatively to the first two steps you can also do:</para>
197<screen>&cprompt; <userinput>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</userinput></screen> 199<screen>&cprompt; <userinput>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</userinput></screen>
198<para>and use that for further work.</para> 200<para>and use that for further work.</para>
199</listitem> 201</listitem>
200 202
201<listitem><para>Fix <varname>CATEGORIES</varname> and any 203<listitem><para>Fix <varname>CATEGORIES</varname> and any
202<varname>DEPENDS</varname> paths that just did <quote>../package</quote> 204<varname>DEPENDS</varname> paths that just did <quote>../package</quote>
203instead of <quote>../../category/package</quote>.</para> 205instead of <quote>../../category/package</quote>.</para>
204</listitem> 206</listitem>
205 207
206<listitem><para>In the modified package's Makefile, consider setting 208<listitem><para>In the modified package's Makefile, consider setting
207<varname>PREV_PKGPATH</varname> to the previous category/package 209<varname>PREV_PKGPATH</varname> to the previous category/package
208pathname. The <varname>PREV_PKGPATH</varname> can be used by tools 210pathname. The <varname>PREV_PKGPATH</varname> can be used by tools
209for doing an update using pkgsrc building; for example, it can 211for doing an update using pkgsrc building; for example, it can
210search the &man.pkg.summary.5; database for <varname>PREV_PKGPATH</varname> 212search the &man.pkg.summary.5; database for <varname>PREV_PKGPATH</varname>
211(if no <varname>SUPERSEDES</varname>) and then use the corresponding 213(if no <varname>SUPERSEDES</varname>) and then use the corresponding
212new <varname>PKGPATH</varname> for that moved package. Note that 214new <varname>PKGPATH</varname> for that moved package. Note that
213it may have multiple matches, so the tool should also check on the 215it may have multiple matches, so the tool should also check on the
214<varname>PKGBASE</varname> too. The <varname>PREV_PKGPATH</varname> 216<varname>PKGBASE</varname> too. The <varname>PREV_PKGPATH</varname>
215probably has no value unless <varname>SUPERSEDES</varname> is not 217probably has no value unless <varname>SUPERSEDES</varname> is not
216set, i.e. <varname>PKGBASE</varname> stays the same. </para> 218set, i.e. <varname>PKGBASE</varname> stays the same. </para>
217</listitem> 219</listitem>
218 220
219<listitem><para><command>cvs import</command> the modified package in the new 221<listitem><para><command>cvs import</command> the modified package in the new
220place.</para></listitem> 222place.</para></listitem>
221 223
222<listitem><para>Check if any package depends on it: 224<listitem><para>Check if any package depends on it:
223<screen>&cprompt; <userinput>cd /usr/pkgsrc</userinput> 225<screen>&cprompt; <userinput>cd /usr/pkgsrc</userinput>
224&cprompt; <userinput>grep /package */*/Makefile* */*/buildlink*</userinput></screen></para> 226&cprompt; <userinput>grep /package */*/Makefile* */*/buildlink*</userinput></screen></para>
225</listitem> 227</listitem>
226 228
227<listitem><para>Fix paths in packages from step 5 to point to new location.</para></listitem> 229<listitem><para>Fix paths in packages from step 5 to point to new location.</para></listitem>
228 230
229<listitem><para><command>cvs rm (-f)</command> the package at the old location.</para></listitem> 231<listitem><para><command>cvs rm (-f)</command> the package at the old location.</para></listitem>
230 232
231<listitem><para>Remove from <filename>oldcategory/Makefile</filename>.</para></listitem> 233<listitem><para>Remove from <filename>oldcategory/Makefile</filename>.</para></listitem>
232 234
233<listitem><para>Add to <filename>newcategory/Makefile</filename>.</para></listitem> 235<listitem><para>Add to <filename>newcategory/Makefile</filename>.</para></listitem>
234 236
235<listitem><para>Commit the changed and removed files:</para> 237<listitem><para>Commit the changed and removed files:</para>
236<screen>&cprompt; <userinput>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</userinput></screen> 238<screen>&cprompt; <userinput>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</userinput></screen>
237<para>(and any packages from step 5, of course).</para> 239<para>(and any packages from step 5, of course).</para>
238</listitem> 240</listitem>
239</orderedlist> 241</orderedlist>
240 242
241</sect1> 243</sect1>
242 244
243</chapter> 245</chapter>