PERFORCE change 48681 for review

Marcel Moolenaar marcel at FreeBSD.org
Wed Mar 10 21:54:00 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=48681

Change 48681 by marcel at marcel_nfs on 2004/03/10 21:53:13

	IFC @48671
	LINT compiles on i386.

Affected files ...

.. //depot/projects/gdb/Makefile.inc1#4 integrate
.. //depot/projects/gdb/UPDATING#5 integrate
.. //depot/projects/gdb/UPDATING.64BTT#2 integrate
.. //depot/projects/gdb/bin/df/df.c#4 integrate
.. //depot/projects/gdb/etc/group#3 integrate
.. //depot/projects/gdb/etc/inetd.conf#3 integrate
.. //depot/projects/gdb/etc/rc.d/initdiskless#3 integrate
.. //depot/projects/gdb/lib/Makefile#4 integrate
.. //depot/projects/gdb/lib/libarchive/Makefile#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive.h#3 integrate
.. //depot/projects/gdb/lib/libarchive/archive_check_magic.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_entry.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_platform.h#1 branch
.. //depot/projects/gdb/lib/libarchive/archive_private.h#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_data_into_buffer.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_data_into_fd.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_extract.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_open_file.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_all.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_bzip2.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_gzip.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_compression_none.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_format_all.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_format_cpio.c#3 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_format_gnutar.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_read_support_format_tar.c#3 integrate
.. //depot/projects/gdb/lib/libarchive/archive_string.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_string_sprintf.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_util.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_open_file.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_bzip2.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_gzip.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_compression_none.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format_by_name.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format_cpio.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format_pax.c#3 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format_shar.c#3 integrate
.. //depot/projects/gdb/lib/libarchive/archive_write_set_format_ustar.c#3 integrate
.. //depot/projects/gdb/lib/libc/stdio/fgetln.c#2 integrate
.. //depot/projects/gdb/lib/libc/stdio/fputc.c#2 integrate
.. //depot/projects/gdb/lib/libc/stdio/getchar.c#2 integrate
.. //depot/projects/gdb/lib/libc/stdio/puts.c#2 integrate
.. //depot/projects/gdb/lib/libc/stdio/ungetc.c#2 integrate
.. //depot/projects/gdb/lib/libgeom/geom_xml2tree.c#3 integrate
.. //depot/projects/gdb/lib/libgeom/libgeom.h#2 integrate
.. //depot/projects/gdb/sbin/gconcat/gconcat.c#3 integrate
.. //depot/projects/gdb/sbin/ifconfig/ifconfig.c#4 integrate
.. //depot/projects/gdb/sbin/mdconfig/mdconfig.8#3 integrate
.. //depot/projects/gdb/sbin/mdconfig/mdconfig.c#2 integrate
.. //depot/projects/gdb/share/man/man4/Makefile#5 integrate
.. //depot/projects/gdb/share/man/man4/ng_eiface.4#1 branch
.. //depot/projects/gdb/share/man/man5/Makefile#3 integrate
.. //depot/projects/gdb/share/man/man5/newsyslog.conf.5#1 branch
.. //depot/projects/gdb/share/man/man9/Makefile#4 integrate
.. //depot/projects/gdb/share/man/man9/condvar.9#2 integrate
.. //depot/projects/gdb/share/termcap/termcap.src#3 integrate
.. //depot/projects/gdb/sys/amd64/amd64/trap.c#5 integrate
.. //depot/projects/gdb/sys/compat/ndis/subr_ndis.c#4 integrate
.. //depot/projects/gdb/sys/compat/ndis/subr_ntoskrnl.c#5 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/if_pflog.c#2 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/if_pfsync.c#2 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/pf_ioctl.c#2 integrate
.. //depot/projects/gdb/sys/dev/acpica/acpi.c#4 integrate
.. //depot/projects/gdb/sys/dev/acpica/acpivar.h#4 integrate
.. //depot/projects/gdb/sys/dev/advansys/advmcode.h#2 integrate
.. //depot/projects/gdb/sys/dev/hifn/hifn7751reg.h#2 integrate
.. //depot/projects/gdb/sys/dev/if_ndis/if_ndis_pccard.c#2 integrate
.. //depot/projects/gdb/sys/dev/if_ndis/if_ndis_pci.c#2 integrate
.. //depot/projects/gdb/sys/dev/md/md.c#3 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm.c#3 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_attach.c#2 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_intr.c#2 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_ioctl.c#2 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_rtables.c#2 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_rx.c#2 integrate
.. //depot/projects/gdb/sys/dev/patm/if_patm_tx.c#2 integrate
.. //depot/projects/gdb/sys/dev/vinum/vinumext.h#2 integrate
.. //depot/projects/gdb/sys/dev/vinum/vinumio.c#2 integrate
.. //depot/projects/gdb/sys/dev/vinum/vinumrequest.c#2 integrate
.. //depot/projects/gdb/sys/fs/specfs/spec_vnops.c#3 integrate
.. //depot/projects/gdb/sys/geom/concat/g_concat.c#3 integrate
.. //depot/projects/gdb/sys/geom/concat/g_concat.h#3 integrate
.. //depot/projects/gdb/sys/geom/geom.h#3 integrate
.. //depot/projects/gdb/sys/geom/geom_dump.c#2 integrate
.. //depot/projects/gdb/sys/geom/geom_event.c#3 integrate
.. //depot/projects/gdb/sys/geom/geom_int.h#2 integrate
.. //depot/projects/gdb/sys/geom/geom_subr.c#4 integrate
.. //depot/projects/gdb/sys/i386/i386/trap.c#4 integrate
.. //depot/projects/gdb/sys/i386/i386/vm_machdep.c#3 integrate
.. //depot/projects/gdb/sys/ia64/ia64/machdep.c#6 integrate
.. //depot/projects/gdb/sys/kern/kern_fork.c#5 integrate
.. //depot/projects/gdb/sys/net/if_disc.c#2 integrate
.. //depot/projects/gdb/sys/net/if_ethersubr.c#4 integrate
.. //depot/projects/gdb/sys/net/if_faith.c#2 integrate
.. //depot/projects/gdb/sys/net/if_fddisubr.c#2 integrate
.. //depot/projects/gdb/sys/net/if_loop.c#2 integrate
.. //depot/projects/gdb/sys/net/if_stf.c#3 integrate
.. //depot/projects/gdb/sys/net/if_tap.c#3 integrate
.. //depot/projects/gdb/sys/netinet/in_pcb.c#2 integrate
.. //depot/projects/gdb/sys/netinet/in_var.h#2 integrate
.. //depot/projects/gdb/sys/netinet/ip_encap.c#2 integrate
.. //depot/projects/gdb/sys/netinet6/ah_core.c#2 integrate
.. //depot/projects/gdb/sys/sparc64/include/_types.h#2 integrate
.. //depot/projects/gdb/sys/sys/kernel.h#4 integrate
.. //depot/projects/gdb/sys/sys/mdioctl.h#2 integrate
.. //depot/projects/gdb/sys/sys/param.h#5 integrate
.. //depot/projects/gdb/sys/vm/uma_core.c#5 integrate
.. //depot/projects/gdb/sys/vm/vm_fault.c#3 integrate
.. //depot/projects/gdb/tools/test/ppsapi/ppsapitest.c#2 integrate
.. //depot/projects/gdb/tools/tools/nanobsd/Makefile#1 branch
.. //depot/projects/gdb/tools/tools/nanobsd/i386.diskimage#1 branch
.. //depot/projects/gdb/tools/tools/nanobsd/make.conf#1 branch
.. //depot/projects/gdb/usr.bin/calendar/calendars/calendar.freebsd#4 integrate
.. //depot/projects/gdb/usr.bin/make/for.c#2 integrate
.. //depot/projects/gdb/usr.bin/make/nonints.h#2 integrate
.. //depot/projects/gdb/usr.bin/make/parse.c#2 integrate
.. //depot/projects/gdb/usr.bin/systat/convtbl.c#2 integrate
.. //depot/projects/gdb/usr.bin/systat/convtbl.h#2 integrate
.. //depot/projects/gdb/usr.bin/systat/extern.h#2 integrate
.. //depot/projects/gdb/usr.bin/systat/ifcmds.c#2 integrate
.. //depot/projects/gdb/usr.bin/systat/ifstat.c#2 integrate
.. //depot/projects/gdb/usr.bin/systat/main.c#2 integrate
.. //depot/projects/gdb/usr.bin/usbhidaction/usbhidaction.c#2 integrate
.. //depot/projects/gdb/usr.sbin/gstat/gstat.c#3 integrate
.. //depot/projects/gdb/usr.sbin/newsyslog/newsyslog.8#2 integrate
.. //depot/projects/gdb/usr.sbin/rtadvd/rrenum.c#2 integrate

