This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ar, libapt and hand rolling .debs


Hi,

For all sorts of legacy reasons we build deb packages on rusty old Red
Hat box by hand building control.tar.gz and data.tar.gz and using ar
to create the "archive" that is a deb file.

These packages install fine with dpkg and apt but more recent tools
like synaptic and gdebi complain about "package might be corrupted"
and will refuse to install them. After much digging through the
gdebi/libapt code I discovered the reason libapt doesn't like the
package is that it's AR File handling class can't find the various
expected contents in the archive (debian-archive, contr.. etc).

The reason it fails is a subtle difference in the files output by the
"ar" program, namely the filename fields are terminated with a "/"
instead of a 0x20 " ". While "ar" can quite happily extract the files
from a .deb recreating the .deb with ar will run into this problem
when a libapt based program attempts to process it.

A quick experiment with a hex editor reveals changing the "/" to 0x20
fixes all the issues gdebi and friends have with these ar created
packages.

I had a look through the binutils code to try and figure out why ar
terminates the filenames with "/" and if this was controllable in some
way. It seems like a strange terminating character as I would of
thought it appears in paths. However the ar format is old and crusty
and I noted there is all sorts of hacks for "extended" filenames. In
trying to work out what ar was up to I got lost in a maze of libbfd
re-directions all subtly different. Hence I ask:

1. Is the terminating of filenames with "/" in ar archives a bug or a
   feature?
2. Is there any way to control the termination character from the ar
   command line?
3. Or is it in-fact libapt's AR File implementation that needs
   tweaking?

Regards,

-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]