Re: Impossible to remove a broken package on 6.5.

2019-09-10 Thread Marc Espie
More specifically:

add an indirection to solving dependencies for pure pkg_delete, so that
we don't end up constructing full UpdateSets for no reason

Index: AddCreateDelete.pm
===
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm,v
retrieving revision 1.43
diff -u -p -r1.43 AddCreateDelete.pm
--- AddCreateDelete.pm  27 Feb 2018 22:46:53 -  1.43
+++ AddCreateDelete.pm  10 Sep 2019 09:45:36 -
@@ -171,6 +171,13 @@ sub ntogo_string
$self->f("");
 }
 
+sub solve_dependency
+{
+   my ($self, $solver, $dep, $package) = @_;
+   # full dependency solving with everything
+   return $solver->really_solve_dependency($self, $dep, $package);
+}
+
 package OpenBSD::AddCreateDelete;
 use OpenBSD::Error;
 
Index: PkgDelete.pm
===
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm,v
retrieving revision 1.45
diff -u -p -r1.45 PkgDelete.pm
--- PkgDelete.pm10 Jul 2018 10:37:59 -  1.45
+++ PkgDelete.pm10 Sep 2019 09:45:36 -
@@ -131,6 +131,13 @@ sub deleteset_from_location
return 
$self->deleteset->add_older(OpenBSD::Handle->from_location($location));
 }
 
+sub solve_dependency
+{
+   my ($self, $solver, $dep, $package) = @_;
+   # simpler dependency solving
+   return $solver->find_dep_in_installed($self, $dep);
+}
+
 package OpenBSD::DeleteSet;
 sub setup_header
 {
Index: Dependencies/SolverBase.pm
===
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Dependencies/SolverBase.pm,v
retrieving revision 1.10
diff -u -p -r1.10 SolverBase.pm
--- Dependencies/SolverBase.pm  7 Jul 2018 06:25:53 -   1.10
+++ Dependencies/SolverBase.pm  10 Sep 2019 09:45:36 -
@@ -326,7 +326,8 @@ sub solve_dependency
$state->say("No cache hit on #1", $dep->{pattern});
}
 
-   $self->really_solve_dependency($state, $dep, $package);
+   # we need an indirection because deleting is simpler
+   $state->solve_dependency($self, $dep, $package);
 }
 
 sub solve_depends



Re: Impossible to remove a broken package on 6.5.

2019-09-10 Thread Marc Espie
On Fri, Sep 06, 2019 at 07:13:21AM -0700, Chris Cappuccio wrote:
> Angelo Rossi [angelo.rossi.home...@gmail.com] wrote:
> > 
> > # pkg_delete -v kicad
> > Can't locate object method "updateset_with_new" via package
> > "OpenBSD::PkgDelete::State" at /usr/libdata/perl5/OpenBSD/Dependencies.pm
> > line 309.
> > 
> 
> Your /usr/libdata/perl5/OpenBSD directory is corrupted, this should exist
> in /usr/libdata/perl5/OpenBSD/PkgAdd.pm
> 
> Your upgrade seems to have failed

Nope, there was a specific scenario which got wrong.

The problem has been fixed sometimes after 6.4, a few months ago.

Updating pkg_* should be safe, independently of the rest of the system.

Otherwise, just let kicad stay around until updating to 6.6 in a few months.



Re: Impossible to remove a broken package on 6.5.

2019-09-10 Thread Marc Espie
On Fri, Sep 06, 2019 at 10:55:32AM +0200, Angelo Rossi wrote:
> # pkg_delete -v kicad
> Can't locate object method "updateset_with_new" via package
> "OpenBSD::PkgDelete::State" at /usr/libdata/perl5/OpenBSD/Dependencies.pm
> line 309.

Update your pkg tools to -current, nothing bad will happen to the rest
of your install.



Re: Impossible to remove a broken package on 6.5.

2019-09-08 Thread Strahil Nikolov
On September 6, 2019 6:46:32 PM GMT+03:00, m...@jtm.cx wrote:
>On Fri, Sep 06, 2019 at 07:13:21AM -0700, Chris Cappuccio wrote:
>> Angelo Rossi [angelo.rossi.home...@gmail.com] wrote:
>> > 
>> > # pkg_delete -v kicad
>> > Can't locate object method "updateset_with_new" via package
>> > "OpenBSD::PkgDelete::State" at
>/usr/libdata/perl5/OpenBSD/Dependencies.pm
>> > line 309.
>> > 
>> 
>> Your /usr/libdata/perl5/OpenBSD directory is corrupted, this should
>exist
>> in /usr/libdata/perl5/OpenBSD/PkgAdd.pm
>> 
>> Your upgrade seems to have failed
>> 
>
>The upgrade probably didn't fail.  I ran into the exact same issue with
>kicad-20100505p11;  The package is available in 6.4, but was removed
>and marked broken in 6.5 due to an issue with python-wx. I think the
>error message Angelo Rossi quoted is simply an issue with `pkg_delete`.
>Pkg_delete doesn't know what to do with a package that isn't available
>anymore.
>
>I didn't know what to do here either. I just let the broken kicad
>package
>float around on my machine :). I tried to take a stab at fixing it,
>but my knowledge of pkg_add internals is limited.

Have you checked if anything in  pkg_check(8) can help you ?

Source: https://www.openbsd.org/faq/faq15.html

Best Regards,
Strahil Nikolov



Re: Impossible to remove a broken package on 6.5.

2019-09-06 Thread me
On Fri, Sep 06, 2019 at 07:13:21AM -0700, Chris Cappuccio wrote:
> Angelo Rossi [angelo.rossi.home...@gmail.com] wrote:
> > 
> > # pkg_delete -v kicad
> > Can't locate object method "updateset_with_new" via package
> > "OpenBSD::PkgDelete::State" at /usr/libdata/perl5/OpenBSD/Dependencies.pm
> > line 309.
> > 
> 
> Your /usr/libdata/perl5/OpenBSD directory is corrupted, this should exist
> in /usr/libdata/perl5/OpenBSD/PkgAdd.pm
> 
> Your upgrade seems to have failed
> 

The upgrade probably didn't fail.  I ran into the exact same issue with
kicad-20100505p11;  The package is available in 6.4, but was removed
and marked broken in 6.5 due to an issue with python-wx. I think the
error message Angelo Rossi quoted is simply an issue with `pkg_delete`.
Pkg_delete doesn't know what to do with a package that isn't available
anymore.

I didn't know what to do here either. I just let the broken kicad package
float around on my machine :). I tried to take a stab at fixing it,
but my knowledge of pkg_add internals is limited.



Re: Impossible to remove a broken package on 6.5.

2019-09-06 Thread Chris Cappuccio
Angelo Rossi [angelo.rossi.home...@gmail.com] wrote:
> 
> # pkg_delete -v kicad
> Can't locate object method "updateset_with_new" via package
> "OpenBSD::PkgDelete::State" at /usr/libdata/perl5/OpenBSD/Dependencies.pm
> line 309.
> 

Your /usr/libdata/perl5/OpenBSD directory is corrupted, this should exist
in /usr/libdata/perl5/OpenBSD/PkgAdd.pm

Your upgrade seems to have failed