Differences ...

==== //depot/projects/gdb/Makefile.inc1#4 (text+ko) ====

@@ -1,5 +1,5 @@
 #
-# $FreeBSD: src/Makefile.inc1,v 1.410 2004/03/05 18:16:28 gad Exp $
+# $FreeBSD: src/Makefile.inc1,v 1.412 2004/03/11 00:22:04 mlaier Exp $
 #
 # Make command line options:
 #	-DNO_DYNAMICROOT do not link /bin and /sbin dynamically
@@ -418,6 +418,12 @@
 		false; \
 	fi
 .endif
+.if !defined(NO_PF)
+	@if ! `id -u proxy > /dev/null`; then \
+		echo "ERROR: Required proxy user is missing, see /usr/src/UPDATING."; \
+		false; \
+	fi
+.endif
 
 #
 # distributeworld

==== //depot/projects/gdb/UPDATING#5 (text+ko) ====

@@ -17,6 +17,13 @@
 	developers choose to disable these features on build machines
 	to maximize performance.
 
+20040310:
+	The FreeBSD/sparc64 platform is changing time_t from 32-bits to
+	64-bits.  This is a very major incompatible change, so people
+	using FreeBSD/sparc64 *must* read the UPDATING.64BTT file for
+	detailed instructions on how to make this upgrade.  People
+	upgrading FreeBSD on other platforms can ignore this event.
+
 20040308:
 	The packet filter (pf) is now installed with the base system. Make
 	sure to run mergemaster -p before installworld to create required
