Recent

Author Topic: Online Package Manager  (Read 836070 times)

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #990 on: October 13, 2017, 11:02:40 am »
@cpicanco
Quote
Can we use OPM as a "library" to build autoupdate functionality to a program?
Search for LazAutoUpdate component(OPM), it was designed exactly for this kind of functionality. For more details please contact forum user @minesadorada . He's the author of the package.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #991 on: October 13, 2017, 11:23:21 am »
@Alextp
Quote
And IMO: opkman should moderate these descriptions.
I hope you didn't expect me to go through all the packages, test their functionality then write a detailed description.  Other then the large amount of work isn't ethical...I mean modifying the description(or any other property) without the consent of the package developer is an asshole thing to do. Perhaps it would be OK to modify those packages that are not maintained, but what if the package developer comes back? Actually I already did modified some of the unmaintained packages and I feel slightly wrong about it.

Bug report.
Quote
Linux x64 gtk2 [Ubuntu 16]. Confirm message "do you want to restart IDE" shows below OPM dialog. It's not visible until i alt-tab to IDE.
The dialog "do you want to restart the IDE" is called by Lazarus through IDECommand, basically I do:
Code: Pascal  [Select][+][-]
  1. IDECommands.ExecuteIDECommand(Self, ecBuildLazarus);
The rest is up to Lazarus. I have no control over the dialog visibility.
« Last Edit: October 14, 2017, 07:33:43 am by GetMem »

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Online Package Manager
« Reply #992 on: October 13, 2017, 11:58:31 am »
But you can close Opkman dialog, before calling IDE messagebox. maybe on Linux only.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #993 on: October 13, 2017, 12:07:46 pm »
But you can close Opkman dialog, before calling IDE messagebox. maybe on Linux only.
Yes I can do that, but what if the user choose NOT to rebuild Lazarus? OPM is already closed, Lazarus is not rebuilding, is a weird scenario. Perhaps a better solution would be to implement a ecBuildLazarusNoConfirmation, where the confirmation is skipped inside Lazarus. Then I can ask the user from OPM itself, I don't have to rely on the implementation from Lazarus main unit.

cpicanco

  • Hero Member
  • *****
  • Posts: 618
  • Behavioral Scientist and Programmer
    • Portfolio
Re: Online Package Manager
« Reply #994 on: October 13, 2017, 12:36:06 pm »
@cpicanco
Quote
Can we use OPM as a "library" to build autoupdate functionality to a program?
Search for LazAutoUpdate component(OPM), it was designed exactly for this kind of functionality. For more details please contact forum user @minesadorada . He's the author of the package.

Thanks!
Be mindful and excellent with each other.
https://github.com/cpicanco/

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: Online Package Manager
« Reply #995 on: October 15, 2017, 11:58:23 am »
Hello Online Package Manager team,

In good internet connection I can use this feature but if my connection isn't good it can be very painful for me.

Because (I think) time outs very short and if there are some problems linux mint desktop can be destroy/collapse.

Ofcourse I can download all packages from the http://packages.lazarus-ide.org/ but I would like to install in the lazarus.

Best regards

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #996 on: October 15, 2017, 12:18:21 pm »
Hi tr_escape,

You can still use OPM if you have a http server installed on your local computer. If yes, please do the following:
1. Download the main repository from here: https://packages.lazarus-ide.org/opm.zip (you need a good connection for this, the zip file is relatively large ~190 MB)
2. Extract the zip to a folder, "packages" for example
3. Start the local server
4. Start OPM, go to Options-->Genereal-->Remote repository, click the "..." button, then add the following address: http://localhost/packages/  Close the dialog, select the local server, then click "OK"

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Online Package Manager
« Reply #997 on: October 15, 2017, 12:57:29 pm »
In good internet connection I can use this feature but if my connection isn't good it can be very painful for me.
Because (I think) time outs very short ...
Where is the timeout delay defined? It should be longer, similar to what browsers and FTP clients have.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: Online Package Manager
« Reply #998 on: October 15, 2017, 01:13:20 pm »
In good internet connection I can use this feature but if my connection isn't good it can be very painful for me.
Because (I think) time outs very short ...
Where is the timeout delay defined? It should be longer, similar to what browsers and FTP clients have.


 PackageDownloader.DownloadJSON(10000);

