4 man-db is not a large or particularly complicated project, but there is
5 still plenty for an interested developer to contribute. Here's a very brief
6 guide on how to get started.
12 The source tree looks something like this, ignoring some directories added
13 by autoconf, automake, gettext, and gnulib:
16 Assorted documentation.
18 Man pages for man-db's programs.
20 The man-db manual, written in troff.
22 Header files used throughout the package.
24 Basic library files, some of which supplement inadequate C libraries on
25 various systems and some of which implement utility functions used
26 throughout the package.
28 The database access library. Code outside this directory should not know
29 about specific back-end database implementations.
31 Source code to the man-db programs themselves.
33 Miscellaneous add-on scripts.
41 Each indent is a single tab. Brace style is K&R. Each function name is
42 separated from the following opening parenthesis by a single space. (All
43 this is almost certainly controversial somewhere, but it's as close as
44 you'll get to a prevailing style here.)
46 Keep all code within 80 columns (counting tabs as 8). This can sometimes be
47 a little tight with the deep indent; think of it as a useful discipline to
48 stop indentation levels getting out of hand. :-) (This rule is currently
49 broken for argp option declarations, for the sake of other kinds of
50 readability. This may change.)
52 If you're editing existing code and it differs from any of the above, stick
53 with whatever the existing code does. Likewise, if in doubt, find similar
54 code and use its style. Maintaining a consistent style is important for
55 general readability, and is more important than any individual point. It's
56 also the easiest way to avoid long and tedious debates about "correct"
60 Facilities and portability
61 --------------------------
63 man-db uses Gnulib to provide portability support and utility functions
64 common to many GNU packages (although man-db is not itself a GNU package),
65 while the lib/ directory provides some other utility functions specific to
66 man-db. Please make use of these facilities where available. In particular,
67 there are various functions beginning with 'x' which check the return values
68 from the system's memory allocation calls, which you should use instead of
69 their non-'x' siblings.
71 appendstr() provides manageable string concatenation. Use it where
72 appropriate. Remember to terminate its argument list with a NULL. In many
73 cases, xasprintf() from Gnulib may be more readable.
75 If you're calling any of the is*() or to*() functions in <ctype.h>, please
76 do so via the CTYPE() macro in include/manconfig.h to ensure that the
77 argument type is correct.
79 You may assume C89 (e.g. no need to support K&R-style function definitions),
80 but please do not assume C99 (e.g. do not use nested functions or //
87 There is a small test suite in src/tests/, as well as basic tests in man/ to
88 ensure that man-db's own manual pages format without errors. Tests for new
89 bug fixes are not *required*, but are generally a good idea.
91 Various test library facilities are available in src/tests/testlib.sh. Feel
92 free to extend this as necessary.
98 docs/TODO has a number of outstanding projects. Things near the bottom are
99 usually more detailed and accurate.
101 The Debian bug tracking system has a number of outstanding reports on man-db
102 at <https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=man-db;ordering=upstream>.
104 Much of the work needed on man-db is for maintainability. Patches that take
105 difficult-to-understand code with hairy memory allocation and replace it
106 with clean, obvious, and reliable code are most welcome, especially if they
107 introduce new abstractions which are of more general use. The replacement of
108 splitline() with the page_description interface is a good example of this.
110 Work on porting to platforms other than GNU/Linux is welcome. It's been a
111 while since serious effort in that direction has been invested in man-db.
112 Most of the code should be quite portable, but the occasional teething
113 problem would not be a surprise.
119 Please send patches in unified diff format (use 'git diff', or GNU diff with
120 the -u option) to man-db-devel@nongnu.org. See
121 https://lists.nongnu.org/mailman/listinfo/man-db-devel for subscription
128 man-db is revision-controlled using git (https://git-scm.com/). The archive
129 may be fetched from here using 'git clone':
131 https://git.savannah.gnu.org/git/man-db.git
133 To browse changes or source code in a web browser, use this URL instead:
135 https://git.savannah.gnu.org/cgit/man-db.git
137 Members of the man-db project on Savannah can commit directly by pushing to
140 ssh://git.sv.gnu.org/srv/git/man-db.git
142 Otherwise, since git is a distributed revision control system, you are of
143 course free to make and publish branches which can then be merged into the
144 main tree. See the git documentation for further details.
146 Generated files should be added to .gitignore and should not be committed to
153 1. Update the AC_INIT version number in configure.ac to "x.y.z-pre1". Commit
156 2. Run ./release.sh to produce a preliminary tarball for translators. This
157 doesn't have to be particularly well-tested or even compile; it's only
158 there to provide context for po/man-db.pot. Send this to the Translation
161 3. Wait a couple of weeks for a reasonable number of translation updates to
162 arrive. During this time, test until your eyeballs fall out, but try to
163 avoid changing any translated messages.
165 4. Ensure that NEWS and docs/man-db.lsm are up to date. Commit.
167 5. Update the AC_INIT version number and 'date' in configure.ac, but don't
170 6. Run ./release.sh, which will spit out a tarball. Test it.
172 7. Commit the changes from step 5.
176 9. Run ./release.sh. This is the distribution tarball; test it as thoroughly
179 10. Upload the tarball to Savannah.
181 11. Announce to wherever seems appropriate.