diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2011-03-23 15:29:32 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2011-03-23 15:29:32 +0000 |
commit | a8c717e203b141524e545fb64da3e74a0a0ab97b (patch) | |
tree | fc1c648946a2239cbf08dad1eb150a0f9588665c /usr.sbin/pkg_add/OpenBSD | |
parent | 7f349eedc4bc2e0c9e24f787c29e8078ddbbb6d7 (diff) |
cache user name for ~user
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm index 03fa9bdda3f..9f2296dfb80 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/SCP.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SCP.pm,v 1.25 2011/03/23 14:05:35 espie Exp $ +# $OpenBSD: SCP.pm,v 1.26 2011/03/23 15:29:31 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -205,13 +205,16 @@ sub abort_batch() print "\nABORTED $token\n"; } +my $dirs = {}; + sub expand_tilde { my $arg = shift; - return (getpwnam($arg))[7]."/"; + + return $dirs->{$arg} //= (getpwnam($arg))[7]."/"; } -local $_; +my $_; while (<STDIN>) { chomp; if (m/^LIST\s+(.*)$/o) { |