diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-09-14 10:02:38 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-09-14 10:02:38 +0000 |
commit | eeae1fd99b999e95874fd4f582d88d7894a60270 (patch) | |
tree | 1da450e8d0cdd7291980acde4f283b2fe50f14a0 /usr.sbin | |
parent | 37800f62e7cbfe07a9447e53d37702c705c15d7b (diff) |
set separate fields for atime/mtime in file entry, use them while creating.
allows user to undef them, and thus not to set utimes.
Use that to not set utimes for pkginfo.
fixes kili@'s bug in a nicer way wrt Ustar interface...
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocation.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Ustar.pm | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm index 201e866ec0a..e1a1eacbc57 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocation.pm,v 1.24 2010/07/31 11:17:22 espie Exp $ +# $OpenBSD: PackageLocation.pm,v 1.25 2010/09/14 10:02:37 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -175,6 +175,8 @@ sub grab_info while (my $e = $self->_next) { if ($e->isFile && is_info_name($e->{name})) { $e->{name} = $dir.$e->{name}; + undef $e->{mtime}; + undef $e->{atime}; eval { $e->create; }; if ($@) { unlink($e->{name}); diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index b930daa2cba..6260600d9e4 100644 --- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm +++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Ustar.pm,v 1.63 2010/08/23 05:36:20 kili Exp $ +# $OpenBSD: Ustar.pm,v 1.64 2010/09/14 10:02:37 espie Exp $ # # Copyright (c) 2002-2007 Marc Espie <espie@openbsd.org> # @@ -161,7 +161,8 @@ sub next my $result= $self->new_object({ name => $name, mode => $mode, - mtime=> $mtime, + atime => $mtime, + mtime => $mtime, linkname=> $linkname, uname => $uname, uid => $uid, @@ -401,7 +402,10 @@ sub set_modes my $self = shift; chown $self->{uid}, $self->{gid}, $self->{destdir}.$self->name; chmod $self->{mode}, $self->{destdir}.$self->name; - utime time, $self->{mtime}, $self->{destdir}.$self->name; + if (defined $self->{mtime} || defined $self->{atime}) { + utime $self->{atime} // time, $self->{mtime} // time, + $self->{destdir}.$self->name; + } } sub make_basedir |