NetBSD Problem Report #1393
From gnats Mon Aug 21 10:53:45 1995
Received: from bseis.eis.cs.tu-bs.de (root@bseis.eis.cs.tu-bs.de [134.169.32.62]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with SMTP id KAA17336 for <gnats-bugs@gnats.netbsd.org>; Mon, 21 Aug 1995 10:53:38 -0400
Message-Id: <9508211453.AA19290@bseis.eis.cs.tu-bs.de>
Date: Mon, 21 Aug 95 16:53:32 +0200
From: hannken@eis.cs.tu-bs.de (Juergen Hannken-Illjes)
Reply-To: hannken@eis.cs.tu-bs.de
To: gnats-bugs@gnats.netbsd.org
Subject: install should keep file times
X-Send-Pr-Version: 3.2
>Number: 1393
>Category: bin
>Synopsis: install should keep file times
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Aug 21 11:05:09 +0000 1995
>Closed-Date: Thu Sep 14 14:12:43 +0000 1995
>Last-Modified: Thu Sep 14 18:16:29 +0000 1995
>Originator: Juergen Hannken-Illjes
>Release: tar files of Aug, 19.
>Organization:
TU Braunschweig
>Environment:
System: NetBSD home 1.0A NetBSD 1.0A (CUSTOM) #6: Sat Aug 19 23:28:47 MET DST 1995 hannken@home:/usr/src/sys/arch/i386/compile/CUSTOM i386
>Description:
It would be nice for install to set the file times of the destination
to those of the source.
Benefits: once we have done
(cd lib; make all install) and (make all install)
there will be no further actions on subsequent makes.
Reason: all progs depend on libc, which gets a newer time on every install.
>How-To-Repeat:
>Fix:
--- usr.bin/xinstall/xinstall.c.orig Tue Aug 15 18:18:30 1995
+++ usr.bin/xinstall/xinstall.c Sun Aug 20 17:43:08 1995
@@ -49,6 +49,7 @@
#include <sys/param.h>
#include <sys/wait.h>
#include <sys/mman.h>
+#include <sys/time.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -199,6 +200,7 @@
u_int flags;
{
struct stat from_sb, to_sb;
+ static struct timeval tv[2];
int devnull, from_fd, to_fd, serrno;
char *p;
@@ -272,6 +274,12 @@
}
(void)close(to_fd);
+
+ TIMESPEC_TO_TIMEVAL(&tv[0], &from_sb.st_atimespec);
+ TIMESPEC_TO_TIMEVAL(&tv[1], &from_sb.st_mtimespec);
+ if (utimes(to_name, tv))
+ warn("utimes: %s", to_name);
+
if (!docopy && !devnull && unlink(from_name))
err(1, "%s", from_name);
}
--- share/mk/bsd.lib.mk.orig Tue Aug 15 18:13:00 1995
+++ share/mk/bsd.lib.mk Sun Aug 20 17:46:34 1995
@@ -157,20 +157,20 @@
# ranlib lib${LIB}.a
install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 lib${LIB}.a \
${DESTDIR}${LIBDIR}
- ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
+# ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}.a
.if !defined(NOPROFILE)
# ranlib lib${LIB}_p.a
install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \
lib${LIB}_p.a ${DESTDIR}${LIBDIR}
- ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+# ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
.endif
.if !defined(NOPIC)
# ranlib lib${LIB}_pic.a
install ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m 600 \
lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
- ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+# ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
chmod ${LIBMODE} ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
.endif
.if !defined(NOPIC) && defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
>Release-Note:
>Audit-Trail:
From: Charles Hannum <Charles-Hannum@deshaw.com>
To: hannken@eis.cs.tu-bs.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/1393: install should keep file times
Date: Tue, 22 Aug 1995 01:02:48 -0400
Picture this series of events:
* Build libc. Forget to install it.
* Build /usr/bin.
* Realize you forgot to install libc, and install it.
* Build /usr/bin. Nothing gets relinked, because the libraries are
effectively back-dated.
This seems sub-optimal.
[Aside: Maybe there should be a FAQ entry with some title like `Why
doesn't install(1) copy the time stamp from the source file?'...]
State-Changed-From-To: open->closed
State-Changed-By: jtc
State-Changed-When: Thu Sep 14 14:12:43 1995
State-Changed-Why:
We can't do this. Install has always updated the file times; and many
things, including the installation of header files and libraries depend
on that behavior. Charles Hannum outlined the following scenerio:
* Build libc. Forget to install it.
* Build /usr/bin.
* Realize you forgot to install libc, and install it.
* Build /usr/bin. Nothing gets relinked, because the libraries are
effectively back-dated.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.