Various dev-handbook updates:

1. Mention src/MAINTAINERS and how it works.
2. Add a short suggestion about how to identify possible
   maintainers, inspired by the committers-guide
3. Tcl has been removed from the base distribution, so it does
   not really serve as a good example of contributed software any
   more (obsoletes docs/50735)
4. Mention the growing use of FREEBSD-Xlist files for contrib software
5. Describe how vendor imports of Subversion code can be done (inspired
   by the Subversion docs of the Wiki).
6. Use slightly more up to date release numbers when describing library
   version bumps.

Submitted by:   Gavin Atkinson <gavin@freebsd.org>
Patches by:     gavin, pgj, keramida
PR:             docs/126030
This commit is contained in:
Giorgos Keramidas 2008-08-31 13:04:12 +00:00
parent e9d7727ebf
commit cb81fb3591
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=32764

View file

@ -12,6 +12,10 @@
<surname>Kamp</surname>
<contrib>Contributed by </contrib>
</author>
<author>
<firstname>Giorgos</firstname>
<surname>Keramidas</surname>
</author>
</authorgroup>
<!-- June 1996 -->
</chapterinfo>
@ -25,33 +29,55 @@
<title><makevar>MAINTAINER</makevar> on Makefiles</title>
<indexterm><primary>ports maintainer</primary></indexterm>
<para>If a particular portion of the FreeBSD distribution is being
maintained by a person or group of persons, they can communicate this
fact to the world by adding a
<para>If a particular portion of the &os; <filename>src/</filename>
distribution is being maintained by a person or group of persons,
this is communicated through an entry in the
<filename>src/MAINTAINERS</filename> file. Maintainers of ports
within the Ports Collection express their maintainership to the
world by adding a <makevar>MAINTAINER</makevar> line to the
<filename>Makefile</filename> of the port in question:</para>
<programlisting>MAINTAINER= email-addresses</programlisting>
<programlisting><makevar>MAINTAINER</makevar>= <replaceable>email-addresses</replaceable></programlisting>
line to the <filename>Makefile</filename>s covering this portion of the
source tree.</para>
<tip>
<para>For other parts of the repository, or for sections not listed
as having a maintainer, or when you are unsure who the active
maintainer is, try looking at the recent commit history of the
relevant parts of the source tree. It is quite often the case
that a maintainer is not explicitly named, but the people who are
actively working in a part of the source tree for, say, the last
couple of years are interested in reviewing changes. Even if this
is not specifically mentioned in the documentation or the source
itself, asking for a review as a form of courtesy is a very
reasonable thing to do.</para>
</tip>
<para>The semantics of this are as follows:</para>
<para>The role of the maintainer is as follows:</para>
<itemizedlist>
<listitem>
<para>The maintainer owns and is responsible for that code. This means
that he is responsible for fixing bugs and answering problem reports
that he or she is responsible for fixing bugs and answering problem reports
pertaining to that piece of the code, and in the case of contributed
software, for tracking new versions, as appropriate.</para>
</listitem>
<listitem>
<para>Changes to directories which have a maintainer defined shall be sent
to the maintainer for review before being committed. Only if the
maintainer does not respond for an unacceptable period of time, to
several emails, will it be acceptable to commit changes without review
by the maintainer. However, it is suggested that you try to have the
changes reviewed by someone else if at all possible.</para>
</listitem>
<listitem>
<para>It is of course not acceptable to add a person or group as
maintainer unless they agree to assume this duty. On the other hand it
does not have to be a committer and it can easily be a group of
people.</para>
</listitem>
</itemizedlist>
</sect1>
<sect1 id="policies-contributed">
@ -66,6 +92,10 @@
<firstname>David</firstname>
<surname>O'Brien</surname>
</author>
<author>
<firstname>Gavin</firstname>
<surname>Atkinson</surname>
</author>
</authorgroup>
<!-- June 1996 -->
</sect1info>
@ -90,7 +120,7 @@
model over time, as it has significant advantages over the old method,
including the ability to easily obtain diffs relative to the
<quote>official</quote> versions of the source by everyone (even without
cvs access). This will make it significantly easier to return changes
direct repository access). This will make it significantly easier to return changes
to the primary developers of the contributed software.</para>
<para>Ultimately, however, it comes down to the people actually doing the
@ -102,50 +132,47 @@
<note>
<para>Because of some unfortunate design limitations with the RCS file
format and CVS's use of vendor branches, minor, trivial and/or
format and the use of vendor branches, minor, trivial and/or
cosmetic changes are <emphasis>strongly discouraged</emphasis> on
files that are still tracking the vendor branch. <quote>Spelling
fixes</quote> are explicitly included here under the
<quote>cosmetic</quote> category and are to be avoided for files with
revision 1.1.x.x. The repository bloat impact from a single character
<quote>cosmetic</quote> category and are to be avoided.
The repository bloat impact from a single character
change can be rather dramatic.</para>
</note>
<para>The <application>Tcl</application> embedded programming
language will be used as example of how this model works:</para>
<sect2 id="vendor-import-cvs">
<title>Vendor Imports with CVS</title>
<para><filename>src/contrib/tcl</filename> contains the source as
<para>The <application>file</application> utility, used to identify
the format of a file, will be used as example of how this model
works:</para>
<para><filename>src/contrib/file</filename> contains the source as
distributed by the maintainers of this package. Parts that are entirely
not applicable for FreeBSD can be removed. In the case of Tcl, the
<filename>mac</filename>, <filename>win</filename> and
<filename>compat</filename> subdirectories were eliminated before the
import.</para>
not applicable for &os; can be removed. In the case of &man.file.1;, the
<filename>python</filename> subdirectory and files with the <filename>lt</filename>
prefix were eliminated before the import, amongst others.</para>
<para><filename>src/lib/libtcl</filename> contains only a <application>bmake</application> style
<para><filename>src/lib/libmagic</filename> contains a <application>bmake</application> style
<filename>Makefile</filename> that uses the standard
<filename>bsd.lib.mk</filename> makefile rules to produce the library
and install the documentation.</para>
<para><filename>src/usr.bin/tclsh</filename> contains only a bmake style
<para><filename>src/usr.bin/file</filename> contains a <application>bmake</application> style
<filename>Makefile</filename> which will produce and install the
<command>tclsh</command> program and its associated man-pages using the
<command>file</command> program and its associated man-pages using the
standard <filename>bsd.prog.mk</filename> rules.</para>
<para><filename>src/tools/tools/tcl_bmake</filename> contains a couple of
shell-scripts that can be of help when the tcl software needs updating.
These are not part of the built or installed software.</para>
<para>The important thing here is that the
<filename>src/contrib/tcl</filename> directory is created according to
<filename>src/contrib/file</filename> directory is created according to
the rules: it is supposed to contain the sources as distributed (on a
proper CVS vendor-branch and without RCS keyword expansion) with as few
proper vendor-branch and without RCS keyword expansion) with as few
FreeBSD-specific changes as possible. If there are any doubts on
how to go about it, it is imperative that you ask first and not blunder
ahead and hope it <quote>works out</quote>. CVS is not forgiving of
import accidents and a fair amount of effort is required to back out
major mistakes.</para>
ahead and hope it <quote>works out</quote>.</para>
<para>Because of the previously mentioned design limitations with CVS's
<para>Because of the previously mentioned design limitations with
vendor branches, it is required that <quote>official</quote> patches from
the vendor be applied to the original distributed sources and the result
re-imported onto the vendor branch again. Official patches should never
@ -168,7 +195,7 @@
<filename>src/tools</filename> directory along with the port itself so
that it is available to future maintainers.</para>
<para>In the <filename>src/contrib/tcl</filename> level directory, a file
<para>In the <filename>src/contrib/file</filename> level directory, a file
called <filename>FREEBSD-upgrade</filename> should be added and it
should state things like:</para>
@ -192,49 +219,298 @@
</listitem>
</itemizedlist>
<para>However, please do not import <filename>FREEBSD-upgrade</filename>
with the contributed source. Rather you should <command>cvs add
FREEBSD-upgrade ; cvs ci</command> after the initial import. Example
wording from <filename>src/contrib/cpio</filename> is below:</para>
<para>Example wording from
<filename>src/contrib/groff/FREEBSD-upgrade</filename> is
below:</para>
<programlisting>This directory contains virgin sources of the original distribution files
<programlisting>&dollar;FreeBSD: src/contrib/groff/FREEBSD-upgrade,v 1.5.12.1 2005/11/15 22:06:18 ru Exp $
This directory contains virgin copies of the original distribution files
on a "vendor" branch. Do not, under any circumstances, attempt to upgrade
the files in this directory via patches and a cvs commit. New versions or
official-patch versions must be imported. Please remember to import with
"-ko" to prevent CVS from corrupting any vendor RCS Ids.
the files in this directory via patches and a cvs commit.
For the import of GNU cpio 2.4.2, the following files were removed:
To upgrade to a newer version of groff, when it is available:
1. Unpack the new version into an empty directory.
[Do not make ANY changes to the files.]
INSTALL cpio.info mkdir.c
Makefile.in cpio.texi mkinstalldirs
2. Use the command:
cvs import -m 'Virgin import of FSF groff v&lt;version&gt;' \
src/contrib/groff FSF v&lt;version&gt;
To upgrade to a newer version of cpio, when it is available:
1. Unpack the new version into an empty directory.
[Do not make ANY changes to the files.]
For example, to do the import of version 1.19.2, I typed:
cvs import -m 'Virgin import of FSF groff v1.19.2' \
src/contrib/groff FSF v1_19_2
2. Remove the files listed above and any others that don't apply to
FreeBSD.
3. Use the command:
cvs import -ko -m 'Virgin import of GNU cpio v&lt;version&gt;' \
src/contrib/cpio GNU cpio_&lt;version&gt;
For example, to do the import of version 2.4.2, I typed:
cvs import -ko -m 'Virgin import of GNU v2.4.2' \
src/contrib/cpio GNU cpio_2_4_2
4. Follow the instructions printed out in step 3 to resolve any
conflicts between local FreeBSD changes and the newer version.
3. Follow the instructions printed out in step 2 to resolve any
conflicts between local FreeBSD changes and the newer version.
Do not, under any circumstances, deviate from this procedure.
To make local changes to cpio, simply patch and commit to the main
branch (aka HEAD). Never make local changes on the GNU branch.
To make local changes to groff, simply patch and commit to the main
branch (aka HEAD). Never make local changes on the FSF branch.
All local changes should be submitted to "cpio@gnu.ai.mit.edu" for
inclusion in the next vendor release.
All local changes should be submitted to Werner Lemberg &lt;wl@gnu.org&gt; or
Ted Harding &lt;ted.harding@nessie.mcc.ac.uk&gt; for inclusion in the next
vendor release.
obrien@FreeBSD.org - 30 March 1997</programlisting>
ru@FreeBSD.org - 20 October 2005</programlisting>
<para>Another approach my also be taken for the list of files to be
excluded, which is especially useful when the list is large or
complicated or where imports happen frequently. By creating a
file <filename>FREEBSD-Xlist</filename> in the same directory the
vendor source is imported into, containing a list of filename
patterns to be excluded one per line, future imports can often
performed with:</para>
<screen>&prompt.user; <userinput><command>tar</command> <option>-X</option> <filename>FREEBSD-Xlist</filename> <option>-xzf</option> <filename><replaceable>vendor-source.tgz</replaceable></filename></userinput></screen>
<para>An example of a <filename>FREEBSD-Xlist</filename> file, from
<filename>src/contrib/tcsh</filename>, is here:</para>
<programlisting>*/BUGS
*/config/a*
*/config/bs2000
*/config/bsd
*/config/bsdreno
*/config/[c-z]*
*/tests
*/win32</programlisting>
<note>
<para>Please do not import <filename>FREEBSD-upgrade</filename> or
<filename>FREEBSD-Xlist</filename> with the contributed source.
Rather you should add these files after the initial
import.</para>
</note>
</sect2>
<sect2 id="vendor-import-svn">
<sect2info>
<authorgroup>
<author>
<firstname>Dag-Erling</firstname>
<surname>Sm&oslash;rgrav</surname>
<contrib>Contributed by </contrib>
</author>
</authorgroup>
</sect2info>
<title>Vendor Imports with SVN</title>
<para>This section describes the vendor import procedure with
<application>Subversion</application> in details.</para>
<procedure>
<step>
<title>Preparing the Tree</title>
<para>If this is your first import after the switch to
<acronym>SVN</acronym>, you will have to flatten and clean
up the vendor tree, and bootstrap merge history in the main
tree. If not, you can safely omit this step.</para>
<para>During the conversion from <acronym>CVS</acronym> to
<acronym>SVN</acronym>, vendor branches were imported with
the same layout as the main tree. For example, the
<application>foo</application> vendor sources ended up in
<filename>vendor/<replaceable>foo</replaceable>/dist/contrib/<replaceable>foo</replaceable></filename>,
but it is pointless and rather inconvenient. What we really
want is to have the vendor source directly in
<filename>vendor/<replaceable>foo</replaceable>/dist</filename>,
like this:</para>
<screen>&prompt.user; <userinput><command>cd</command> <filename class="directory">vendor/<replaceable>foo</replaceable>/dist/contrib/<replaceable>foo</replaceable></filename></userinput>
&prompt.user; <userinput><command>svn move</command> $(svn list) <filename>../..</filename></userinput>
&prompt.user; <userinput><command>cd</command> <filename>../..</filename></userinput>
&prompt.user; <userinput><command>svn remove</command> <filename>contrib</filename></userinput>
&prompt.user; <userinput><command>svn propdel</command> <option>-R</option> svn:mergeinfo</userinput>
&prompt.user; <userinput><command>svn commit</command></userinput></screen>
<para>Note that, the <literal>propdel</literal> bit is
necessary because starting with 1.5, Subversion will
automatically add <literal>svn:mergeinfo</literal> to any
directory you copy or move. In this case, you will not need
this information, since you are not going to merge anything
from the tree you deleted.</para>
<note>
<para>You may want to flatten the tags as well. The
procedure is exactly the same. If you do this, put off
the commit until the end.</para>
</note>
<para>Check the <filename>dist</filename> tree and perform any
cleanup that is deemed to be necessary. You may want to
disable keyword expansion, as it makes no sense on
unmodified vendor code. In some cases, it can be even be
harmful.</para>
<screen>&prompt.user; <userinput><command>svn propdel</command> svn:keywords <option>-R</option> <filename>.</filename></userinput>
&prompt.user; <userinput><command>svn commit</command></userinput></screen>
<para>Bootstrapping of <literal>svn:mergeinfo</literal> on the
target directory (in the main tree) to the revision that
corresponds to the last change was made to the vendor tree
prior to importing new sources is also needed:</para>
<screen>&prompt.user; <userinput><command>cd</command> <filename>head/contrib/<replaceable>foo</replaceable></filename></userinput>
&prompt.user; <userinput><command>svn merge</command> <option>--record-only</option> <replaceable>svn_base</replaceable>/vendor/<replaceable>foo</replaceable>/dist@<replaceable>12345678</replaceable> <filename>.</filename></userinput>
&prompt.user; <userinput><command>svn commit</command></userinput></screen>
<para>where <replaceable>svn_base</replaceable> is the base
directory of your <acronym>SVN</acronym> repository, e.g.
<literal>svn+ssh://svn.FreeBSD.org/base</literal>.</para>
</step>
<step>
<title>Importing New Sources</title>
<para>Prepare a full, clean tree of the vendor sources. With
<acronym>SVN</acronym>, we can keep a full distribution in
the vendor tree without bloating the main tree. Import
everything but merge only what is needed.</para>
<para>Note that you will need to add any files that were added
since the last vendor import, and remove any that were
removed. To facilitate this, you should prepare sorted
lists of the contents of the vendor tree and of the sources
you are about to import:</para>
<screen>&prompt.user; <userinput><command>cd</command> <filename>vendor/<replaceable>foo</replaceable>/dist</filename></userinput>
&prompt.user; <userinput><command>svn list</command> <option>-R</option> | <command>grep</command> <option>-v</option> '/$' | <command>sort</command> > <filename>../<replaceable>old</replaceable></filename></userinput>
&prompt.user; <userinput><command>cd</command> <filename>../<replaceable>foo-9.9</replaceable></filename></userinput>
&prompt.user; <userinput><command>find</command> <filename>.</filename> <option>-type</option> f | <command>cut</command> <option>-c</option> 3- | <command>sort</command> > <filename>../<replaceable>new</replaceable></filename></userinput></screen>
<para>With these two files, the following command will list
list removed files (files only in
<filename><replaceable>old</replaceable></filename>):</para>
<screen>&prompt.user; <userinput><command>comm <option>-23</option> <filename>../<replaceable>old</replaceable></filename> <filename>../<replaceable>new</replaceable></filename></command></userinput></screen>
<para>While the command below will list added files (files
only in
<filename><replaceable>new</replaceable></filename>):</para>
<screen>&prompt.user; <userinput><command>comm <option>-13</option> <filename>../<replaceable>old</replaceable></filename> <filename>../<replaceable>new</replaceable></filename></command></userinput></screen>
<para>Let's put this together:</para>
<screen>&prompt.user; <userinput><command>cd</command> <filename class="directory">vendor/<replaceable>foo</replaceable>/<replaceable>foo-9.9</replaceable></filename></userinput>
&prompt.user; <userinput><command>tar</command> cf - <filename>.</filename> | <command>tar</command> xf - <option>-C</option> <filename>../dist</filename></userinput>
&prompt.user; <userinput><command>cd</command> <filename class="directory">../dist</filename></userinput>
&prompt.user; <userinput><command>comm</command> <option>-23</option> <filename>../<replaceable>old</replaceable></filename> <filename>../<replaceable>new</replaceable></filename> | <command>xargs</command> svn remove</userinput>
&prompt.user; <userinput><command>comm</command> <option>-13</option> <filename>../<replaceable>old</replaceable></filename> <filename>../<replaceable>new</replaceable></filename> | <command>xargs</command> svn add</userinput></screen>
<warning>
<para>If there are new directories in the new distribution,
the last command will fail. You will have to add the
directories, and run it again. Conversely, if any
directories were removed, you will have to remove them
manually.</para>
</warning>
<para>Check properties on any new files:</para>
<itemizedlist>
<listitem>
<para>All text files
should have <literal>svn:eol-style</literal> set to
<literal>native</literal>.
</listitem>
<listitem>
<para>All binary files should have
<literal>svn:mime-type</literal> set to
<literal>application/octet-stream</literal>, unless
there is a more appropriate media type.</para>
</listitem>
<listitem>
<para>Executable files should have
<literal>svn:executable</literal> set to
<literal>*</literal>.</para>
</listitem>
<listitem>
<para>There should be no other properties on any file in
the tree.</para>
</listitem>
</itemizedlist>
<note>
<para>You are ready to commit, but you should first check
the output of <command>svn stat</command> and <command>svn
diff</command> to make sure everything is in order.</para>
</note>
<para>Once you have committed the new vendor release, you
should tag it for future reference. The best and quickest
way is to do it directly in the repository:</para>
<screen>&prompt.user; <userinput><command>svn copy</command> <filename><replaceable>svn_base</replaceable>/vendor/<replaceable>foo</replaceable>/dist</filename> <filename><replaceable>svn_base</replaceable>/vendor/<replaceable>foo</replaceable>/<replaceable>9.9</replaceable></filename></userinput></screen>
<para>To get the new tag, you can update your working copy of
<filename>vendor/<replaceable>foo</replaceable></filename>.</para>
<note>
<para>If you choose to do the copy in the checkout instead,
do not forget to remove the generated
<literal>svn:mergeinfo</literal> as described
above.</para>
</note>
</step>
<step>
<title>Merging to <emphasis>-HEAD</emphasis></title>
<para>After you have prepared your import, it is time to
merge. Option <option>--accept=postpone</option> tells
<acronym>SVN</acronym> not to handle merge conflicts yet,
because they will be taken care of manually:</para>
<screen>&prompt.user; <userinput><command>cd</command> <filename class="directory">head/contrib/<replaceable>foo</replaceable></filename></userinput>
&prompt.user; <userinput><command>svn update</command></userinput>
&prompt.user; <userinput><command>svn merge</command> <option>--accept=postpone</option> <filename><replaceable>svn_base</replaceable>/vendor/<replaceable>foo</replaceable>/dist</filename></userinput></screen>
<para>Resolve any conflicts, and make sure that any files that
were added or removed in the vendor tree have been properly
added or removed in the main tree. It is always a good idea
to check differences against the vendor branch:</para>
<screen>&prompt.user; <userinput><command>svn diff</command> <option>--no-diff-deleted</option> <option>--old=</option><filename><replaceable>svn_base</replaceable>/vendor/<replaceable>foo</replaceable>/dist</filename> <option>--new=</option><filename>.</filename></userinput></screen>
<para>The <option>--no-diff-deleted</option> option tells
<acronym>SVN</acronym> not to check files that are in the
vendor tree but not in the main tree.</para>
<note>
<para>With <acronym>SVN</acronym>, there is no concept of on
or off the vendor branch. If a file that previously had
local modifications no longer does, just remove any
left-over cruft, such as &os; version tags, so it no
longer shows up in diffs against the vendor tree.</para>
</note>
<para>If any changes are required for the world to build with
the new sources, make them now &mdash; and test until you
are satisfied that everything build and runs
correctly.</para>
</step>
<step>
<title>Commit</title>
<para>Now, you are ready to commit. Make sure you get
everything in one go. Ideally, you would have done all
steps in a clean tree, in which case you can just commit
from the top of that tree. That is the best way to avoid
surprises. If you do it properly, the tree will move
atomically from a consistent state with the old code to a
consistent state with the new code.</para>
</step>
</procedure>
</sect2>
</sect1>
<sect1 id="policies-encumbered">
@ -411,7 +687,7 @@ obrien@FreeBSD.org - 30 March 1997</programlisting>
<para>For non-port libraries, it is also our policy to change the shared
library version number only once between releases. In addition, it is
our policy to change the major shared library version number only once
between major OS releases (i.e. from 3.0 to 4.0). When you make a
between major OS releases (i.e. from 6.0 to 7.0). When you make a
change to a system library that requires the version number to be
bumped, check the <filename>Makefile</filename>'s commit logs. It is the
responsibility of the committer to ensure that the first such change