@@ -1541,4 +1548,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.298 2004/03/08 22:26:46 mlaier Exp $
+$FreeBSD: src/UPDATING,v 1.299 2004/03/10 17:39:05 gad Exp $

==== //depot/projects/gdb/UPDATING.64BTT#2 (text+ko) ====

@@ -1,6 +1,6 @@
 # -------+---------+---------+---------+---------+---------+---------+---------+
 
-   The FreeBSD/sparc64 port is going to change time_t from 32-bits to 64-bits.
+   The FreeBSD/sparc64 port has now changed time_t from 32-bits to 64-bits.
    This file explains the exact steps that users should follow to update their
    sparc64 systems for this change.  People running FreeBSD on other types of
    hardware, such as CPU's from Intel or AMD, can ignore this file.  For now,
@@ -28,7 +28,7 @@
 #  POSSIBILITY OF SUCH DAMAGE.
 #
 # -------+---------+---------+---------+---------+---------+---------+---------+
-# $FreeBSD: src/UPDATING.64BTT,v 1.3 2004/03/05 23:10:49 gad Exp $
+# $FreeBSD: src/UPDATING.64BTT,v 1.4 2004/03/10 17:39:05 gad Exp $
 # -------+---------+---------+---------+---------+---------+---------+---------+
 
 If you are in too much of a hurry to read this file, then this is not the
@@ -43,7 +43,16 @@
 
 Do not start this update unless you have the extra time.
 
-* READ THIS ENTIRE DOCUMENT at least once before starting the upgrade. *
+As of March 10th, the official value for time_t on sparc64 has changed to
+be 64-bits.  If you really must build system with 32-bit time_t's, then it
+would be best to stick with a snapshot of current from before March 10th.
+With src snapshots after that point, there will soon be ports which assume
+you have a 64-bit time_t based on the value of __FreeBSD_version.
+
+If you are ready to upgrade, then *READ THIS ENTIRE DOCUMENT* at least
+once before starting the upgrade.
+
+# -------+---------+---------+---------+---------+---------+---------+---------+
 
 This is a major change.  This change will *not* be backwards-compatible.
 Any programs which call system-routines for handling time-values will
@@ -60,8 +69,12 @@
 problems, but if you ignore these steps you are very likely to run into
 some very painful and time-consuming headaches when upgrading.
 
-Step Pre-1:  Update to a recent snapshot of -current, keeping it as
-             a system with 32-bit time_t.
+Step Pre-1:  Update to a recent snapshot of -current, and first build
+             that as a system with 32-bit time_t.  To do this, edit
+	     the file  /usr/src/sys/sparc64/include/_types.h 
+             find the line:
+               typedef	__int64_t	__time_t;	/* time()... */
+             and change '__int64_t' to '__int32_t'
 Step Pre-2:  Install that system, using whatever steps you normally
              use, and make sure that installation seems to work okay.
 Step Pre-3:  While still running that 32-bit time_t system, it would
@@ -78,17 +91,17 @@
              The 'dhclient' in the base system is known to be unreliable
 	     on a system which is upgraded to 64-bit time_t's.  It may
 	     work for you, but it probably will not.
-	     As of March 3rd 2004, we have no fix for that.
+	     As of March 10th 2004, we have no fix for that.
 	     However, the net/isc-dhcp3-client port does seem to work.
 	     IF your machine needs DHCP, then you should probably install
 	     that port and make sure you can get it working *before* you
 	     make the change to use 64-bit time_t's.
 
-<instructions for early-adopters>
+After you have built and installed that src-snapshot with 32-bit time_t's,
      edit the file  /usr/src/sys/sparc64/include/_types.h 
      find the line:
         typedef	__int32_t	__time_t;	/* time()... */
-     and change '__int32_t' to '__int64_t'
+     and change '__int32_t' back to '__int64_t'
 
      For best results, do NOT make any other changes.  Do NOT cvsup the
      source tree trying to pick up any other changes.  At this point you
@@ -104,8 +117,9 @@
      I am not suggesting that you have to do two whole buildworld/
      installworld cycles in a single day.  You could easily wait a few
      days, or even a week between them.  What I am suggesting is that
-      you should not 'cvsup' your sources inbetween the two buildworlds.
-</instructions for early-adopters>
+     you should not 'cvsup' your sources inbetween the two buildworlds.
+
+And then follow these steps to build and install the 64-bit time_t system:
 
     cd /usr/src                   #-  1.
     make cleanworld               #-  2.  or 'rm -Rf /usr/obj/usr/src/*'
@@ -299,9 +313,9 @@
         and log back in after recompiling that shell.
     portupgrade -Rr -f ezm3 cvsup-without-gui    #- Ports 3 (maybe).
         If you want to rebuild a 64-bit time_t version of cvsup.
