PERFORCE change 148992 for review
Ed Schouten
ed at FreeBSD.org
Mon Sep 1 18:29:18 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=148992
Change 148992 by ed at ed_dull on 2008/09/01 18:28:30
IFC.
Affected files ...
.. //depot/projects/mpsafetty/contrib/gcc/config/i386/freebsd64.h#2 integrate
.. //depot/projects/mpsafetty/crypto/openssh/config.h#3 integrate
.. //depot/projects/mpsafetty/crypto/openssh/openbsd-compat/fake-queue.h#2 delete
.. //depot/projects/mpsafetty/crypto/openssh/openbsd-compat/tree.h#2 delete
.. //depot/projects/mpsafetty/gnu/usr.bin/cc/Makefile.tgt#2 integrate
.. //depot/projects/mpsafetty/gnu/usr.bin/cc/cc_tools/Makefile#2 integrate
.. //depot/projects/mpsafetty/gnu/usr.bin/cc/cc_tools/freebsd64-fix.h#2 delete
.. //depot/projects/mpsafetty/lib/libarchive/archive_entry.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/archive_entry.h#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/archive_entry_private.h#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/archive_write_disk.c#4 integrate
.. //depot/projects/mpsafetty/lib/libarchive/archive_write_set_format_by_name.c#3 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/read_open_memory.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_acl_basic.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_acl_pax.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_bad_fd.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_compat_gtar.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_compat_zip.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_empty_write.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_entry.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_compress_program.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_data_large.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_extract.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_ar.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_bin.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_bin_Z.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_bin_bz2.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_bin_gz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_odc.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_empty.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_gtar_gz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_gtar_sparse.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_iso_gz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_isorr_bz2.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_mtree.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_pax_bz2.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_tar.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_tar_empty_filename.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_tbz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_tgz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_tz.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_format_zip.c#3 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_large.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_pax_truncated.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_position.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_read_truncated.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_tar_filenames.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_tar_large.c#3 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_compress.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_compress_program.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_disk.c#4 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_disk_hardlink.c#3 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_disk_perms.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_disk_secure.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_ar.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_cpio.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_cpio_empty.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_cpio_newc.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_cpio_odc.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_shar_empty.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_tar.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_format_tar_empty.c#2 integrate
.. //depot/projects/mpsafetty/lib/libarchive/test/test_write_open_memory.c#2 integrate
.. //depot/projects/mpsafetty/sys/dev/cxgb/ulp/toecore/toedev.c#2 integrate
.. //depot/projects/mpsafetty/sys/fs/msdosfs/msdosfs_fat.c#2 integrate
.. //depot/projects/mpsafetty/sys/kern/vfs_syscalls.c#4 integrate
.. //depot/projects/mpsafetty/sys/net/route.c#4 integrate
.. //depot/projects/mpsafetty/sys/netinet/tcp_offload.c#4 integrate
.. //depot/projects/mpsafetty/sys/netinet/toedev.h#3 integrate
.. //depot/projects/mpsafetty/sys/powerpc/aim/interrupt.c#2 integrate
.. //depot/projects/mpsafetty/sys/powerpc/aim/mmu_oea.c#2 integrate
.. //depot/projects/mpsafetty/tools/tools/cd2dvd/cd2dvd.sh#1 branch
.. //depot/projects/mpsafetty/usr.bin/netstat/inet.c#4 integrate
.. //depot/projects/mpsafetty/usr.bin/netstat/main.c#2 integrate
.. //depot/projects/mpsafetty/usr.bin/netstat/netstat.h#2 integrate
.. //depot/projects/mpsafetty/usr.bin/netstat/route.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/cxgbtool/cxgbtool.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/cxgbtool/reg_defs_t3.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/cxgbtool/reg_defs_t3b.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/cxgbtool/version.h#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/lpr/lpd/recvjob.c#2 integrate
.. //depot/projects/mpsafetty/usr.sbin/syslogd/syslogd.c#3 integrate
Differences ...
==== //depot/projects/mpsafetty/contrib/gcc/config/i386/freebsd64.h#2 (text+ko) ====
@@ -19,11 +19,11 @@
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* $FreeBSD: src/contrib/gcc/config/i386/freebsd64.h,v 1.10 2007/05/19 02:30:20 kan Exp $ */
+/* $FreeBSD: src/contrib/gcc/config/i386/freebsd64.h,v 1.11 2008/08/31 23:38:28 obrien Exp $ */
#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (FreeBSD/x86-64 ELF)");
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/amd64 ELF)");
#undef FBSD_TARGET_CPU_CPP_BUILTINS
#define FBSD_TARGET_CPU_CPP_BUILTINS() \
==== //depot/projects/mpsafetty/crypto/openssh/config.h#3 (text+ko) ====
@@ -1268,10 +1268,10 @@
#define SIZEOF_INT 4
/* The size of `long int', as computed by sizeof. */
-#define SIZEOF_LONG_INT 8
+#define SIZEOF_LONG_INT 4
/* The size of `long long int', as computed by sizeof. */
-#define SIZEOF_LONG_LONG_INT 4
+#define SIZEOF_LONG_LONG_INT 8
/* The size of `short int', as computed by sizeof. */
#define SIZEOF_SHORT_INT 2
==== //depot/projects/mpsafetty/gnu/usr.bin/cc/Makefile.tgt#2 (text+ko) ====
@@ -1,17 +1,20 @@
-# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.11 2007/05/19 04:25:56 kan Exp $
+# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.12 2008/08/31 23:38:28 obrien Exp $
TARGET_ARCH?= ${MACHINE_ARCH}
-.if ${TARGET_ARCH} == "arm"
-GCC_CPU= arm
-.elif ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
+.if ${TARGET_ARCH} == "amd64"
GCC_CPU= i386
-.elif ${TARGET_ARCH} == "ia64"
-TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
-GCC_CPU= ia64
.elif ${TARGET_ARCH} == "powerpc"
GCC_CPU= rs6000
.elif ${TARGET_ARCH} == "sparc64"
GCC_CPU= sparc
+.else
+GCC_CPU= ${TARGET_ARCH}
+.endif
+
+.if ${TARGET_ARCH} == "ia64"
+TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
+.endif
+.if ${TARGET_ARCH} == "sparc64"
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
.endif
==== //depot/projects/mpsafetty/gnu/usr.bin/cc/cc_tools/Makefile#2 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/usr.bin/cc/cc_tools/Makefile,v 1.89 2007/11/18 11:59:44 ache Exp $
+# $FreeBSD: src/gnu/usr.bin/cc/cc_tools/Makefile,v 1.90 2008/08/31 23:38:28 obrien Exp $
.include <bsd.own.mk>
@@ -38,22 +38,25 @@
TARGET_INC+= freebsd-spec.h
TARGET_INC+= freebsd.h
.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
-.if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
+. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
TARGET_INC+= ${GCC_CPU}/sysv4.h
-.endif
+. endif
.endif
.if ${TARGET_ARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/x86-64.h
-TARGET_INC+= ${GCC_CPU}/freebsd.h
-TARGET_INC+= ${GCC_CPU}/freebsd64.h
-TARGET_INC+= freebsd64-fix.h
-.elif ${TARGET_ARCH} == "arm"
+.endif
+.if ${TARGET_ARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/elf.h
+.endif
+.if ${TARGET_ARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/aout.h
+.endif
TARGET_INC+= ${GCC_CPU}/freebsd.h
+.if ${TARGET_ARCH} == "amd64"
+TARGET_INC+= ${GCC_CPU}/freebsd64.h
+.endif
+.if ${TARGET_ARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/arm.h
-.else
-TARGET_INC+= ${GCC_CPU}/freebsd.h
.endif
TARGET_INC+= defaults.h
==== //depot/projects/mpsafetty/lib/libarchive/archive_entry.c#2 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:22 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.53 2008/09/01 04:54:29 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -395,8 +395,7 @@
aes_copy(&entry2->ae_hardlink, &entry->ae_hardlink);
aes_copy(&entry2->ae_pathname, &entry->ae_pathname);
aes_copy(&entry2->ae_symlink, &entry->ae_symlink);
- entry2->ae_hardlinkset = entry->ae_hardlinkset;
- entry2->ae_symlinkset = entry->ae_symlinkset;
+ entry2->ae_set = entry->ae_set;
aes_copy(&entry2->ae_uname, &entry->ae_uname);
/* Copy ACL data over. */
@@ -455,12 +454,24 @@
return (entry->ae_stat.aest_atime_nsec);
}
+int
+archive_entry_atime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_ATIME);
+}
+
time_t
archive_entry_ctime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ctime);
}
+int
+archive_entry_ctime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_CTIME);
+}
+
long
archive_entry_ctime_nsec(struct archive_entry *entry)
{
@@ -562,17 +573,17 @@
const char *
archive_entry_hardlink(struct archive_entry *entry)
{
- if (!entry->ae_hardlinkset)
- return (NULL);
- return (aes_get_mbs(&entry->ae_hardlink));
+ if (entry->ae_set & AE_SET_HARDLINK)
+ return (aes_get_mbs(&entry->ae_hardlink));
+ return (NULL);
}
const wchar_t *
archive_entry_hardlink_w(struct archive_entry *entry)
{
- if (!entry->ae_hardlinkset)
- return (NULL);
- return (aes_get_wcs(&entry->ae_hardlink));
+ if (entry->ae_set & AE_SET_HARDLINK)
+ return (aes_get_wcs(&entry->ae_hardlink));
+ return (NULL);
}
ino_t
@@ -599,6 +610,12 @@
return (entry->ae_stat.aest_mtime_nsec);
}
+int
+archive_entry_mtime_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_MTIME);
+}
+
unsigned int
archive_entry_nlink(struct archive_entry *entry)
{
@@ -651,6 +668,12 @@
return (entry->ae_stat.aest_size);
}
+int
+archive_entry_size_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_SIZE);
+}
+
const char *
archive_entry_sourcepath(struct archive_entry *entry)
{
@@ -660,17 +683,17 @@
const char *
archive_entry_symlink(struct archive_entry *entry)
{
- if (!entry->ae_symlinkset)
- return (NULL);
- return (aes_get_mbs(&entry->ae_symlink));
+ if (entry->ae_set & AE_SET_SYMLINK)
+ return (aes_get_mbs(&entry->ae_symlink));
+ return (NULL);
}
const wchar_t *
archive_entry_symlink_w(struct archive_entry *entry)
{
- if (!entry->ae_symlinkset)
- return (NULL);
- return (aes_get_wcs(&entry->ae_symlink));
+ if (entry->ae_set & AE_SET_SYMLINK)
+ return (aes_get_wcs(&entry->ae_symlink));
+ return (NULL);
}
uid_t
@@ -773,7 +796,9 @@
{
aes_set_mbs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
}
void
@@ -781,7 +806,9 @@
{
aes_copy_mbs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
}
void
@@ -789,26 +816,44 @@
{
aes_copy_wcs(&entry->ae_hardlink, target);
if (target != NULL)
- entry->ae_hardlinkset = 1;
+ entry->ae_set |= AE_SET_HARDLINK;
+ else
+ entry->ae_set &= ~AE_SET_HARDLINK;
}
void
archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_ATIME;
entry->ae_stat.aest_atime = t;
entry->ae_stat.aest_atime_nsec = ns;
}
void
+archive_entry_unset_atime(struct archive_entry *entry)
+{
+ archive_entry_set_atime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_ATIME;
+}
+
+void
archive_entry_set_ctime(struct archive_entry *entry, time_t t, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_CTIME;
entry->ae_stat.aest_ctime = t;
entry->ae_stat.aest_ctime_nsec = ns;
}
void
+archive_entry_unset_ctime(struct archive_entry *entry)
+{
+ archive_entry_set_ctime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_CTIME;
+}
+
+void
archive_entry_set_dev(struct archive_entry *entry, dev_t d)
{
entry->stat_valid = 0;
@@ -836,7 +881,7 @@
void
archive_entry_set_link(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_set_mbs(&entry->ae_symlink, target);
else
aes_set_mbs(&entry->ae_hardlink, target);
@@ -846,7 +891,7 @@
void
archive_entry_copy_link(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_copy_mbs(&entry->ae_symlink, target);
else
aes_copy_mbs(&entry->ae_hardlink, target);
@@ -856,7 +901,7 @@
void
archive_entry_copy_link_w(struct archive_entry *entry, const wchar_t *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
aes_copy_wcs(&entry->ae_symlink, target);
else
aes_copy_wcs(&entry->ae_hardlink, target);
@@ -865,7 +910,7 @@
int
archive_entry_update_link_utf8(struct archive_entry *entry, const char *target)
{
- if (entry->ae_symlinkset)
+ if (entry->ae_set & AE_SET_SYMLINK)
return (aes_update_utf8(&entry->ae_symlink, target));
else
return (aes_update_utf8(&entry->ae_hardlink, target));
@@ -882,11 +927,19 @@
archive_entry_set_mtime(struct archive_entry *entry, time_t m, long ns)
{
entry->stat_valid = 0;
+ entry->ae_set |= AE_SET_MTIME;
entry->ae_stat.aest_mtime = m;
entry->ae_stat.aest_mtime_nsec = ns;
}
void
+archive_entry_unset_mtime(struct archive_entry *entry)
+{
+ archive_entry_set_mtime(entry, 0, 0);
+ entry->ae_set &= ~AE_SET_MTIME;
+}
+
+void
archive_entry_set_nlink(struct archive_entry *entry, unsigned int nlink)
{
entry->stat_valid = 0;
@@ -954,9 +1007,17 @@
{
entry->stat_valid = 0;
entry->ae_stat.aest_size = s;
+ entry->ae_set |= AE_SET_SIZE;
}
void
+archive_entry_unset_size(struct archive_entry *entry)
+{
+ archive_entry_set_size(entry, 0);
+ entry->ae_set &= ~AE_SET_SIZE;
+}
+
+void
archive_entry_copy_sourcepath(struct archive_entry *entry, const char *path)
{
aes_set_mbs(&entry->ae_sourcepath, path);
@@ -967,7 +1028,9 @@
{
aes_set_mbs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
}
void
@@ -975,7 +1038,9 @@
{
aes_copy_mbs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
}
void
@@ -983,7 +1048,9 @@
{
aes_copy_wcs(&entry->ae_symlink, linkname);
if (linkname != NULL)
- entry->ae_symlinkset = 1;
+ entry->ae_set |= AE_SET_SYMLINK;
+ else
+ entry->ae_set &= ~AE_SET_SYMLINK;
}
void
==== //depot/projects/mpsafetty/lib/libarchive/archive_entry.h#2 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -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.
*
- * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.27 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.28 2008/09/01 04:54:29 kientzle Exp $
*/
#ifndef ARCHIVE_ENTRY_H_INCLUDED
@@ -152,12 +152,29 @@
/*
* Retrieve fields from an archive_entry.
+ *
+ * There are a number of implicit conversions among these fields. For
+ * example, if a regular string field is set and you read the _w wide
+ * character field, the entry will implicitly convert narrow-to-wide
+ * using the current locale. Similarly, dev values are automatically
+ * updated when you write devmajor or devminor and vice versa.
+ *
+ * In addition, fields can be "set" or "unset." Unset string fields
+ * return NULL, non-string fields have _is_set() functions to test
+ * whether they've been set. You can "unset" a string field by
+ * assigning NULL; non-string fields have _unset() functions to
+ * unset them.
+ *
+ * Note: There is one ambiguity in the above; string fields will
+ * also return NULL when implicit character set conversions fail.
+ * This is usually what you want.
*/
-
__LA_DECL time_t archive_entry_atime(struct archive_entry *);
__LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
__LA_DECL time_t archive_entry_ctime(struct archive_entry *);
__LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
__LA_DECL dev_t archive_entry_dev(struct archive_entry *);
__LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
@@ -175,6 +192,7 @@
__LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *);
__LA_DECL time_t archive_entry_mtime(struct archive_entry *);
__LA_DECL long archive_entry_mtime_nsec(struct archive_entry *);
+__LA_DECL int archive_entry_mtime_is_set(struct archive_entry *);
__LA_DECL unsigned int archive_entry_nlink(struct archive_entry *);
__LA_DECL const char *archive_entry_pathname(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
@@ -183,6 +201,7 @@
__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
__LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
__LA_DECL int64_t archive_entry_size(struct archive_entry *);
+__LA_DECL int archive_entry_size_is_set(struct archive_entry *);
__LA_DECL const char *archive_entry_strmode(struct archive_entry *);
__LA_DECL const char *archive_entry_symlink(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
@@ -195,10 +214,16 @@
*
* Note that string 'set' functions do not copy the string, only the pointer.
* In contrast, 'copy' functions do copy the object pointed to.
+ *
+ * Note: As of libarchive 2.4, 'set' functions do copy the string and
+ * are therefore exact synonyms for the 'copy' versions. The 'copy'
+ * names will be retired in libarchive 3.0.
*/
__LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_atime(struct archive_entry *);
__LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
__LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
@@ -226,6 +251,7 @@
__LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
__LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
__LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
__LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *);
@@ -236,6 +262,7 @@
__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
__LA_DECL void archive_entry_set_size(struct archive_entry *, int64_t);
+__LA_DECL void archive_entry_unset_size(struct archive_entry *);
__LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
@@ -257,6 +284,7 @@
__LA_DECL const struct stat *archive_entry_stat(struct archive_entry *);
__LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
+
/*
* ACL routines. This used to simply store and return text-format ACL
* strings, but that proved insufficient for a number of reasons:
==== //depot/projects/mpsafetty/lib/libarchive/archive_entry_private.h#2 (text+ko) ====
@@ -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.
*
- * $FreeBSD: src/lib/libarchive/archive_entry_private.h,v 1.4 2008/05/26 17:00:22 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_entry_private.h,v 1.5 2008/09/01 04:54:29 kientzle Exp $
*/
#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
@@ -136,6 +136,14 @@
dev_t aest_rdevminor;
} ae_stat;
+ int ae_set; /* bitmap of fields that are currently set */
+#define AE_SET_HARDLINK 1
+#define AE_SET_SYMLINK 2
+#define AE_SET_ATIME 4
+#define AE_SET_CTIME 8
+#define AE_SET_MTIME 16
+#define AE_SET_SIZE 64
+
/*
* Use aes here so that we get transparent mbs<->wcs conversions.
*/
@@ -147,8 +155,6 @@
struct aes ae_pathname; /* Name of entry */
struct aes ae_symlink; /* symlink contents */
struct aes ae_uname; /* Name of owner */
- unsigned char ae_hardlinkset;
- unsigned char ae_symlinkset;
/* Not used within libarchive; useful for some clients. */
struct aes ae_sourcepath; /* Path this entry is sourced from. */
==== //depot/projects/mpsafetty/lib/libarchive/archive_write_disk.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.32 2008/08/28 06:40:22 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.33 2008/09/01 02:50:24 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -140,6 +140,7 @@
uid_t user_uid;
dev_t skip_file_dev;
ino_t skip_file_ino;
+ time_t start_time;
gid_t (*lookup_gid)(void *private, const char *gname, gid_t gid);
void (*cleanup_gid)(void *private);
@@ -445,6 +446,8 @@
fe->mtime_nanos = archive_entry_mtime_nsec(entry);
fe->atime = archive_entry_atime(entry);
fe->atime_nanos = archive_entry_atime_nsec(entry);
+ if (fe->atime == 0 && fe->atime_nanos == 0)
+ fe->atime = a->start_time;
}
if (a->deferred & TODO_FFLAGS) {
@@ -720,6 +723,7 @@
a->archive.vtable = archive_write_disk_vtable();
a->lookup_uid = trivial_lookup_uid;
a->lookup_gid = trivial_lookup_gid;
+ a->start_time = time(NULL);
#ifdef HAVE_GETEUID
a->user_uid = geteuid();
#endif /* HAVE_GETEUID */
@@ -1625,11 +1629,13 @@
times[0].tv_sec = archive_entry_atime(a->entry);
times[0].tv_usec = archive_entry_atime_nsec(a->entry) / 1000;
- /* If no atime was specified, use mtime instead. */
- if (times[0].tv_sec == 0 && times[0].tv_usec == 0) {
- times[0].tv_sec = times[1].tv_sec;
- times[0].tv_usec = times[1].tv_usec;
- }
+ /* If no atime was specified, use start time instead. */
+ /* In theory, it would be marginally more correct to use
+ * time(NULL) here, but that would cost us an extra syscall
+ * for little gain. */
+ if (times[0].tv_sec == 0 && times[0].tv_usec == 0)
+ times[0].tv_sec = a->start_time;
+
#ifdef HAVE_FUTIMES
if (a->fd >= 0 && futimes(a->fd, times) == 0) {
return (ARCHIVE_OK);
@@ -1668,6 +1674,8 @@
times.modtime = archive_entry_mtime(a->entry);
times.actime = archive_entry_atime(a->entry);
+ if (times.actime == 0)
+ times.actime = a->start_time;
if (!S_ISLNK(a->mode) && utime(a->name, ×) != 0) {
archive_set_error(&a->archive, errno,
"Can't update time for %s", a->name);
==== //depot/projects/mpsafetty/lib/libarchive/archive_write_set_format_by_name.c#3 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_by_name.c,v 1.8 2008/08/31 07:21:46 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_by_name.c,v 1.9 2008/09/01 02:50:53 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -44,8 +44,8 @@
static
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
+ { "ar", archive_write_set_format_ar_bsd },
{ "arbsd", archive_write_set_format_ar_bsd },
- { "ar", archive_write_set_format_ar_bsd },
{ "argnu", archive_write_set_format_ar_svr4 },
{ "arsvr4", archive_write_set_format_ar_svr4 },
{ "cpio", archive_write_set_format_cpio },
==== //depot/projects/mpsafetty/lib/libarchive/test/read_open_memory.c#2 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/read_open_memory.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/read_open_memory.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
#include <errno.h>
#include <stdlib.h>
@@ -48,7 +48,7 @@
static int memory_read_close(struct archive *, void *);
static int memory_read_open(struct archive *, void *);
-#if ARCHIVE_API_VERSION < 2
+#if ARCHIVE_VERSION_NUMBER < 2000000
static ssize_t memory_read_skip(struct archive *, void *, size_t request);
#else
static off_t memory_read_skip(struct archive *, void *, off_t request);
@@ -113,7 +113,7 @@
/*
* How mean can a skip() routine be? Let's try to find out.
*/
-#if ARCHIVE_API_VERSION < 2
+#if ARCHIVE_VERSION_NUMBER < 2000000
static ssize_t
memory_read_skip(struct archive *a, void *client_data, size_t skip)
#else
==== //depot/projects/mpsafetty/lib/libarchive/test/test_acl_basic.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.4 2007/07/06 15:43:11 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.5 2008/09/01 05:38:33 kientzle Exp $");
/*
* Exercise the system-independent portion of the ACL support.
@@ -165,7 +165,7 @@
assert(matched == 1);
}
}
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Known broken before 1.9.0. */
skipping("archive_entry_acl_next() exits with ARCHIVE_EOF");
#else
==== //depot/projects/mpsafetty/lib/libarchive/test/test_acl_pax.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_pax.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_pax.c,v 1.6 2008/09/01 05:38:33 kientzle Exp $");
/*
* Exercise the system-independent portion of the ACL support.
@@ -386,7 +386,7 @@
assert(matched == 1);
}
}
-#if ARCHIVE_VERSION_STAMP < 1009000
+#if ARCHIVE_VERSION_NUMBER < 1009000
/* Known broken before 1.9.0. */
skipping("archive_entry_acl_next() exits with ARCHIVE_EOF");
#else
@@ -446,10 +446,10 @@
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
#endif
/* Write out the data we generated to a file for manual inspection. */
@@ -509,9 +509,9 @@
/* Close the archive. */
assertA(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
#else
- archive_read_finish(a);
+ assertA(0 == archive_read_finish(a));
#endif
}
==== //depot/projects/mpsafetty/lib/libarchive/test/test_bad_fd.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/* Verify that attempting to open an invalid fd returns correct error. */
DEFINE_TEST(test_bad_fd)
@@ -33,9 +33,9 @@
assertA(0 == archive_read_support_compression_all(a));
assertA(ARCHIVE_FATAL == archive_read_open_fd(a, -1, 1024));
assertA(0 == archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
- assert(0 == archive_read_finish(a));
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
#else
- archive_read_finish(a);
+ assertA(0 == archive_read_finish(a));
#endif
}
==== //depot/projects/mpsafetty/lib/libarchive/test/test_compat_gtar.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
/*
* Verify our ability to read sample files created by GNU tar.
@@ -94,10 +94,10 @@
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
- archive_read_finish(a);
#endif
}
==== //depot/projects/mpsafetty/lib/libarchive/test/test_compat_zip.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_zip.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_zip.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
/* Copy this function for each test file and adjust it accordingly. */
static void
@@ -53,10 +53,10 @@
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ZIP);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_read_finish(a);
+#else
assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#else
- archive_read_finish(a);
#endif
}
==== //depot/projects/mpsafetty/lib/libarchive/test/test_empty_write.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_empty_write.c,v 1.2 2008/03/15 11:06:15 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_empty_write.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
DEFINE_TEST(test_empty_write)
{
@@ -55,13 +55,12 @@
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
#endif
-
/*
* Again, with bzip2 compression.
*/
@@ -84,10 +83,10 @@
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
#endif
@@ -113,9 +112,9 @@
/* Close out the archive. */
assertA(0 == archive_write_close(a));
-#if ARCHIVE_API_VERSION > 1
+#if ARCHIVE_VERSION_NUMBER < 2000000
+ archive_write_finish(a);
+#else
assertA(0 == archive_write_finish(a));
-#else
- archive_write_finish(a);
#endif
}
==== //depot/projects/mpsafetty/lib/libarchive/test/test_entry.c#2 (text+ko) ====
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry.c,v 1.6 2008/05/26 17:00:24 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry.c,v 1.8 2008/09/01 05:38:33 kientzle Exp $");
#include <locale.h>
@@ -69,15 +69,26 @@
* The following tests are ordered alphabetically by the
* name of the field.
*/
+
/* atime */
archive_entry_set_atime(e, 13579, 24680);
assertEqualInt(archive_entry_atime(e), 13579);
assertEqualInt(archive_entry_atime_nsec(e), 24680);
+ archive_entry_unset_atime(e);
+ assertEqualInt(archive_entry_atime(e), 0);
+ assertEqualInt(archive_entry_atime_nsec(e), 0);
+ assert(!archive_entry_atime_is_set(e));
+
/* ctime */
archive_entry_set_ctime(e, 13580, 24681);
assertEqualInt(archive_entry_ctime(e), 13580);
assertEqualInt(archive_entry_ctime_nsec(e), 24681);
-#if ARCHIVE_VERSION_STAMP >= 1009000
+ archive_entry_unset_ctime(e);
+ assertEqualInt(archive_entry_ctime(e), 0);
+ assertEqualInt(archive_entry_ctime_nsec(e), 0);
+ assert(!archive_entry_ctime_is_set(e));
+
+#if ARCHIVE_VERSION_NUMBER >= 1009000
/* dev */
archive_entry_set_dev(e, 235);
assertEqualInt(archive_entry_dev(e), 235);
@@ -85,17 +96,21 @@
skipping("archive_entry_dev()");
#endif
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list