Small patches for pkg_add

Tim Kientzle kientzle at freebsd.org
Tue Dec 15 18:10:08 UTC 2009


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


More information about the freebsd-current mailing list