DEV Community

hythm
hythm

Posted on

Pakku Through Images

Pakku is a package manager for the Raku Programming Language. Latest releases of Pakku are part of Pakku Celastrina version family. Celastrina name means elegant and beutiful, So I will take the opportunity to introduce how elegant IMO Pakku handles Raku distributions.

NOTE
Pakku uses unicode, emojis and colors quite a lot, This might not be everyone's cup of tea, or may be the terminal doesn't support them, so at the end of the post I will show how to disable or customize these features through configurations.

Install Pakku

After clonning Pakku repository, one can run raku -I. bin/pakku add . within the cloned repository to install Pakku:

add pakku

As shown Pakku installed successfully, and the default verbosity level info was used, which shows the important information for installation steps:

  • Staging the distribution.
  • Testing the distribution.
  • List binaries installed to the system.

If more information during installation is needed, one can raise the verbosity level.

Install Raku Distribution

To install Raku distribution one can run pakku add MyDist

add dist

Raising the verbosity to level now makes Pakku output what it is doing at the moment. As shown in the above image, Pakku keeps the user informed when Fetching the distribution, Compiling the distribution modules, also when running the individual tests. and the information flows seamlessly with the progress bar.

More information can be viewed by setting the verbosity level to debug.

There is also all verbosity level, which shows all possible information, including the tests output and much more informations.

here is an example of how it might look when run Pakku with all verbosity level. That might look like a lot of information, but once get used to it, it looks familiar.

Please disregard the dont option in the above image, it basically means do all steps but don't commit any changes to the installation repositories. (equivalent to dry-run in other programs).

Search Raku Distribution

To search Raku distributions one can run pakku search MyDist

search dist

The search is relaxed by default, so many dists can be returned (search modules of dist as well), one can pass norelaxed option to narrow the search.

Also if one is interested in latest version only, latest option can be passed to the search command:

search latest dist

Pakku Configurations

The configuration modules consist of:

  • Pakku general config module.
  • A module for each Pakku command (eg. add, remove, search etc.).
  • Log module.
  • Recommendation manager module.

To view the configs of a module, for instance pakku general configs module:

config view

To disbale colors, bar and spinner, one can run:

pakku config pakku disable pretty bar spinner

Changing colors or replacing emojis with ascii characters can be done via the config command as well, however I will make these changes directly in the config file as below:

config change

And here is how it looks after customization:

pakku customized

To reset configuration:
pakku config reset

To create a new config file:
pakku config new

That's it for now, Thanks for viewing!

Top comments (3)

Collapse
 
2colours profile image
2colours

It seems you are consciously using the word "distribution" so let me ask for your confirmation: does Pakku really search and install distributions based on distribution metadata, rather than preferring module-level metadata the way Zef kind of does?

Collapse
 
hythm7 profile image
hythm • Edited

That is correct. Pakku first check if there is a distribution with the provided name, if found then install this distribution. Only if there is no distribution matching the provided name, Pakku then search for modules.

For example, the ecosystem contains NativeLibs:ver<0.0.9> distribution, and DBIish:ver<0.6.1> distribution (which provides a NativeLibs module). If one run pakku add NativeLibs, then NativeLibs:ver<0.0.9> will be installed.

If preferring modules over distribution one might end up installing DBIish instead of the dsired NativeLibs, because DBIish provides a higher version of NativeLibs module.

Hopefully that answers the question, if not let me know.

Collapse
 
2colours profile image
2colours

Thank you, this was exactly the kind of situation that made me wonder. ^^