diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-05-07 17:21:24 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-05-07 17:21:24 +0000 |
commit | 5a81b204d3e5d4651c8c6e8c85d805123ad172b1 (patch) | |
tree | e4e07cd8183f5191ea91e9a37cefc6ae21394f7e /usr.sbin/pkg_add | |
parent | add7e6352eef58b1e16a485ac882114f4d696c5e (diff) |
new method to convert other file names to fullname.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 80d146307d3..17868364c99 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.203 2012/05/05 10:20:58 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.204 2012/05/07 17:21:23 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -206,15 +206,20 @@ sub compute_fullname } } -sub fullname +sub make_full { - my $self = $_[0]; - my $fullname = $self->name; - if ($fullname !~ m|^/|o && $self->cwd ne '.') { - $fullname = $self->cwd."/".$fullname; - $fullname =~ s,^//,/,; + my ($self, $path) = @_; + if ($path !~ m|^/|o && $self->cwd ne '.') { + $path = $self->cwd."/".$path; + $path =~ s,^//,/,; } - return $fullname; + return $path; +} + +sub fullname +{ + my $self = shift; + return $self->make_full($self->name); } sub compute_modes |