Subject: replacement for bc(1), dc(1), diff(1), and diff(3)
To: None <tech-userlevel@netbsd.org>
From: Igor Sobrado <igor@string1.ciencias.uniovi.es>
List: tech-userlevel
Date: 03/25/2005 17:54:14
Following the advice of Karsten Kruse, I will propose this change
in this mailing list instead of the comp.unix.bsd.netbsd.misc
newsgroup.
My suggestion is replacing bc(1), dc(1), and the diffutils commands
diff(1) and diff3(1) with the OpenBSD ones. sdiff(1) has no
replacement yet, though. I do not know if this command is "required",
if it can be easily replaced, or if it must stay as is. It is not a
licensing issue; in my humble opinion, there are good technical reasons
(i.e., better end-user documentation, clean and well written source code,
and better integration with the operating system source tree) for
importing these commands from OpenBSD:
- Man pages are better written in the OpenBSD versions of those
commands. NetBSD currently only offers a list of options
available for these commands:
bc(1): http://netbsd.gw.com/cgi-bin/man-cgi?bc++NetBSD-current
dc(1): http://netbsd.gw.com/cgi-bin/man-cgi?dc++NetBSD-current
diff(1): http://netbsd.gw.com/cgi-bin/man-cgi?diff++NetBSD-current
diff3(1): http://netbsd.gw.com/cgi-bin/man-cgi?diff3++NetBSD-current
OpenBSD has nice and well organized manual pages, with a clean
organization:
bc(1): http://www.openbsd.org/cgi-bin/man.cgi?query=bc&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
dc(1): http://www.openbsd.org/cgi-bin/man.cgi?query=dc&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
diff(1): http://www.openbsd.org/cgi-bin/man.cgi?query=diff&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
diff3(1): http://www.openbsd.org/cgi-bin/man.cgi?query=diff3&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html
These man pages are much better and describe the behaviour of the
commands, instead of providing a list of options without even a
brief description of the commands.
BTW, patch(1) has a lot of improvements on OpenBSD too. Both
operating systems share the same source code, but fixes to
patch(1) man page really improved it. Perhaps tracking those
fixes would be a good idea.
- Source code is well written and can be easily integrated in the
NetBSD source tree (e.g., src/gnu/dist/diffutils/diffutils2netbsd
is not required).
- bc(1) is a one thousand yacc file, dc(1) requires a two thousand
C file, and four three hundred C files, diff(1) has two five
hundred C files and a one thousand C file, diff3(1) is a five
hundred C file and a small Korn Shell script. All use standard
resources provided in the operating system source code tree
(e.g., bsd.prog.mk). All those commands have a clean an
efficient implementation in OpenBSD.
I see that a new grep(1) command has currently been imported into
src/usr.bin/grep. I hope the best for this effort.
Cheers,
Igor.