-	Note: ezm3 (modula-3) needs a patch to work correctly after
-	the change to 64-BTT.  That fix has not been commited to the
-	port yet [as of Mar 3rd], but it should be commited soon.
+	Note: ezm3 (modula-3) needs a patch to work correctly after the
+	change to 64-BTT.  That fix has not been commited to the port
+	yet [as of Mar 10th], but hopefully it will be commited soon.
 
 There are pre-built packages available for ezm3 and cvsup-without-gui on
 the new 64-bTT systems.  This ezm3 package *does* include the necessarily
@@ -325,10 +339,11 @@
     "Now look over all the other ports you have installed, and
     re-compile everything that probably needs to be recompiled".
 
-If you are going to do it piecemeal, the next ports to force-recompile
-would probably be languages like perl and python, if you have them
-installed.  Or you might want to play it safe at this point, and simply
-recompile *every* port that you have installed.
+If you are going to do it piecemeal, the next ports to force-rebuild would
+probably be languages like perl and python, if you have them installed.
+After that, force-rebuild the ports like autoconf and automake, if you
+have them installed.  Or you might want to play it safe at this point,
+and simply recompile *every* port that you have installed.
 
 A different tactic to use for ports is to remove *all* ports before you
 do the installkernel/installworld step (while you're still on a 32-bTT
@@ -342,20 +357,5 @@
 the mailing list freebsd-sparc64 at FreeBSD.org .
 
 # -------+---------+---------+---------+---------+---------+---------+---------+
-
-<Final notes for early-adopters>
-    For people who are helping out by testing these instructions, note
-    that once you make this change, you must remember to KEEP changing
-    __time_t in _types.h after every time you 'cvs update' or cvsup
-    your /usr/src tree.  If you forget, and end up building a world
-    with 32-bit time_t's, you will probably have a very very bad day.
-    Once this change is committed for real (which is scheduled for
-    March 10th), you will not need to care about this issue as much.
-
-    Also, a change has been committed to /usr/src/Makefile.inc1 which
-    does try to protect you from making this mistake.
-</final notes for early-adopters>
-
-# -------+---------+---------+---------+---------+---------+---------+---------+
 #  Notice that the following command can be useful in some settings:
                grep '#\- ' UPDATING.64BTT

==== //depot/projects/gdb/bin/df/df.c#4 (text+ko) ====

@@ -48,7 +48,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/df/df.c,v 1.55 2004/03/05 08:10:16 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/df/df.c,v 1.56 2004/03/09 10:02:44 le Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -400,7 +400,8 @@
  */
 #define fsbtoblk(num, fsbs, bs) \
 	(((fsbs) != 0 && (fsbs) < (bs)) ? \
-		(num) / ((bs) / (fsbs)) : (num) * ((fsbs) / (bs)))
+		(num) / (intmax_t)((bs) / (fsbs)) : \
+		(num) * (intmax_t)((fsbs) / (bs)))
 
 /*
  * Print out status about a file system.

==== //depot/projects/gdb/etc/group#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/group,v 1.29 2004/03/08 22:03:27 mlaier Exp $
+# $FreeBSD: src/etc/group,v 1.30 2004/03/10 15:04:29 mlaier Exp $
 #
 wheel:*:0:root
 daemon:*:1:
@@ -17,8 +17,8 @@
 mailnull:*:26:
 guest:*:31:
 bind:*:53:
-proxy:*:62
-authpf:*:63
+proxy:*:62:
+authpf:*:63:
 uucp:*:66:
 dialer:*:68:
 network:*:69:

==== //depot/projects/gdb/etc/inetd.conf#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/inetd.conf,v 1.65 2004/03/08 23:18:50 ale Exp $
+# $FreeBSD: src/etc/inetd.conf,v 1.66 2004/03/10 15:06:17 mlaier Exp $
 #
 # Internet server configuration database
 #
@@ -122,4 +122,4 @@
 # N.B.: inetd binds to * in the default installation so you should add
 #	an appropriate block rule to your pf.conf
 #
-#ftp-proxy stream tcp nowait root /usr/local/libexec/ftp-proxy ftp-proxy
+#ftp-proxy stream tcp nowait root /usr/libexec/ftp-proxy ftp-proxy

==== //depot/projects/gdb/etc/rc.d/initdiskless#3 (text+ko) ====

@@ -24,7 +24,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/rc.d/initdiskless,v 1.29 2004/03/08 12:25:05 pjd Exp $
+# $FreeBSD: src/etc/rc.d/initdiskless,v 1.30 2004/03/09 23:06:50 phk Exp $
 #
 # PROVIDE: initdiskless
 # KEYWORD: FreeBSD nojail
@@ -49,12 +49,18 @@
 # /<sub_directory_name>.  For example, if /conf/base/etc exists then a
 # memory filesystem will be created for /etc.
 #
+# If a subdirectory contains the file 'remount' the contents of the file
+# is a mount command used to remount the subdirectory prior to it being
+# copied.  An example contents could be: "mount -o ro /dev/ad0s3".  Note
+# that the directory to be mounted on is supplied by this script.
+#
 # If a subdirectory contains the file 'diskless_remount' the contents of
 # the file is used to remount the subdirectory prior to it being copied to
 # the memory filesystem.  For example, if /conf/base/etc/diskless_remount
 # contains the string 'my.server.com:/etc' then my.server.com:/etc will be
 # mounted in place of the subdirectory.  This allows you to avoid making
-# duplicates of system directories in /conf.
+# duplicates of system directories in /conf.  Special processing is done
+# to allow specifications relative to the root filesystem.
 #
 # If a subdirectory contains the file 'md_size', the contents of the
 # file is used to determine the size of the memory filesystem, in 512
@@ -79,7 +85,7 @@
 # Those filesystems should not be specified in /conf.  At least not yet.
 
 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
-[ ${dlv:=0} -eq 0 ] && exit 0
+[ ${dlv:=0} -eq 0 ] && [ ! -f /etc/diskless ] && exit 0
 
 # chkerr:
 #
@@ -130,23 +136,25 @@
 bootp_ifc=""
 bootp_ipa=""
 bootp_ipbca=""
-iflist=`ifconfig -l`
-for i in ${iflist} ; do
-    set `ifconfig ${i}`
-    while [ $# -ge 1 ] ; do
-        if [ "${bootp_ifc}" = "" -a "$1" = "inet" ] ; then
-            bootp_ifc=${i} ; bootp_ipa=${2} ; shift
-        fi
-        if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ] ; then
-            bootp_ipbca=$2; shift
-        fi
-        shift
-    done
-    if [ "${bootp_ifc}" != "" ] ; then
-        break
-    fi
-done
-echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
+if [ ${dlv:=0} -ne 0 ] ; then
+	iflist=`ifconfig -l`
+	for i in ${iflist} ; do
+	    set `ifconfig ${i}`
+	    while [ $# -ge 1 ] ; do
+		if [ "${bootp_ifc}" = "" -a "$1" = "inet" ] ; then
+		    bootp_ifc=${i} ; bootp_ipa=${2} ; shift
+		fi
+		if [ "${bootp_ipbca}" = "" -a "$1" = "broadcast" ] ; then
+		    bootp_ipbca=$2; shift
+		fi
+		shift
+	    done
+	    if [ "${bootp_ifc}" != "" ] ; then
+		break
+	    fi
+	done
+	echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
+fi
 
 # Figure out our NFS root path
 #
@@ -188,6 +196,14 @@
 	    eval md_size_$subdir=`cat $j/md_size`
 	fi
 
+	# remount
+	#
+	if [ -d $j -a -f $j/remount ]; then
+	    nfspt=`/bin/cat $j/remount`
+	    $nfspt $j
+	    chkerr $? "$nfspt $j"
+	fi
+
 	# NFS remount
 	#
 	if [ -d $j -a -f $j/diskless_remount ]; then

==== //depot/projects/gdb/lib/Makefile#4 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
-# $FreeBSD: src/lib/Makefile,v 1.180 2004/03/02 06:26:37 grehan Exp $
+# $FreeBSD: src/lib/Makefile,v 1.181 2004/03/10 08:58:06 phk Exp $
 
 # To satisfy shared library or ELF linkage when only the libraries being
 # built are visible:
@@ -23,8 +23,8 @@
 # Otherwise, the SUBDIR list should be in alphabetical order.
 
 SUBDIR=	${_csu} libcom_err libcrypt libkvm msun libmd libncurses \
-	libnetgraph libradius librpcsvc libsbuf libtacplus libutil libypclnt \
-	${_compat} libalias libarchive ${_libatm} ${_libbind} \
+	libnetgraph libradius librpcsvc libsbuf libtacplus libutil \
+	${_libypclnt} ${_compat} libalias libarchive ${_libatm} ${_libbind} \
 	${_libbluetooth} libbsnmp libbz2 libc ${_libc_r} \
 	libcalendar libcam libcompat libdevinfo libdevstat ${_libdisk} \
 	libedit libexpat libfetch libform libftpio libgeom ${_libio} libipsec \
@@ -110,4 +110,8 @@
 _libmp=		libmp
 .endif
 
+.if !defined(NO_YP_LIBC)
+_libypclnt=	libypclnt
+.endif
+
 .include <bsd.subdir.mk>

==== //depot/projects/gdb/lib/libarchive/Makefile#2 (text+ko) ====

@@ -1,6 +1,6 @@
 # Makefile for libarchive.
 #
-# $FreeBSD: src/lib/libarchive/Makefile,v 1.2 2004/02/12 04:11:40 kientzle Exp $
+# $FreeBSD: src/lib/libarchive/Makefile,v 1.3 2004/03/09 19:50:41 kientzle Exp $
 #
 LIB=	archive
 SRCS=	archive_check_magic.c				\
@@ -109,13 +109,13 @@
 
 INCS =	archive.h archive_entry.h
 
-CFLAGS+=-DDEBUG -g
 .if defined(DMALLOC)
-CFLAGS+=-DDMALLOC -I/usr/local/include
-LDFLAGS+=-L/usr/local/lib -ldmalloc
+DEBUG_FLAGS+= -DDEBUG -g
+CFLAGS+= -DHAVE_DMALLOC -I/usr/local/include
+LDFLAGS+= -L/usr/local/lib -ldmalloc
 .endif
 
-# Should be WARNS=10, except that zlib.h is borked. <sigh>
-WARNS?=	3	
+# Should be WARNS=6, except that zlib.h is borked. <sigh>
+WARNS?=	3
 
 .include <bsd.lib.mk>

==== //depot/projects/gdb/lib/libarchive/archive.h#3 (text+ko) ====

@@ -23,7 +23,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.h,v 1.3 2004/03/06 01:06:49 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive.h,v 1.4 2004/03/09 19:50:41 kientzle Exp $
  */
 
 #ifndef ARCHIVE_H_INCLUDED
