Recent

Author Topic: Online Package Manager  (Read 839213 times)

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1755 on: February 27, 2020, 06:50:04 am »
Quote
Does the Install "From third party repository" supposed to download from external link (JSON)?
OPM must check if each external link is valid and parse the version number from the remote files for later comparison. When enabled it does it automatically in the background, however the feature is disabled by default. A lot of people were worried that OPM does "work behind the back". Please go to "Options->General->Check for package update" and change from "Never" to something. After the links are parsed you should see the external version number in the "External Repository" column(see attachement), at this point you can install the package from the maintainer's web page.

Quote
When I'm trying to install BGRABitmap from third party repository it says no valid url found. While I can see it has a correct "DownloadZipURL".  BGRABitmap in OPM also need an update.
I must admit this message is obsolete and confusing, it was a valid message when the background search was enabled by default, but not now. I will fix it today, I will also update BGRABitmap.

Quote
Also, can you cache the package list instead of downloading and parsing it all the times. I know the file is small, and I don't mind if it updated in the background. But OPM keep download and parsing the same file which takes a few seconds every time we open OPM.
I can see the server actually send "Last-modified" and "Etag" header that can be used to identify if the file has been modified. Simply stop to download the content if headers contains that header. Or send the http request with "If-Modified-Since: <last-modified>" or "If-None-Match: <etag>", server should respond with "304 Not modified" with no content if it match.
This is a good idea. For slow internet connection, connecting to the server also takes time, maybe I should add a checkbox to Options, with the following text "Parse json from local source if available". If checked OPM doesn't attempt a connection and parse the file locally.
Unfortunately I never noticed the lag, the download and parsing is almost instantaneous for me.

Quote
Another think is, can OPM accept IDE macros for its path like "ConfDir", "PrimaryConfigPath", "SecondaryConfigPath ". This is useful for portable lazarus in removable drive.
OPM communicates with the IDE through the PackageEditingInterface and a lot of IDE specific paths are available.  For example "PrimaryConfigPath", "SecondaryConfigPath" are used by OPM itself.
« Last Edit: February 27, 2020, 08:32:14 am by GetMem »

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1756 on: February 27, 2020, 11:51:36 am »
@ coliv_aja

I did the following(please test with r. 62678):
1. Updated BGRABitmaps and BGRAControls
2. Improved the message related to third party repositories
3. Implemented the package list cashing. If available, now OPM can load the json from local source, but you must enable this feature in options, is disabled by default. After 25 load, OPM will attempt a live update. I can also make the number 25 configurable, but already to many options in OPM...


wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Online Package Manager
« Reply #1757 on: March 22, 2020, 07:33:06 pm »
I finally decided to release LazMapViewer, a component to display GoogleMaps, OpenStreetMaps etc.

GetMem, could you please add the package https://sourceforge.net/projects/lazarus-ccr/files/LazMapViewer/lazmapviewer-v0.2.zip/download to OPM? The json for updating from the external repo is here: https://sourceforge.net/projects/lazarus-ccr/files/LazMapViewer/OPM/update_lazmapviewer.json/download. Hopefully everything is correct...

And avra, could you remove pl_MapViewer from the candidates for ct2laz conversion?

There are still some issues here and there, but maybe wider spread via OPM helps to find motivated users who want to submit patches.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1758 on: March 22, 2020, 09:55:04 pm »
@wp

I added LazMapViewer to OPM. Thanks for the new package.

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Online Package Manager
« Reply #1759 on: March 22, 2020, 10:05:56 pm »
Thanks

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Online Package Manager
« Reply #1760 on: March 23, 2020, 02:37:35 am »
Been thinking about having a play with wp's mapping toolkit for a awhile, if its made easy with onlinepackage manager, how about now ?  Errors, see attached images.
Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1761 on: March 23, 2020, 06:15:14 am »
Hi Davo,

I can confirm the "ambiguous unit found" message, which is just a warning, however I cannot reproduce the error in the second screenshot. I tested both with windows and Linux(Lazarus trunk/FPC 3.0.4). What is the exact error message?   

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Online Package Manager
« Reply #1762 on: March 23, 2020, 06:36:22 am »
Hmm, I don't know about any more messages other than the one shown in the attached image, is there a log file that might have more info ?

All I see is the message box saying "Cannot install package: "lazmapviewer_bgra.lpk"....

The background of the image shows that it was happy opening the package but was unable to compile.

I am using Linux, Lazarus 2.0.7 (fixes) and Ubuntu 18.04.

I guess I should be able to download directly and compile, just to make sure its not something wrong with my install ?   Can I manually compile the copy that onlinepackage manager has downloaded, that would be a better test ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1763 on: March 23, 2020, 06:46:25 am »
Quote
All I see is the message box saying "Cannot install package: "lazmapviewer_bgra.lpk"....
When the message appears, please click "No", then check the message window for more information.

Quote
I guess I should be able to download directly and compile, just to make sure its not something wrong with my install ?   Can I manually compile the copy that onlinepackage manager has downloaded, that would be a better test ?
Yes, but LazMapViewer depends on other packages, so you must install them first(BGRABitmap, RGBGraphics, Synapse). OPM automatically resolves the dependencies if you click "Yes to All".

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Online Package Manager
« Reply #1764 on: March 23, 2020, 08:57:25 am »
OK, I have installed (via the OPM) all except the lazmapviewer_bgra.lpk.  And that went fine.

