Patch for DBIModel.pm in ${P5SITE}/OpenBSD/PackageManager. This is an
attempt to make pkg_mgr usable by a user that does not have /usr/sbin
in his PATH. pkg_info is called via an absolute path instead of being
resolved through the user's PATH.

Regards,

Ivo van der Sangen
--- DBIModel.pm Tue Apr 15 09:44:43 2008
+++ /tmp/DBIModel.pm    Mon Nov 10 22:46:51 2008
@@ -167,10 +167,10 @@
 
        if ($self->is_installed($path)) {
                $self->{allports}{$path}->{instpkgname} = 
$self->{installed}{$path}->{instpkgname};
-               my $sz = `pkg_info -sq $self->{allports}{$path}->{instpkgname}`;
+               my $sz = `/usr/sbin/pkg_info -sq 
$self->{allports}{$path}->{instpkgname}`;
                $sz/=1024;
                $self->{allports}{$path}->{size} = int($sz)."Kb";
-               my $l = `pkg_info -Rq $self->{allports}{$path}->{instpkgname}`;
+               my $l = `/usr/sbin/pkg_info -Rq 
$self->{allports}{$path}->{instpkgname}`;
                $self->{allports}{$path}->{used_by} = join(" ",split ('\n',$l)) 
if (length $l > 0);
        }
        return $self->{allports}{$path};
@@ -188,7 +188,7 @@
        my $self = shift;
        my $instpkgname;
        undef $self->{installed};
-       foreach(`pkg_info -aP`) {
+       foreach(`/usr/sbin/pkg_info -aP`) {
                chomp;
                next if /^$/;
                next if /Pkgpath:/;
@@ -221,7 +221,7 @@
        my $self = shift;
        my $instpkgname;
        undef $self->{orphaned};
-       foreach(`pkg_info -taP`) {
+       foreach(`/usr/sbin/pkg_info -taP`) {
                chomp;
                next if /^$/;
                next if /Pkgpath:/;

Reply via email to