Recent

Author Topic: Package Paths  (Read 430 times)

n2ic

  • New Member
  • *
  • Posts: 17
Package Paths
« on: May 10, 2020, 04:06:12 pm »
Another NOOB question.

I have inherited this project, so I'm dealing with someone else's work. I'm trying to figure out how Lazarus knows where to find the packages that are required for the project. I have attached a screenshot for the Project Inspector. Note the morserunnerpkg near the bottom. Looking at my directory structure, I have found two morserunnerpkg.lpk files. One of them is in ./morse_pkg. The other is in ./MorseRunner/morse_pkg.

Where do I look in the options to find out which is being used ?

Thanks,
Steve


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11459
  • FPC developer.
Re: Package Paths
« Reply #1 on: May 10, 2020, 04:09:23 pm »
packages->install/uninstall packages.

Look at the left side and select your package there.

Then scroll the "package info" memo a bit, and it will list filename

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Package Paths
« Reply #2 on: May 10, 2020, 04:13:49 pm »
Another NOOB question.

I have inherited this project, so I'm dealing with someone else's work. I'm trying to figure out how Lazarus knows where to find the packages that are required for the project. I have attached a screenshot for the Project Inspector. Note the morserunnerpkg near the bottom. Looking at my directory structure, I have found two morserunnerpkg.lpk files. One of them is in ./morse_pkg. The other is in ./MorseRunner/morse_pkg.

Where do I look in the options to find out which is being used ?

Lazarus always picks the last package you opened, so essentially if you have opened both variants of the morse_pkg package you can't find out which package the project really used.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Package Paths
« Reply #3 on: May 10, 2020, 04:22:08 pm »
I'm trying to figure out how Lazarus knows where to find the packages that are required for the project.

Beside what Marco and PascalDragon said, the low-level answer is that the IDE keeps a record of "known" packages in its configuration directory, in the file packagefiles.xml, section "UserPkgLinks".

There is also a section in the project info file ("project.lpi") called "RequiredPackages" where one might find an override, if set; for example:

Code: XML  [Select][+][-]
  1.     <RequiredPackages Count="3">
  2.       <Item1>
  3.         <PackageName Value="LazWiki"/>
  4.         <DefaultFilename Value="lazwiki/lazwiki.lpk" Prefer="True"/>
  5.       </Item1>
  6.       <Item2>
  7.         <PackageName Value="CodeTools"/>
  8.       </Item2>
  9.       <Item3>
  10.         <PackageName Value="LazUtils"/>
  11.       </Item3>
  12.     </RequiredPackages>
(though in this case the exact same package is also stored in packagefiles.xml)
« Last Edit: May 10, 2020, 04:24:12 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018