I allowed the rebuild and then went back into OPM, selected the missing sub package and tried again.

Again I got the message Cannot install .....

After clearing that, in the Lazarus messages window I find -

lazmapviewer_bgra.pas(11,5) Fatal: Cannot find LazarusPackageIntf used by lazmapviewer_bgra. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=/home/dbannon/bin/Lazarus/fixes_2_0/packager/units/x86_64-linux/lazaruspackageintf.ppu. Clean up package "FCL"..

so, lets look in the directory the message mentions -
Code: Pascal  [Select][+][-]
  1. dbannon@dell:~/Pascal/libqt5pas$ ls -la /home/dbannon/bin/Lazarus/fixes_2_0/packager/units/x86_64-linux/
  2. total 60
  3. drwxr-xr-x 2 dbannon dbannon  4096 Feb 22 11:30 .
  4. drwxr-xr-x 4 dbannon dbannon  4096 Oct 16 10:59 ..
  5. -rw-r--r-- 1 dbannon dbannon   317 Feb 22 11:30 FCL.compiled
  6. -rw-r--r-- 1 dbannon dbannon  3560 Feb 22 11:30 fcllaz.o
  7. -rw-r--r-- 1 dbannon dbannon  1461 Feb 22 11:30 fcllaz.ppu
  8. -rw-r--r-- 1 dbannon dbannon 36088 Feb 22 11:30 lazaruspackageintf.o
  9. -rw-r--r-- 1 dbannon dbannon  3693 Feb 22 11:30 lazaruspackageintf.ppu

Its there. But is the message telling me that it should not be there ?  It says "ppu in wrong directory="
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1765 on: March 23, 2020, 09:40:35 am »
@davo

What is your FPC version? If FPC >= 3.2, installing dependent packages can be tricky. It has nothing to do with OPM, you can reproduce the issue by manual install(the infamous invalid ppu error). If your version is 3.0.4 unfortunately I have no idea what is causing the problem.

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Online Package Manager
« Reply #1766 on: March 23, 2020, 10:13:32 am »
Just to make clear: The LazMapViewer package itself is self-contained, it exposes all functionality needed based on standard classes: the download is done by fphttpclient, and rendering is done by LazIntfImage - there is need to install the other packages. The add-on packages were motivated by user request or the history of the original mapviewer component, they provide alternative components to be hooked in for download (synapse) and rendering (RGBAGraphics oder BGRABitmap). It only makes sense to install these packages if the default behavior is not enough, and in fact, I do not see much difference, and rendering with BGRABitmap even seems to be worst of all (maybe/certainly the code can be improved - help is appreciated). Of course, for the add-ons the related packages must have been installed first.

GetMem, is there a way to control the behavior of OPM for this situation? AFAIK, all the sub-packages are checked in OPM for installation when the top-level checkbox is marked. I would prefer to have only LazMapViewer.lpk checked by default and leave the add-ons unchecked to indicate that they are not absolutely needed and do not provide new functionality.

dbannon, I am not sure if the ssl_openssl.pas and ssl_openssl_lib.pas units are correct here. AFAIK, they are not contained in the laz_synapse package, but needed for ssl access by synapse. I think the duplicate unit message occurs because you have these units somewhere else. Try to delete the units in the mapviewer installation, and the compilation should work (not tested). A package not containing all units required easily leads to this mess.

dbannon, I would appreciate if you could have a look at the usage of ssl in the standard package (unit mvdlefpc). I think it has the same issues that you reported for the corona program.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #1767 on: March 23, 2020, 10:18:12 am »
@wp
Quote
GetMem, is there a way to control the behavior of OPM for this situation? AFAIK, all the sub-packages are checked in OPM for installation when the top-level checkbox is marked. I would prefer to have only LazMapViewer.lpk checked by default and leave the add-ons unchecked to indicate that they are not absolutely needed and do not provide new functionality.
I can re-add LazMapViewer to OPM and only LazMapViewer.lpk will be visible, of course a user can install all the other packages manually, but it won't be visible in the package tree.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Online Package Manager
« Reply #1768 on: March 23, 2020, 10:48:51 am »
I finally decided to release LazMapViewer, a component to display GoogleMaps, OpenStreetMaps etc.
Thank you! I will drop related pl_MapViewer and pl_GeoGIS from next version of ct4laz.
EDIT: I have already dropped them. They have px_ prefix instead of pl_ prefix, which means they will be available only for manual download and not via OPM.

As for ssl_openssl_lib warning, it could be solved by either deleting that unit and referencing the same unit from Synapse (be careful since if I remember well original synapse lpk does not register ssl units by default), or to rename that and all other synapse originated units to avoid duplicates.
« Last Edit: March 23, 2020, 10:59:07 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Online Package Manager
« Reply #1769 on: March 23, 2020, 11:17:16 am »
I can re-add LazMapViewer to OPM and only LazMapViewer.lpk will be visible, of course a user can install all the other packages manually, but it won't be visible in the package tree.
Yes I think this is better. Can you do this? Is there a possibility to add a note to the OPM description that there are add-on packages which must be installed manually? I think I will have to adjust the update.json and remove the other packages from it?

 

TinyPortal © 2005-2018