[haiku-development] Re: Package Kit woes - Need help ASAP

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 21 Dec 2016 20:27:44 +0100

On Wed, Dec 21, 2016 at 01:09:42PM -0600, kallisti5 wrote:

Sure, updates are going to be complicated. As i've stated multiple
times up until this point, i'm just looking to refresh the repositories
without writing 100's of lines of dummy classes to trick the package
kit into just saying yes and powering through... refreshing the
repositories.

pkgman does it, and even that can fail in multiple ways:
- No network connection
- The repository is 404 (or some other HTTP error)
- Repository checksum error

It also has a progress bar while downloading the new info (you may not
have noticed, but this can be slow if you don't have a fast internet
access).


That's simply going to require a lot more work than
update_the_whole_os_for_me_because_im_lazy(), no ifs ands or buts, as
is inevitable in any case when dealing with the user is involved.
There are multiple applications in the system using the package kit,
written by different people, so clearly others have managed to
understand how to work with it.

I brought all of this up because I was hoping for someone to step up
and help out with the package kit. I've been asking for a while and
these requests have gone on deaf ears.. At this point it seems pretty
obvious that no-one has the time or cares.

You are acting like the API is broken and you need to rewrite it. Given
all the hard work that has been put into designing the kit, I can
understand people are not really willing to help you.

Moreover, I think you were already pointed to pkgman sources:

http://cgit.haiku-os.org/haiku/tree/src/bin/pkgman/command_refresh.cpp

You cna see the two classes you need to provide:

http://cgit.haiku-os.org/haiku/tree/src/bin/pkgman/JobStateListener.cpp
http://cgit.haiku-os.org/haiku/tree/src/bin/pkgman/DecisionProvider.cpp

A total of about 100 lines, with half of it being the prompt asking
yes/no questions and parsing the user input. It should be very easy to
implement a DecisionProvider that shows a BAlert and a JobStateListener
that updates a status string in a window. The code would probably be
shorter than all the mails you wrote today.

-- 
Adrien.

Other related posts: