From owner-freebsd-current@FreeBSD.ORG Tue Dec 15 18:10:08 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08A1710656A6 for ; Tue, 15 Dec 2009 18:10:08 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id D546D8FC12 for ; Tue, 15 Dec 2009 18:10:07 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id nBFIA9lL031279; Tue, 15 Dec 2009 18:10:09 GMT (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id uwusb2hmzkvs77tr8jd6eavg4a; Tue, 15 Dec 2009 18:10:09 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4B27D11C.50206@freebsd.org> Date: Tue, 15 Dec 2009 10:10:36 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Baptiste Daroussin References: <20091215145243.GF1016@wicklow.lan> In-Reply-To: <20091215145243.GF1016@wicklow.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: Small patches for pkg_add X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 18:10:08 -0000 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