[OLUG] stupid question on source files

Chad S. Lauritsen csl at plconline.com
Wed Mar 15 15:23:56 UTC 2000


Kent,

RPM files are binary files. Downloading them in ascii mode will corrupt
them.Keep in mind that RPM files are archives, and archives (with few
exceptions) are always binary files for the sake of compression and efficiency.

The point Eric made about ignoring ascii mode altogether is well taken. Most of
them time it won't make any difference if you download a text file in binary
mode, for a number of different reasons.

The best rule is: when in doubt, use binary mode. If you download a source file
and find out it won't compile because you downloaded it in binary mode, you can
write a quick perl hack to change all of the CRs or CRLFs in LFs and problem
solved.

Example of such a hack:

#!/usr/bin/perl

while(<>) { s/\r\n/\n/g; s/\r/\n/g; print; }

This converts <cr><lf> (DOS/Winblows line termination) to just <lf> (unix line
termination)...then it converts any lone <cr> (Mac line termination) to just
<lf>. This is all that ascii mode in ftp clients does anyway.

ktb wrote:

> I've been trying to download and install XFree86-3.3.6 so I can get my i810
> chipset to work with 'X' on my Redhat side.  I tried the binary rpm and it
> wouldn't update even if "forced."  Got a "can't install" or something, it
> has been a while.  I just figured it was a corrupted file because I kept
> getting knocked off line and it took hours and hours to get the file.
> Anyway I downloaded the source and tried to build that.  I get an error when
> I use "rpm-bl <foo.src.rpm>" to do a list check,
> "File contains non-printable characters ( i ): <foo.src.rpm>"
>
> I think I set ncftp2 to type ascii thinking source files were text.  Maybe
> this has corrupted this file so I can't build it?  When I look at the file
> with 'less' there seems to be binary symbols contained in the file.  Should
> I download an src file in binary format?  When I tried 'rpm --recompile
> <foo.src.rpm>' I just got a prompt back right away with a message that it
> had been created but obviously it hadn't.  I'm using Redhat 6.0.
> Thanks,
> kent
>
> -------------------------------------------------------------------------
> Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/
> To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net`

--
* Chad S. Lauritsen, Systems Administrator                       *
* Perfection Learning Corporation                                *
* 1000 North Second Avenue, Logan, IA 51546 712.644.2831 x 223   *
"Out of the overflow of the heart, the mouth speaks." --Jesus



-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list