Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jul 2008 12:05:18 GMT
From:      Anselm Strauss <strauss@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 145359 for review
Message-ID:  <200807171205.m6HC5IVW041768@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=145359

Change 145359 by strauss@strauss_marvelman on 2008/07/17 12:04:34

	Integrated Libarchive 2.5.5

Affected files ...

.. //depot/projects/soc2008/strauss_libarchive/Makefile.am#7 integrate
.. //depot/projects/soc2008/strauss_libarchive/NEWS#6 integrate
.. //depot/projects/soc2008/strauss_libarchive/TODO#10 edit
.. //depot/projects/soc2008/strauss_libarchive/configure.ac#4 integrate
.. //depot/projects/soc2008/strauss_libarchive/cpio/cpio.c#7 integrate
.. //depot/projects/soc2008/strauss_libarchive/libarchive/archive.h#4 integrate
.. //depot/projects/soc2008/strauss_libarchive/tar/write.c#7 integrate
.. //depot/projects/soc2008/strauss_libarchive/version#3 integrate

Differences ...

==== //depot/projects/soc2008/strauss_libarchive/Makefile.am#7 (text+ko) ====


==== //depot/projects/soc2008/strauss_libarchive/NEWS#6 (text+ko) ====

@@ -1,5 +1,10 @@
-Jun 20, 2008: If a -l link fails with EXDEV, copy the file instead
-Jun 19, 2008: Add some additional long options for better GNU cpio compat
+
+Jul 02, 2008: libarchive 2.5.5 released
+
+Jul 02, 2008: libarchive 2.5.5b released
+Jul 01, 2008: bsdcpio is being used by enough people, we can call it 1.0.0 now
+Jun 20, 2008: bsdcpio: If a -l link fails with EXDEV, copy the file instead
+Jun 19, 2008: bsdcpio: additional long options for better GNU cpio compat
 Jun 15, 2008: Many small portability and bugfixes since 2.5.4b.
 
 May 25, 2008: libarchive 2.5.4b released

==== //depot/projects/soc2008/strauss_libarchive/TODO#10 (text+ko) ====

@@ -3,7 +3,6 @@
 
 - Exception handling in ZIP writer
 - Update ZIP writer in docs
-- Integrate Libarchive 2.5.5
 - About the keywords: of course they always change when integrating ...
 - Not all P4 keywords do expand (tested on OS X and FreeBSD)
 
@@ -11,6 +10,7 @@
 Already Done
 ============
 
+- Integrate Libarchive 2.5.5
 - How to enable '-Wall' in gcc when calling make? -> Use 'make CFLAGS="-Wall" ...'
 - Update ZIP writer in headers
 - Build does not work outside source dir

==== //depot/projects/soc2008/strauss_libarchive/configure.ac#4 (text+ko) ====

@@ -4,8 +4,8 @@
 dnl In particular, this allows the version macro to be used in AC_INIT
 
 dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[2.5.4b])
-m4_define([LIBARCHIVE_VERSION_N],[2005004])
+m4_define([LIBARCHIVE_VERSION_S],[2.5.5])
+m4_define([LIBARCHIVE_VERSION_N],[2005005])
 
 dnl bsdtar versioning tracks libarchive
 m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())

==== //depot/projects/soc2008/strauss_libarchive/cpio/cpio.c#7 (ktext) ====

@@ -111,7 +111,8 @@
 	cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
-	/* TODO: If run by root, set owner as well. */
+	if (geteuid() == 0)
+		cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
 	cpio->bytes_per_block = 512;
 	cpio->filename = NULL;
 
@@ -535,17 +536,27 @@
 		fprintf(stderr,"%s", destpath);
 
 	/*
-	 * Obviously, this only gets invoked in pass mode.
+	 * Option_link only makes sense in pass mode and for
+	 * regular files.  Also note: if a link operation fails
+	 * because of cross-device restrictions, we'll fall back
+	 * to copy mode for that entry.
+	 *
+	 * TODO: Test other cpio implementations to see if they
+	 * hard-link anything other than regular files here.
 	 */