@@ -52,6 +52,20 @@
 #define	ARCHIVE_FATAL	(-3)	/* No more operations are possible. */
 
 /*
+ * As far as possible, archive_errno returns standard platform errno codes.
+ * Of course, the details vary by platform, so the actual definitions
+ * here are stored in "archive_platform.h".  The symbols are listed here
+ * for reference; as a rule, clients should not need to know the exact
+ * platform-dependent error code.
+ */
+/* Unrecognized or invalid file format. */
+/* #define ARCHIVE_ERRNO_FILE_FORMAT */
+/* Illegal usage of the library. */
+/* #define ARCHIVE_ERRNO_PROGRAMMER_ERROR */
+/* Unknown or unclassified error. */
+/* #define ARCHIVE_ERRNO_MISC */
+
+/*
  * Callbacks are invoked to automatically read/write/open/close the archive.
  * You can provide your own for complex tasks (like breaking archives
  * across multiple tapes) or use standard ones built into the library.

==== //depot/projects/gdb/lib/libarchive/archive_check_magic.c#2 (text+ko) ====

@@ -24,10 +24,12 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.1 2004/02/09 23:22:53 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_check_magic.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $");
+
+#include <sys/types.h>
 
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <stdio.h>

==== //depot/projects/gdb/lib/libarchive/archive_entry.c#2 (text+ko) ====

@@ -24,12 +24,12 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.1 2004/02/09 23:22:53 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <stdlib.h>

==== //depot/projects/gdb/lib/libarchive/archive_private.h#2 (text+ko) ====

@@ -23,7 +23,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_private.h,v 1.1 2004/02/09 23:22:53 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_private.h,v 1.2 2004/03/09 19:50:41 kientzle Exp $
  */
 
 #ifndef ARCHIVE_PRIVATE_H_INCLUDED