https://github.com/graemeg/lazarus/blob/upstream/components/onlinepackagemanager/opkman_mainfrm.pas#L260

I changed to my local lazarus to 60000 but also not solving directly my problems because my computer isn't very fast.
I think the thread methods must be change to switch-case for succesing.

Unfortunately in the world we haven't got good conditions for communication :(



balazsszekely

  • Guest
Re: Online Package Manager
« Reply #999 on: October 15, 2017, 01:32:14 pm »
The json is only 320 KB. 10 sec should be more then enough even with a slow internet connection. Your second screenshot indicates that you have no connection at all. Please check my previous post, it's a good workaround using a local server. You have to download the opm.zip only once.

PS: Nowadays a good internet connection should be something trivial. I also leave in a pretty crappy country, still the internet speed is very good.
« Last Edit: October 15, 2017, 01:38:41 pm by GetMem »

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: Online Package Manager
« Reply #1000 on: October 15, 2017, 02:53:08 pm »
The json is only 320 KB. 10 sec should be more then enough even with a slow internet connection. Your second screenshot indicates that you have no connection at all. Please check my previous post, it's a good workaround using a local server. You have to download the opm.zip only once.

PS: Nowadays a good internet connection should be something trivial. I also leave in a pretty crappy country, still the internet speed is very good.

Ok I will try and downloading...

So actually I can do all of this manually of course but when I use any software I am looking as a end user even newbie developer.

If happen any unwanted step in my software as looking end user it will be happen again...

I collect another warnings too when attemp to connect from lazarus to http://packages.lazarus-ide.org/.

Lazarus going to go endless loop.

But I am downloading opm.zip with by firefox there is no connection problem this means there is a/some problem(s) in the package man.

However I will change the my local codes if I get success I'll share.
I also will try to local web server too.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1001 on: October 15, 2017, 03:31:22 pm »
What is your Lazarus/FPC/OPM version?
OPM uses fphttpclient(FPC) to communicate with the main repository. It is possible that TFPHTTPClient/OPM still has some bugs, but until now I never saw a single connection issue. That doesn't mean your problem is not real, probably on low internet speed strange things start to happen. Please try to debug the code and find out where it fails, but first run the following code and tell me what happens:
Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3.  {$mode objfpc}{$H+}
  4.  
  5.  uses
  6.    {$IFDEF UNIX}{$IFDEF UseCThreads}
  7.    cthreads,
  8.    {$ENDIF}{$ENDIF}
  9.    Classes,
  10.    fphttpclient
  11.    { you can add units after this };
  12.  
  13.  
  14.  var
  15.    FHTTPClient: TFPHTTPClient;
  16.  begin
  17.    FHTTPClient := TFPHTTPClient.Create(nil);
  18.    try
  19.      FHTTPClient.Get('http://packages.lazarus-ide.org/packagelist.json', 'packagelist.json');
  20.      if FHTTPClient.ResponseStatusCode = 200 then
  21.        Writeln('Successfully downloaded')
  22.      else
  23.        Writeln('Cannot download file!');
  24.      Readln;
  25.    finally
  26.      FHTTPClient.Free;
  27.     end;
  28.  end.

PS: In r. 56059 you can configure the timeout(see attached image).
« Last Edit: October 15, 2017, 03:40:46 pm by GetMem »

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1002 on: October 15, 2017, 04:06:20 pm »
@avra
https://bugs.freepascal.org/view.php?id=32551   :D

OPM has a local copy of fphttpclient, I fixed the issue there(r. 56060). If you use fpc3.1.1 or newer you must fix it in fpc source or wait until the official patch. I used "123" both for username and password in my original test, this is why it worked.  :-[
« Last Edit: October 16, 2017, 05:34:24 am by GetMem »

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: Online Package Manager
« Reply #1003 on: October 15, 2017, 05:38:40 pm »
I working with by fpc and lazarus trunk and downloaded by fpcupdeluxe 1.4.0s

I tried the example project it gives Esocketerrors


balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1004 on: October 15, 2017, 06:06:13 pm »
Quote
tr_escape
I tried the example project it gives Esocketerrors
This is obviously a connection problem at your side. How Firefox manage to work in this condition is a mystery to me.

 

TinyPortal © 2005-2018