Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Aug 1996 11:55:01 -0400
From:      Gary Chrysler <tcg@ime.net>
To:        Don Yuniskis <dgy@rtd.com>
Cc:        fqueries@jraynard.demon.co.uk, questions@freebsd.org
Subject:   Re: perhaps i am just stupid.
Message-ID:  <3208BC55.124F@ime.net>
References:  <199608071139.EAA17578@seagull.rtd.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Don Yuniskis wrote:

There *must* be some major confusion between us!

> 
> It seems that Gary Chrysler said:
> 
> [snip -- too much history here!  :>]
> 

Agreed!

> Argh!  I had assumed there was a cksum.exe   I'll look into booting
> DOS and compiling it...

No there isn't .. Especially one that outputs the EXACT same output
that FreeBSD's cksum outputs.. They must AGREE 100% ie: The output
must be exactly the same else comp will fail!

I probably already ported cksum. I'll have to go look! I borrowed
the crc code for a PtoP network file transfer package I wrote. :)

Also Unix \n versus Dos's \r\n must be accounted for!
comp will fail over this!

(This could easliy be done by the creator of checksum.sum at
 FreeBSD just by running a unix2dos script on it!
 I happen to have two lovly perl scripts that do this both ways!
 Thanks to  Brian Clapper <bmc@telebase.com>.)

> > So, Why waste time doing both.. a Dos based cksum compatiable with
> > FreeBSD's cksum's output as well as a kludge'y batch file!
> > It would be just as easy to whip up a dos based program that
> > read the *.sum files and compared them to the files on the fly!
> 
> I would advocate *against* modifying the code for this.  Put that
> functionality into a .BAT file wrapper.  This allows someone
> already knowledgable in cksum(1) to modify the BAT file without
> having to learn some bogus *new* MyCksum program.  Also cuts down
> on the maintenance of yet another piece of software (and, is more
> in tune with the UNIX philosophy of building with existing tools).

I'll buy that!
But, Um, We are talking about the Dos side! The unix side is
already doable! For both, The creation of checksum.sum for dos
systems, And for testing such files on a Unix system.

> It hardly seems worth any "performance increase" to replace DOS's
> batch file interpretter with hardcoded system("cksum.exe")

Likly wouldn't be much performance difference!
Just a whole lot smarter!

> 
> >          cksum %1.?? > %1.tmp
> >          comp %1.sum %1.tmp
> >
> > I belive this is what you meant. (That is if all the binarys have a
> >  two digit extension)
> 
> But, it will hose you if foo.xx exists, etc.

I would hope that foo.xx exists since that is the file that is
to be checked sum'd against the checksum.sum created by FreeBSD.org

cksum foo.xx > foo.tmp

In plain english:
    send cksum of foo.xx to file foo.tmp (Overwrite if exist)

> 
> >       cksum %1.* > %1.tmp
> > Would cause the .tmp and .sum to be cksum'ed.
> >
> >       cksum %1.0* > %1.tmp
> > Whats the      ^.. for??
> 
> So the .tmp and .sum would NOT be cksum'ed!  :>

And how is this to stop that??
	foo.0* means any foo.0xx
Where xx means anything or nothing.

> 
> > > Briefly, this cksums all files in a given group (bin.*, sbin.*, etc.)

This will cksum only bin.0*, sbin.0* not bin.* or sbin.*.
AFAIK those *.0* files don't exist, AFAIK they are named:
	bin.aa
	bin.ab
	...

> > > *except* for the ".sum" file and the ".tmp" file of the same name
> > > (e.g., bin.sum and bin.tmp -- DOS creates bin.tmp to catch the output
> > > of the cksum command.  But, if you said 'cksum %1.* > %1.tmp', DOS
> > > would pass %1.tmp to cksum, too!  :-(   Now, you have %1.tmp holding

Who said anything about 'cksum %1.*' ??
I didn't. I said 'cksum %1.??' There is a huge difference!
Of course this will cause a problem if the files ever go beyond
a 2 digit extension.. I don't see that happening.
Still have numeric values if zz is reached.
(I don't know what they are up to though)

> > > the computed checksums for all of the %1.0* files.  Presumably,
> > > %1.sum (e.g., bin.sum) would already contain the checksums for these
> > > files -- because they were computed in the same way from the
> > > *originals* at freebsd.org.  Then, 'comp' (roughly the equivalent
> > > of cmp(1)) just does a compare between the two files.
> >
> > I don't understand where you get the .0* from..
> 
> See above  (Uh, d'uh....)  :>

Uh, d'uh What??

I still don't understand where you get the .0* from.
	%1.0* would result in foo.0xx
where xx is anything or nothing!

Like I said at the very begining of this message!
We must be on two totally different wavelengths. :)

-Enjoy
Gary
~~~~~~~~~~~~~~~~
Improve America's Knowledge... Share yours
The Borg... Where minds meet
(207) 929-3848



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3208BC55.124F>