@@ -42,16 +42,7 @@
  * directories so that they can be initially restored writable, then
  * fixed up at end.  This also handles mtime/atime fixups.
  */
-struct archive_extract_dir_entry {
-	struct archive_extract_dir_entry	*next;
-	mode_t		 mode;
-	int64_t		 mtime;
-	int64_t		 atime;
-	unsigned long	 mtime_nanos;
-	unsigned long	 atime_nanos;
-	/* Note: ctime cannot be restored, so don't bother */
-	char		*name;
-};
+struct archive_extract_dir_entry;
 
 struct archive {
 	/*

==== //depot/projects/gdb/lib/libarchive/archive_read.c#2 (text+ko) ====

@@ -32,10 +32,10 @@
  * needlessly bloating statically-linked clients.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.1 2004/02/09 23:22:54 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $");
 
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <err.h>
@@ -183,8 +183,8 @@
 	 * support this stream.
 	 */
 	if (best_bid < 1) {
-		archive_set_error(a, EFTYPE, "Unrecognized archive format");
-		/* EFTYPE == "Inappropriate file type or format" */
+		archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
+		    "Unrecognized archive format");
 		return (ARCHIVE_FATAL);
 	}
 
@@ -303,7 +303,8 @@
 	 * can't support this stream.
 	 */
 	if (best_bid < 1) {
-		archive_set_error(a, EFTYPE, "Unrecognized archive format");
+		archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
+		    "Unrecognized archive format");
 		return (ARCHIVE_FATAL);
 	}
 
