Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2009 18:10:57 +0200
From:      Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
To:        Gabor Kovesdan <gabor@FreeBSD.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: RFC: Replacing bc/dc to BSDL versions
Message-ID:  <20090626161057.GA47554@wep4035.physik.uni-wuerzburg.de>
In-Reply-To: <4A407CB1.2060107@FreeBSD.org>
References:  <4A246C4D.6080409@FreeBSD.org> <4A407CB1.2060107@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 23, 2009 at 08:56:49AM +0200, Gabor Kovesdan wrote:
> Gabor Kovesdan escribi=F3:
>> Hello,
>>
>> as you might know, I'm working on a BSDL grep. It isn't totally ready =20
>> yet, because there are compatibility issues, which I have to resolve. =20
>> But looking at another BSDL tools, I've found out that OpenBSD has =20
>> BSDL bc and dc utilities. I've thought of replacing them. I think in =20
>> the bc/dc case, such a strict GNU compatibility isn't necessary as in =20
>> the case of grep, so we may replace them in base system. If there's no  =

>> objection to replacing them, I'll post a patch for review.
> Thanks for all your input. It took a while because of other priorities =20
> but I've made some tests concerning BSDL bc/dc. I've made a complete =20
> buildworld and tried mergemaster, which worked fine. I've also checked =20
> the GNU regression tests comparing the two versions. There's little =20
> difference. The speed is varying, sometimes GNU is faster, sometimes the =
=20
> BSDL versions. The accuracy seems to be the same up to 18 digits after =20
> the decimal point. I've also checked the OpenBSD regression tests found  =

> only one case, which didn't work but these tests seem to be specific for =
=20
> BSDL bc/dc as they don't really work with the GNU version.
>
> I've made a patch, which doesn't remove GNU bc/dc yet, just detaches =20
> them from the build so that in case of a regression we can easily revert =
=20
> while the problem is fixed:
> http://kovesdan.org/patches/bcdc.diff
>
Thanks!
I'm running the system with BSD bc/dc now.
The only small thing I've noticed is:

~> dc -h
dc: invalid option -- h
usage: dc [-hVx] [-e expression] [file]
~> dc --help
usage: dc [-hVx] [-e expression] [file]

This seems to come from this line in dc.c:

+       /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
+       while ((ch =3D getopt=5Flong(argc, argv, "e:f:Vx", long=5Foptions, =
NULL)) !=3D -1) {

Possibly one should just use "e:f:Vhx"?
Otherwise looks good, I'm using dc from time to time.

Alexey.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090626161057.GA47554>