Teach md5sum and sha1sum to work the way other applets do so I don't have to
[oweals/busybox.git] / docs / contributing.txt
index d9a7d3d00a615c5173a531e9e4b53e8d1b4ee1bc..aad43035c65a94aa740a1eeda630bd208a60e016 100644 (file)
@@ -5,7 +5,7 @@ This document describes what you need to do to contribute to Busybox, where
 you can help, guidelines on testing, and how to submit a well-formed patch
 that is more likely to be accepted.
 
-The Busybox home page is at: http://busybox.lineo.com
+The Busybox home page is at: http://busybox.net/
 
 
 
@@ -21,14 +21,15 @@ Checkout the Latest Code from CVS
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 This is a necessary first step. Please do not try to work with the last
-released version, as there is a good chance that somebody has already worked
-on the area you had in mind and your patch might already be obsolete.
+released version, as there is a good chance that somebody has already fixed
+the bug you found. Somebody might have even added the feature you had in mind.
+Don't make your work obsolete before you start!
 
 For information on how to check out Busybox from CVS, please look at the
 following links:
 
-       http://oss.lineo.com/cvs_anon.html
-       http://oss.lineo.com/cvs_howto.html
+       http://busybox.net/cvs_anon.html
+       http://busybox.net/cvs_howto.html
 
 
 Read the Mailing List
@@ -42,14 +43,15 @@ know.
 
 Archives can be found here:
 
-       http://opensource.lineo.com/lists/busybox/
+       http://busybox.net/lists/busybox/
 
-If you have a serious interest in Busybox, i.e. you are using it day-to-day or
-as part of an embedded project, it's a good idea to join the mailing list.
+If you have a serious interest in Busybox, i.e., you are using it day-to-day or
+as part of an embedded project, it would be a good idea to join the mailing
+list.
 
 A web-based sign-up form can be found here:
 
-       http://opensource.lineo.com/mailman/listinfo/busybox
+       http://busybox.net/mailman/listinfo/busybox
 
 
 Coordinate with the Applet Maintainer
@@ -58,7 +60,7 @@ Coordinate with the Applet Maintainer
 Some (not all) of the applets in Busybox are "owned" by a maintainer who has
 put significant effort into it and is probably more familiar with it than
 others. To find the maintainer of an applet, look at the top of the .c file
-for a name following the word 'Copyright' or 'Written by'.
+for a name following the word 'Copyright' or 'Written by' or 'Maintainer'.
 
 Before plunging ahead, it's a good idea to send a message to the mailing list
 that says: "Hey, I was thinking about adding the 'transmogrify' feature to the
@@ -71,7 +73,7 @@ Areas Where You Can Help
 ------------------------
 
 Busybox can always use improvement! If you're looking for ways to help, there
-there are a variety of areas where you could help.
+are a variety of areas where you could help.
 
 
 What Busybox Doesn't Need
@@ -84,8 +86,8 @@ Knife" of embedded Linux, there are some applets that will not be accepted:
  - Any filesystem manipulation tools: Busybox is filesystem independent and
    we do not want to start adding mkfs/fsck tools for every (or any)
    filesystem under the sun. (fsck_minix.c and mkfs_minix.c are living on
-   borrowed time.)  There are far too many of these tools out there.  Use
-   the upstream version.  Not everything has to be part of Busybox.
+   borrowed time.) There are far too many of these tools out there.  Use
+   the upstream version. Not everything has to be part of Busybox.
 
  - Any partitioning tools: Partitioning a device is typically done once and
    only once, and tools which do this generally do not need to reside on the
@@ -101,39 +103,49 @@ Knife" of embedded Linux, there are some applets that will not be accepted:
    independent. Do not send us tools that cannot be used across multiple
    platforms / arches.
 
+ - Any daemons that are not essential to basic system operation. To date, only
+   syslogd and klogd meet this requirement. We do not need a web server, an
+   ftp daemon, a dhcp server, a mail transport agent or a dns resolver. If you
+   need one of those, you are welcome to ask the folks on the mailing list for
+   recommendations, but please don't bloat up Busybox with any of these.
+
 
 Bug Reporting
 ~~~~~~~~~~~~~
 