-	if (cpio->option_link) {
+	if (cpio->option_link
+	    && archive_entry_filetype(entry) == AE_IFREG)
+	{
 		struct archive_entry *t;
 		/* Save the original entry in case we need it later. */
 		t = archive_entry_clone(entry);
 		if (t == NULL)
 			cpio_errc(1, ENOMEM, "Can't create link");
 		/* Note: link(2) doesn't create parent directories,
-		 * so we use archive_write_header() instead. */
+		 * so we use archive_write_header() instead as a
+		 * convenience. */
 		archive_entry_set_hardlink(t, srcpath);
+		/* This is a straight link that carries no data. */
 		archive_entry_set_size(t, 0);
 		r = archive_write_header(cpio->archive, t);
 		archive_entry_free(t);

==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive.h#4 (ktext) ====

@@ -22,7 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id$ $Change: 144939 $ $DateTime$ $Author$
+ * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.50 2008/05/26 17:00:22 kientzle Exp $
  */
 
 #ifndef ARCHIVE_H_INCLUDED
@@ -112,13 +112,13 @@
  *             (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
  * #endif
  */
-#define	ARCHIVE_VERSION_NUMBER 2005004
+#define	ARCHIVE_VERSION_NUMBER 2005005
 __LA_DECL int		archive_version_number(void);
 
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_STRING "libarchive 2.5.4b"
+#define	ARCHIVE_VERSION_STRING "libarchive 2.5.5"
 __LA_DECL const char *	archive_version_string(void);
 
 #if ARCHIVE_VERSION_NUMBER < 3000000
@@ -471,7 +471,6 @@
 __LA_DECL int		 archive_write_set_format_shar(struct archive *);
 __LA_DECL int		 archive_write_set_format_shar_dump(struct archive *);
 __LA_DECL int		 archive_write_set_format_ustar(struct archive *);
-__LA_DECL int		 archive_write_set_format_zip(struct archive *);
 __LA_DECL int		 archive_write_open(struct archive *, void *,
 		     archive_open_callback *, archive_write_callback *,
 		     archive_close_callback *);

==== //depot/projects/soc2008/strauss_libarchive/tar/write.c#7 (ktext) ====

@@ -139,7 +139,7 @@
 static void		 write_entry_backend(struct bsdtar *, struct archive *,
 			     struct archive_entry *, int);
 static int		 write_file_data(struct bsdtar *, struct archive *,
-			     int fd);
+			     struct archive_entry *, int fd);
 static void		 write_hierarchy(struct bsdtar *, struct archive *,
 			     const char *);
 
@@ -835,7 +835,7 @@
 	 * that case, just skip the write.
 	 */
 	if (e >= ARCHIVE_WARN && fd >= 0 && archive_entry_size(entry) > 0) {
-		if (write_file_data(bsdtar, a, fd))
+		if (write_file_data(bsdtar, a, entry, fd))
 			exit(1);
 		close(fd);
 	}
@@ -956,7 +956,8 @@
 
 /* Helper function to copy file to archive, with stack-allocated buffer. */
 static int
-write_file_data(struct bsdtar *bsdtar, struct archive *a, int fd)
+write_file_data(struct bsdtar *bsdtar, struct archive *a,
+    struct archive_entry *entry, int fd)
 {
 	char	buff[64*1024];
 	ssize_t	bytes_read;
@@ -979,7 +980,8 @@
 		if (bytes_written < bytes_read) {
 			/* Write was truncated; warn but continue. */
 			bsdtar_warnc(bsdtar, 0,
-			    "Truncated write; file may have grown while being archived.");
+			    "%s: Truncated write; file may have grown while being archived.",
+			    archive_entry_pathname(entry));
 			return (0);
 		}
 		progress += bytes_written;

==== //depot/projects/soc2008/strauss_libarchive/version#3 (text+ko) ====

@@ -1,1 +1,1 @@
-2005004b
+2005005



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807171205.m6HC5IVW041768>