@@ -374,7 +375,7 @@
 			return (ARCHIVE_FATAL);
 		}
 		if (bytes_read == 0) {
-			archive_set_error(a, 0,
+			archive_set_error(a, EIO,
 			    "Premature end of archive entry");
 			return (ARCHIVE_FATAL);
 		}

==== //depot/projects/gdb/lib/libarchive/archive_read_data_into_buffer.c#2 (text+ko) ====

@@ -24,10 +24,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_buffer.c,v 1.1 2004/02/09 23:22:54 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_buffer.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $");
 
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <string.h>

==== //depot/projects/gdb/lib/libarchive/archive_read_data_into_fd.c#2 (text+ko) ====

@@ -24,10 +24,12 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.1 2004/02/09 23:22:54 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.2 2004/03/09 19:50:41 kientzle Exp $");
+
+#include <sys/types.h>
 
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <unistd.h>

==== //depot/projects/gdb/lib/libarchive/archive_read_extract.c#2 (text+ko) ====

@@ -24,15 +24,17 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.2 2004/02/12 20:35:59 kientzle Exp $");
+#include "archive_platform.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.3 2004/03/09 19:50:41 kientzle Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifdef HAVE_POSIX_ACL
 #include <sys/acl.h>
+#endif
 #include <sys/time.h>
 
-#ifdef DMALLOC
+#ifdef HAVE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include <errno.h>
@@ -75,14 +77,34 @@
 static int	mkdirpath(struct archive *, const char *);
 static int	mkdirpath_recursive(char *path);
 static int	mksubdir(char *path);
+#ifdef HAVE_POSIX_ACL
+static int	set_acl(struct archive *a, const char *acl_text,
+		    acl_type_t type, const char *pathname);
+#endif
 static int	set_acls(struct archive *, struct archive_entry *);
 static int	set_extended_perm(struct archive *, struct archive_entry *,
 		    int flags);
 static int	set_fflags(struct archive *, struct archive_entry *);
 static int	set_ownership(struct archive *, struct archive_entry *, int);
-static int	set_perm(struct archive *, struct archive_entry *, int mode, int flags);
+static int	set_perm(struct archive *, struct archive_entry *, int mode,
+		    int flags);
 static int	set_time(struct archive *, struct archive_entry *, int);
+static struct archive_extract_dir_entry *
+		sort_dir_list(struct archive_extract_dir_entry *p);
+
 
+struct archive_extract_dir_entry {
+	struct archive_extract_dir_entry	*next;
+	mode_t		 mode;
+	int64_t		 mtime;
+	int64_t		 atime;
+	unsigned long	 mtime_nanos;
+	unsigned long	 atime_nanos;
+	/* Note: ctime cannot be restored, so don't bother */
+	char		*name;
+};
+
+
 /*
  * Extract this entry to disk.
  *
@@ -108,15 +130,21 @@
 		writable_mode = archive_entry_stat(entry)->st_mode | 0700;
 
 		/*
-		 * If this dir isn't writable, restore it with write
-		 * permissions and add it to the fixup list for later
-		 * handling.
+		 * In order to correctly restore non-writable dirs or
+		 * dir timestamps, we need to maintain a fix-up list.
 		 */
-		if (archive_entry_stat(entry)->st_mode != writable_mode) {
+		if (archive_entry_stat(entry)->st_mode != writable_mode ||
+		    flags & ARCHIVE_EXTRACT_TIME) {
 			le = malloc(sizeof(struct archive_extract_dir_entry));
 			le->next = a->archive_extract_dir_list;
 			a->archive_extract_dir_list = le;
 			le->mode = archive_entry_stat(entry)->st_mode;
+			le->mtime = archive_entry_stat(entry)->st_mtime;
+			le->mtime_nanos =
+			    archive_entry_stat(entry)->st_mtimespec.tv_nsec;
+			le->atime = archive_entry_stat(entry)->st_atime;
+			le->atime_nanos =
+			    archive_entry_stat(entry)->st_atimespec.tv_nsec;
 			le->name =
 			    malloc(strlen(archive_entry_pathname(entry)) + 1);
 			strcpy(le->name, archive_entry_pathname(entry));
@@ -172,39 +200,112 @@
 
 /*
  * Cleanup function for archive_extract.  Free name/mode list and
- * restore permissions.
+ * restore permissions and dir timestamps.  This must be done last;
+ * otherwise, the dir permission might prevent us from restoring a
+ * file.  Similarly, the act of restoring a file touches the directory
+ * and changes the timestamp on the dir, so we have to touch-up the
+ * timestamps at the end as well.  Note that tar/cpio do not require
+ * that archives be in a particular order; there is no way to know
+ * when the last file has been restored within a directory, so there's
+ * no way to optimize the memory usage here by fixing up the directory
+ * any earlier than the end-of-archive.
  *
- * TODO: Restore times here as well.
+ * XXX TODO: Directory ACLs should be restored here, for the same
+ * reason we set directory perms here. XXX
  *
  * Registering this function (rather than calling it explicitly by
- * name from archive_read_finish) reduces link pollution, since
+ * name from archive_read_finish) reduces static link pollution, since
  * applications that don't use this API won't get this file linked in.
  */
 static
 void archive_extract_cleanup(struct archive *a)
 {
-	struct archive_extract_dir_entry *lp;
+	struct archive_extract_dir_entry *next, *p;
+
+	/* Sort dir list so directories are fixed up in depth-first order. */
+	p = sort_dir_list(a->archive_extract_dir_list);
+
+	while (p != NULL) {
+		struct timeval times[2];
+
+		times[1].tv_sec = p->mtime;
+		times[1].tv_usec = p->mtime_nanos / 1000;
+		times[0].tv_sec = p->atime;
+		times[0].tv_usec = p->atime_nanos / 1000;
+
+		chmod(p->name, p->mode);
+		utimes(p->name, times);
+
+		next = p->next;
+		free(p->name);
+		free(p);
+		p = next;
+	}
+	a->archive_extract_dir_list = NULL;
+}
+
+/*
+ * Simple O(n log n) merge sort to order the directories prior to fix-up.
+ */
+static struct archive_extract_dir_entry *
+sort_dir_list(struct archive_extract_dir_entry *p)
+{
+	struct archive_extract_dir_entry *a, *b, *t;
+
+	if (p == NULL)
+		return NULL;
+	/* A one-item list is already sorted. */
+	if (p->next == NULL)
+		return (p);
+
+	/* Step 1: split the list. */
+	t = p;
+	a = p->next->next;
+	while (a != NULL) {
+		/* Step a twice, t once. */
+		a = a->next;
+		if (a != NULL)
+			a = a->next;
+		t = t->next;
+	}
+	/* Now, t is at the mid-point, so break the list here. */
+	b = t->next;
+	t->next = NULL;
+	a = p;
+
+	/* Step 2: Recursively sort the two sub-lists. */
+	a = sort_dir_list(a);
+	b = sort_dir_list(b);
+
+	/* Step 3: Merge the returned lists. */
+	/* Pick the first element for the merged list. */
+	if (strcmp(a->name, b->name) > 0) {
+		t = p = a;
+		a = a->next;
+	} else {
+		t = p = b;
+		b = b->next;
+	}
 
-	/*
-	 * TODO: Does dir list need to be sorted so permissions are restored
-	 * depth-first?
-	 */
-	while (a->archive_extract_dir_list) {
-		lp = a->archive_extract_dir_list->next;
-		chmod(a->archive_extract_dir_list->name,
-		    a->archive_extract_dir_list->mode);
-		/*
-		 * TODO: Consider using this hook to restore dir
-		 * timestamps as well.  However, dir timestamps don't
-		 * really matter, and it would be a memory issue to
-		 * record timestamps for every directory
-		 * extracted... Ugh.
-		 */
-		if (a->archive_extract_dir_list->name)
-			free(a->archive_extract_dir_list->name);
-		free(a->archive_extract_dir_list);
-		a->archive_extract_dir_list = lp;
+	/* Always put the later element on the list first. */
+	while (a != NULL && b != NULL) {
+		if (strcmp(a->name, b->name) > 0) {
+			t->next = a;
+			a = a->next;
+		} else {
+			t->next = b;
+			b = b->next;
+		}
+		t = t->next;
 	}
+
+	/* Only one list is non-empty, so just splice it on. */
+	if (a != NULL)
+		t->next = a;
+	if (b != NULL)
+		t->next = b;
+
+	return (p);
 }
 
 static int
@@ -620,7 +721,12 @@
 	times[0].tv_sec = st->st_atime;
 	times[0].tv_usec = st->st_atimespec.tv_nsec / 1000;
 
+#ifdef HAVE_LUTIMES
 	if (lutimes(archive_entry_pathname(entry), times) != 0) {
+#else
+	if ((archive_entry_mode(entry) & S_IFMT) != S_IFLNK &&
+	    utimes(archive_entry_pathname(entry), times) != 0) {
+#endif
 		archive_set_error(a, errno, "Can't update time for %s",
 		    archive_entry_pathname(entry));
 		return (ARCHIVE_WARN);
@@ -645,7 +751,12 @@
 		return (ARCHIVE_OK);
 
 	name = archive_entry_pathname(entry);
+#ifdef HAVE_LCHMOD
 	if (lchmod(name, mode) != 0) {
+#else
+	if ((archive_entry_mode(entry) & S_IFMT) != S_IFLNK &&
+	    chmod(name, mode) != 0) {
+#endif
 		archive_set_error(a, errno, "Can't set permissions");
 		return (ARCHIVE_WARN);
 	}
@@ -688,6 +799,7 @@
 	if (fflags == NULL)
 		return (ARCHIVE_WARN);
 
+#ifdef HAVE_CHFLAGS
 	fflags_p = fflags;
 	if (strtofflags(&fflags_p, &set, &clear) != 0  &&
 	    stat(name, &st) == 0) {
@@ -699,6 +811,8 @@
 			ret = ARCHIVE_WARN;
 		}
 	}
+#endif
+
 	free(fflags);
 	return (ret);
 }
@@ -709,46 +823,58 @@
 static int
 set_acls(struct archive *a, struct archive_entry *entry)
 {
-	const char	*acldesc;
-	acl_t		 acl;
+#ifdef HAVE_POSIX_ACL
+	const char	*acl_text;
 	const char	*name;
 	int		 ret;
 
 	ret = ARCHIVE_OK;
+
 	name = archive_entry_pathname(entry);
-	acldesc = archive_entry_acl(entry);

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list