Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Small patches for pkg_add

0 views
Skip to first unread message

Baptiste Daroussin

unread,
Dec 15, 2009, 10:26:35 AM12/15/09
to freebsd...@freebsd.org
I've written a small patch for pkg_install that removes the system call to tar
in pkg_add command replacing it by some libarchive code.

I'm planning to do some cleanup by time to time sending small patches on
pkg_install. My very first goal is to remove most of the system call, and to
understand the way the code works, not to rewrite everything.

Here is the first patch :
- modification of the unpack function to use libarchive to extract data
- it does not modify the way things works: it does exactly the same thing
without the system call
- I also removed two unused function from lib/file.c

It is my first patch for src, I don't know the good process for that.
Hope to send more patches soon.

This is not another attempt to rewrite pkgtools, I just want to improve them the
time that people working on the different rewrites finish their work.

the patch is join to this mail, or can be found at the following link:
http://etoilebsd.net/~bapt/pkgtools-libarchive-patch1.patch

regards
Bapt

pkgtools-libarchive-patch1.patch

Gavin Atkinson

unread,
Dec 15, 2009, 12:38:01 PM12/15/09
to Baptiste Daroussin, freebsd...@freebsd.org
On Tue, 2009-12-15 at 15:52 +0100, Baptiste Daroussin wrote:
> I've written a small patch for pkg_install that removes the system call to tar
> in pkg_add command replacing it by some libarchive code.

This is great! It's good to see somebody taking this on.

If you get no response within the next day or two, please submit this as
a PR (using either send-pr or the web form) - so that this does not get
lost.

Thanks,

Gavin
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Tim Kientzle

unread,
Dec 15, 2009, 1:10:47 PM12/15/09
to Baptiste Daroussin, freebsd...@freebsd.org
Baptiste Daroussin wrote:
> I've written a small patch for pkg_install that removes the system call to tar
> in pkg_add command replacing it by some libarchive code.

Great!

This looks good, but I have a few suggestions:

You should be a little more careful about error handling.
In particular, after any failure, archive_error_string(a)
will hold an error message that you probably want to
print out for the user's benefit.

In particular, you should print the error message
after a failure of archive_read_open_filename(),
archive_read_extract(), or archive_read_next_header().

You can also simplify slightly by omitting calls to
archive_read_data_skip() (it's never needed).

Tim

0 new messages