Recent

Author Topic: Online Package Manager  (Read 836317 times)

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #615 on: December 23, 2016, 09:58:57 pm »
@Juha
Can you please check if my latest commit fix the CPU load issue?

Quote
It must be a bug. Somebody should report it.
I can report it later, maybe they fixed already. I have to check fpc 3.1.1 again or perhaps somebody has 3.1.1 installed and can do a quick test?
« Last Edit: December 23, 2016, 10:00:44 pm by GetMem »

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #616 on: December 23, 2016, 10:15:22 pm »
I did as you say and I get another error:

Quote
bgratext.pas(119,76) Fatal: no puedo encontrar LCLPlatformDefutilizado por BGRAText de paquete BGRABitmapPack.

The unit in the implementation uses is grayed, but it says it (the error) doesn't matter the unit it's grayed. I'm on 1.6 FPC 3.0.

Code: Pascal  [Select][+][-]
  1. uses
  2.   Classes, Types, SysUtils, BGRAGraphics, BGRABitmapTypes, InterfaceBase, BGRAPen, BGRAGrayscaleMask,
  3.   LCLVersion;
  4.  
  5. ...
  6.  
  7. implementation
  8.        
  9. uses GraphType, Math, BGRABlend, BGRAUTF8 {$IF LCL_FULLVERSION > 1060000}, LCLPlatformDef{$ENDIF};

tk

  • Sr. Member
  • ****
  • Posts: 361
Re: Online Package Manager
« Reply #617 on: December 23, 2016, 10:22:28 pm »
Yes, basically you have to:
1. Create a JSON file with OPM
...

I installed the OPM now and read the wiki, it looks already very good at first look, but I still have some questions.

1. From what I've read, it still does not provide a direct connection to Bitbucket? There I maintain the main repository of KControls (locally via Mercurial). So without this support the OPM can now only work with "stable" or "bugfix" releases stored somewhere on my website?

2. Does it support private packages? I have several packages stored in my private cloud drive and I must always install them manually. It would be great to automate this task via the OPM.

Thank you and Merry Christmas to all





balazsszekely

  • Guest