-If you find a bug in Busybox, you can send a bug report to our bug tracking
-system (homepage: http://bugs.lineo.com). Instructions on how to send a bug
-report to the tracking system can be found at:
+If you find bugs, please submit a detailed bug report to the busybox mailing
+list at busybox@busybox.net.  A well-written bug report should include a
+transcript of a shell session that demonstrates the bad behavior and enables
+anyone else to duplicate the bug on their own machine. The following is such
+an example:
 
-       http://bugs.lineo.com/Reporting.html
-       
-The README file that comes with Busybox also describes how to submit a bug.
+    To: busybox@busybox.net
+    From: diligent@testing.linux.org
+    Subject: /bin/date doesn't work
 
-A well-written bug report will include a transcript of a shell session that
-demonstrates the bad behavior and enables anyone else to duplicate the bug on
-their own machine.
+    Package: busybox
+    Version: 1.00
 
+    When I execute Busybox 'date' it produces unexpected results.
+    With GNU date I get the following output:
 
-Bug Triage
-~~~~~~~~~~
+       $ date
+       Wed Mar 21 14:19:41 MST 2001
+
+    But when I use BusyBox date I get this instead:
+
+       $ date
+       llegal instruction
 
-Validating and confirming bugs is nearly as important as reporting them in the
-first place. It is valuable to know if a bug can be duplicated on a different
-machine, on a different filesystem, on a different architecture, with a
-different C library, and so forth.
+    I am using Debian unstable, kernel version 2.4.19-rmk1 on an Netwinder,
+    and the latest uClibc from CVS.  Thanks for the wonderful program!
 
-To see a listing of all the bugs currently filed against Busybox, look here:
+       -Diligent
 
-       http://bugs.lineo.com/db/pa/lbusybox.html
+Note the careful description and use of examples showing not only what BusyBox
+does, but also a counter example showing what an equivalent GNU app does.  Bug
+reports lacking such detail may never be fixed...  Thanks for understanding.
 
-If you have comments to add to a bug (can / can't duplicate, think a bug
-should be closed / reopened), please send it to [bugnumber]@bugs.lineo.com.
-The message you send will automatically be forwarded to the mailing list for
-all to see.
 
 
 Write Documentation
@@ -159,22 +171,12 @@ Consult Existing Sources
 For a quick listing of "needs work" spots in the sources, cd into the Busybox
 directory and run the following:
 
-       for i in TODO FIXME XXX; do grep $i *.[ch]; done
+       for i in TODO FIXME XXX; do find -name '*.[ch]'|xargs grep $i; done
 
 This will show all of the trouble spots or 'questionable' code. Pick a spot,
 any spot, these are all invitations for you to contribute.
 
 
-Consult The Bug-Tracking System
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Head to: http://bugs.lineo.com/db/pa/lBusybox.html and look at the bugs on
-there. Pick one you think you can fix, and fix it. If it's a wishlist item and
-someone's requesting a new feature, take a stab at adding it. Everything
-previously said about "reading the mailing list" and "coordinating with the
-applet maintainer" still applies.
-
-
 Add a New Applet
 ~~~~~~~~~~~~~~~~
 
@@ -197,32 +199,39 @@ Janitorial Work
 
 These are dirty jobs, but somebody's gotta do 'em.
 
- - Converting applets to use getopt() for option processing. Type 'grep -L
-   getopt *.c' to get a listing of the applets that currently don't use
-   getopt. If a .c file processes no options, it should have a line that
+ - Converting applets to use getopt() for option processing. Type 'find -name
+   '*.c'|grep -L getopt' to get a listing of the applets that currently don't
+   use getopt. If a .c file processes no options, it should have a line that
    reads: /* no options, no getopt */ somewhere in the file.
 
+ - Replace any "naked" calls to malloc, calloc, realloc, str[n]dup, fopen with
+   the x* equivalents found in libbb/xfuncs.c.
+
  - Security audits:
-   http://www.securityfocus.com/frames/?content=/forums/secprog/secure-programming.html
+   http://www.securityfocus.com/popups/forums/secprog/intro.shtml
 
  - Synthetic code removal: http://www.perl.com/pub/2000/06/commify.html - This
    is very Perl-specific, but the advice given in here applies equally well to
    C.
 
- - C library funciton use audits: Verifying that functions are being used
+ - C library function use audits: Verifying that functions are being used
    properly (called with the right args), replacing unsafe library functions
    with safer versions, making sure return codes are being checked, etc.
 
  - Where appropriate, replace preprocessor defined macros and values with
    compile-time equivalents.
 
+ - Style guide compliance. See: docs/style-guide.txt
+
+ - Add testcases to tests/testcases.
+
  - Makefile improvements:
    http://www.canb.auug.org.au/~millerp/rmch/recu-make-cons-harm.html
    (I think the recursive problems are pretty much taken care of at this point, non?)
 
  - "Ten Commandments" compliance: (this is a "maybe", certainly not as
    important as any of the previous items.)
-    http://web.onetelnet.ch/~twolf/tw/c/ten_commandments.html
+    http://www.lysator.liu.se/c/ten-commandments.html
 
 Other useful links:
 
@@ -269,7 +278,7 @@ are some guidelines on how to test your changes.
    behavior / output is identical between the two.
 
  - Try several different permutations and combinations of the features you're
-   adding (i.e. different combinations of command-line switches) and make sure
+   adding (i.e., different combinations of command-line switches) and make sure
    they all work; make sure one feature does not interfere with another.
 
  - Make sure you test compiling against the source both with the feature
@@ -284,16 +293,15 @@ are some guidelines on how to test your changes.
 Making Sure Your Patch Doesn't Get Lost
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-If you don't want your patch to be lost or forgotten, send it to the bug
-tracking system (http://bugs.lineo.com). You do this by emailing your patch in
-a message to submit@bugs.lineo.com with a subject line something like this:
+If you don't want your patch to be lost or forgotten, send it to the busybox
+mailing list with a subject line something like this:
 
        [PATCH] - Adds "transmogrify" feature to "foo"
 
 In the body, you should have a pseudo-header that looks like the following:
 
     Package: busybox
-    Version: v0.50pre (or whatever the current version is)
+    Version: v1.01pre (or whatever the current version is)
     Severity: wishlist
 
 The remainder of the body should read along these lines:
@@ -303,10 +311,6 @@ The remainder of the body should read along these lines:
        GNU counterparts and the outputs are identical. I have run the scripts in
        the 'tests' directory and nothing breaks.
 
-Detailed instructions on how to submit a bug to the tracking system are at:
-
-       http://bugs.lineo.com/Reporting.html
-
 
 
 Improving Your Chances of Patch Acceptance
@@ -367,6 +371,15 @@ place in the form of mailing lists, the bug tracking system, and CVS. Please
 use these resources.
 
 
+Send Patches to the Bug Tracking System
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This was mentioned above in the "Making Sure Your Patch Doesn't Get Lost"
+section, but it is worth mentioning again. A patch sent to the mailing list
+might be unnoticed and forgotten. A patch sent to the bug tracking system will
+be stored and closely connected to the bug it fixes.
+
+
 Be Polite
 ~~~~~~~~~
 
@@ -379,6 +392,51 @@ opposite effect.
 
 
 
+Committing Changes to CVS
+-------------------------
+
+If you submit several patches that demonstrate that you are a skilled and wise
+coder, you may be invited to become a committer, thus enabling you to commit
+changes directly to CVS. This is nice because you don't have to wait for
+someone else to commit your change for you, you can just do it yourself.
+
+But note that this is a privilege that comes with some responsibilities. You
+should test your changes before you commit them. You should also talk to an
+applet maintainer before you make any kind of sweeping changes to somebody
+else's code. Big changes should still go to the mailing list first. Remember,
+being wise, polite, and discreet is more important than being clever.
+
+
+When To Commit
+~~~~~~~~~~~~~~
+
+Generally, you should feel free to commit a change if:
+
+ - Your changes are small and don't touch many files
+ - You are fixing a bug
+ - Somebody has told you that it's okay
+ - It's obviously the Right Thing
+
+The more of the above are true, the better it is to just commit a change
+directly to CVS.
+
+
+When Not To Commit
+~~~~~~~~~~~~~~~~~~
+
+Even if you have commit rights, you should probably still post a patch to the
+mailing list if:
+
+ - Your changes are broad and touch many different files
+ - You are adding a feature
+ - Your changes are speculative or experimental (i.e., trying a new algorithm)
+ - You are not the maintainer and your changes make the maintainer cringe
+
+The more of the above are true, the better it is to post a patch to the
+mailing list instead of committing.
+
+
+
 Final Words
 -----------
 
@@ -388,8 +446,4 @@ document don't worry, the folks on the Busybox mailing list are a fairly
 good-natured bunch and will work with you to help get your patches into shape
 or help you make contributions.
 
-If you submit several patches that demonstrate that you are a skilled and wise
-coder, you may be invited to become a committer, thus enabling you to commit
-changes directly to CVS.
-