From owner-cvs-all@FreeBSD.ORG Thu Jan 31 08:11:02 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3750516A41A; Thu, 31 Jan 2008 08:11:02 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1ECF013C45B; Thu, 31 Jan 2008 08:11:02 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0V8B20T082193; Thu, 31 Jan 2008 08:11:02 GMT (envelope-from kaiw@repoman.freebsd.org) Received: (from kaiw@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0V8B1vu082192; Thu, 31 Jan 2008 08:11:01 GMT (envelope-from kaiw) Message-Id: <200801310811.m0V8B1vu082192@repoman.freebsd.org> From: Kai Wang Date: Thu, 31 Jan 2008 08:11:01 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libarchive archive_write_set_format_ar.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2008 08:11:02 -0000 kaiw 2008-01-31 08:11:01 UTC FreeBSD src repository Modified files: lib/libarchive archive_write_set_format_ar.c Log: Add hook routine archive_write_ar_finish() which writes the 'ar' global header if nothing else has been written before the closing of the archive. This will change the behaviour when creating archives without members, i.e., instead of generating a 0-size archive file, an archive with just the global header (8 bytes in total) will be created and it is indeed a valid archive by the definition of libarchive, thus subsequent operation on this archive will be accepted. This especially solves the failure caused by following sequence: (several ports do) % ar cru libfoo.a # without specifying obj files % ranlib libfoo.a Reviewed by: kientzle, jkoshy Approved by: kientzle Approved by: jkoshy (mentor) Reported by: erwin MFC after: 1 month Revision Changes Path 1.5 +19 -1 src/lib/libarchive/archive_write_set_format_ar.c