Re: Online Package Manager
« Reply #618 on: December 23, 2016, 10:39:38 pm »
@lainz
Please check the values in LCLVersion. Perhaps the release or patch version is greater then 0. Anyway this should work(I don't have 1.6 to test):
Code: Pascal  [Select][+][-]
  1. uses GraphType, Math, BGRABlend, BGRAUTF8 {$IF (lcl_major > 0) and (lcl_minor > 6)}, LCLPlatformDef {$ENDIF};

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #619 on: December 23, 2016, 10:58:08 pm »
Quote
I installed the OPM now and read the wiki, it looks already very good at first look.
Thank you.

Quote
1. From what I've read, it still does not provide a direct connection to Bitbucket? There I maintain the main repository of KControls (locally via Mercurial). So without this support the OPM can now only work with "stable" or "bugfix" releases stored somewhere on my website?
I'm not sure what you mean by direct connection. There is no implementation that support Bitbucket api, however OPM can download from Bitbucket. For example I see that the download link to the latest version is: https://bitbucket.org/tkweb/kcontrols/get/d35ac14451b2.zip. With the following JSON, OPM can update KControls whenever is necessary. What is in the zip file is up to you, you can feed stable or trunk version.
Quote
{
  "UpdatePackageData" : {
    "DisableInOPM" : false,
    "DownloadZipURL" : "https://bitbucket.org/tkweb/kcontrols/get/d35ac14451b2.zip",
    "Name" : "kcontrols_1.7"
  },
  "UpdatePackageFiles" : [
    {
      "ForceNotify" : false,
      "InternalVersion" : 1,
      "Name" : "kcontrolsbase.lpk",
      "Version" : "1.7.0.0"
    },
    {
      "ForceNotify" : false,
      "InternalVersion" : 1,
      "Name" : "kcontrolslaz.lpk",
      "Version" : "1.7.0.0"
    }
  ]
}
All you have to do is upload this JSON wherever you like(bitbucket, personal site etc) and send me the link so I can update the main repository. When a new version is out, just change "DownloadZipURL" and increase "Version". OPM will automatically notify the user about a new version.
Quote
2. Does it support private packages? I have several packages stored in my private cloud drive and I must always install them manually. It would be great to automate this task via the OPM.
Yes. Please send as many package you like. You can use the "Create repository package" menu item from OPM, or just paste the link to your package herre and I will add them manually. Make sure your lpk contains a good description and a license info, also please specify the supported widgetset.
« Last Edit: December 23, 2016, 11:04:13 pm by GetMem »

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #620 on: December 23, 2016, 11:07:47 pm »
I'm running trunk/trunk and no LCL version $DEFINE seems to work.  FPC $DEFINES are OK -  though <= and >= seem to be broken.  I'd like to see the solution because I need it in jsoneditor.
I've tried lclversion in the .lpr and as the first item in the form's implementation uses clause.
« Last Edit: December 23, 2016, 11:46:39 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #621 on: December 23, 2016, 11:12:52 pm »
@minesadorada
Thanks for confirming. In this case we should report it.

tk

  • Sr. Member
  • ****
  • Posts: 361
Re: Online Package Manager
« Reply #622 on: December 23, 2016, 11:35:40 pm »
So I started managing all 3rd party packages using OPM. Surprisingly none I've used so far was missing! Excellent work!

...however OPM can download from Bitbucket.

Now I understand and I'll send you the link to the JSON. I think this is sufficient for now. I just wanted to avoid the frequent uploading of the entire zip file somewhere to my web site. Still for future I would appreciate (and I am sure many other package authors as well) that the OPM notifies the users about a change (new commits) in the linked repository (not just for the case the package author forgets to update the JSON). This would need some additional work (add the repository type and url to the JSON + communicate with the repository webservice).

Yes. Please send as many package you like.

I meant private packages with proprietary code created/used in our company, I cannot disclose them. I meant something like adding another (private) remote repository to the OPM settings and add these packages to this repository. OPM would then manage two repositories eg.:
1. http://packages.lazarus-ide.org
2. http://ourprivaterepository.ourdomain.com

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #623 on: December 23, 2016, 11:53:19 pm »
@tk In OPM/Options you can switch repositories at will.
If your package is under svn or similar; using the GUI http://wiki.freepascal.org/OPM_External_Update_json_Editor and a Zip archiver means you get an update out to all OPM users in under 5 minutes.  It only makes sense to offer stable versions to OPM.

I would be good to have documentation about how to set up a private repository server, though.  Perhaps later?
« Last Edit: December 23, 2016, 11:54:55 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

tk

  • Sr. Member
  • ****
  • Posts: 361
Re: Online Package Manager
« Reply #624 on: December 24, 2016, 12:39:04 am »
@tk In OPM/Options you can switch repositories at will.

This I suppose because there is edit box for the repository URL. But still, in future, I would appreciate to manage more repositories concurrently. Switching them would be a mess. Either way, of course a wiki about private repository structure/setup would be necessary.


lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Online Package Manager
« Reply #625 on: December 24, 2016, 02:17:15 am »
@minesadorada
Thanks for confirming. In this case we should report it.

If there's a bug in that functionality better I don't add the unit fix to bgra sources until 1.8 gets real, else it will add more problems to these that are using 3.1 and trunk, only for making it compatible with 1.6 (something that already is).

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #626 on: December 24, 2016, 02:51:15 am »
@lainz I don't know if this helps your situation:

It's possible to isolate fpc v3.1.1 (or other fpc versions) successfully with the current broken trunk functionality:
Code: Pascal  [Select][+][-]
  1. {$IF FPC_VERSION = 3}
  2.   {$IF FPC_RELEASE > 0}
  3.    {$IF FPC_PATCH > 0}
  4.      {$DEFINE FPC311}
  5.     {$ENDIF}
  6.   {$ENDIF}
  7. {$ENDIF}
  8.  

Then:
Code: Pascal  [Select][+][-]
  1. {$IFDEF FPC311}<code that breaks under 3.0.0>{$ENDIF}
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Online Package Manager
« Reply #627 on: December 24, 2016, 03:16:30 am »
Re Laz version detection:

Fiddling around with Trunk/Trunk I found a workaround that works for the initialization section of my unit, where I needed it.  It might be useful for others coding with current trunk.

Here's the state of play with fpc 3.11/laz 1.7 (svn rev 53588m)

The highest scope this can go is after the unit's Interface Uses clause
Code: Pascal  [Select][+][-]
  1. interface
  2. uses lclversion, <other stuff> ;
  3. {$IF LCL_FULLVERSION >= 1070000}
  4.   {$DEFINE LAZ17}
  5. {$ENDIF}
  6.  

From that point on,
Code: Pascal  [Select][+][-]
  1. {$IFDEF LAZ17}<some laz 1.7+ code>{$ENDIF}
works throughout the unit's implementation, initialization (and finalization AFAIK) but obviously not in the Interface Uses clause
It does work in the implementation Uses clause.

The 'greying out' feature of the editor is misleading when using {$IFDEF LAZ17} in this way, but the compiler sees it correctly.

I have no idea if this is a regression, bug or intended behaviour as I haven't needed to test for Laz version before now.
« Last Edit: December 24, 2016, 04:02:42 am by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #628 on: December 24, 2016, 08:26:26 am »
@tk
Quote
I meant private packages with proprietary code created/used in our company, I cannot disclose them. I meant something like adding another (private) remote repository to the OPM settings and add these packages to this repository. OPM would then manage two repositories eg.:
1. http://packages.lazarus-ide.org
2. http://ourprivaterepository.ourdomain.com
Oh, I see! I misunderstood the question. Private repositories are not supported yet, I plan to add it later(most likely in the beginning of January).

@lainz
I was also surprised that {$IF LCL_FULLVERSION >= 1070000} not working in the interface section, however works well below. I used many time in OPM.
Quote
If there's a bug in that functionality better I don't add the unit fix to bgra sources until 1.8 gets real, else it will add more problems to these that are using 3.1 and trunk, only for making it compatible with 1.6 (something that already is).
Yes, that's a good idea. Those who use Lazarus trunk can tweak the source anyway.

@minesadorada
Quote
The highest scope this can go is after the unit's Interface Uses clause
We came to the same conclusion, but is a bug an should be reported. I will ask in the devlist later, maybe somebody knows more about this issue.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Online Package Manager
« Reply #629 on: December 24, 2016, 09:50:48 am »
Code: Pascal  [Select][+][-]
  1. interface
  2. uses lclversion, <other stuff> ;
  3. {$IF LCL_FULLVERSION >= 1070000}
  4.   {$DEFINE LAZ17}
  5. {$ENDIF}
  6.  
Do you mean the ">=" operator works also in FPC trunk after all?

Quote
The highest scope this can go is after the unit's Interface Uses clause
We came to the same conclusion, but is a bug an should be reported. I will ask in the devlist later, maybe somebody knows more about this issue.
I had understood the bug was ">=" operator not working.
The condition does not work inside the Interface Uses clause although it works in Interface section otherwise.
That may be a feature instead of a bug. Reading the unit references may be done in one chomp. LCL_FULLVERSION is not evaluated yet then.
Better ask in FPC list.
« Last Edit: December 24, 2016, 10:10:08 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018