[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[FILE] : Busybox ar command, to unpack debs



The attached ar.c file can be included in busybox to enable "ar"
archives to be unpacked.
Seems debs are really ar.tar.gz we should now be able to unpack deb's
from busybox alone.

This is still pretty rough, all it does is accept the file to unpack as
a paramater, it then lists the files details to the screen as it unpacks
it to the current directory.

It shouldnt break, but still lots of things to do to it, like check
before overwriting file, extract to dir, list contents only etc, but
this is just my first go.

I created a function copySubFile(sourceFileDescriptor,
destinationFiledescriptor, size) that coppies the specified amout of
data from the current position of one filedescriptor to a second one, i
thought something like this could be used as a common function, it could
be used by ar, tar, cp_mv, maybe others i dont know.

My c programming skills are(were) a bit rusty, so any feedback most
welcome.

Bloody segfaults took me ages to fix... mongrels ! 


To try it you will have to link it to busybox manually, its 5am here,
ill send a proper patch next time.


Glenn

Attachment: ar.c.gz
Description: Binary data


Reply to: