DEV Community

hythm
hythm

Posted on

Pakku State Update

Pakku is a package manager for the Raku Programming Language. In this post I'm going to introduce two Pakku commands, state and update.

state

state command gives an overview of the current state of installed distributions. eg. if there are missing dependencies, if a dist can be updated to a higher version or can be cleaned from the system. etc.

To check the current state of installed Raku dists:

> pakku state
1 - 🦋 STT: 「...」
2 - 🦋 UPD: 「App::Rak:ver<0.2.17>:auth<zef:lizmat>:api<>」
3 - 🦋 UPD: 「App::Rak:ver<0.2.16>:auth<zef:lizmat>:api<>」
4 - 🧚 STT: 「App::Rak:ver<0.2.15>:auth<zef:lizmat>:api<>」
...
  1. Reading current state, basically go through all installed dists and check if all deps are met, any updates available, etc.
  2. There is an update available for App::Rak dist.
  3. Same as above but another version.
  4. The current state of installed App::Rak dist is OK, no issues.
🧚 STT: 「Backtrace::Files:ver<0.0.3>:auth<zef:lizmat>:api<>」
🧚 STT: 「CLI::Version:ver<0.0.8>:auth<zef:lizmat>:api<>」
🧚 STT: 「Git::Files:ver<0.0.6>:auth<zef:lizmat>:api<>」
🧚 STT: 「IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>:api<>」
...

The state of the above dists look fine, no issues, no updates available, no missing deps.

🐞 DEP: 「JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>」 missing!
🦗 STT: 「JSON::Fast::Hyper:ver<0.0.3>:auth<zef:lizmat>:api<>」
...

There is a dependency missing, basically JSON::Fast::Hyper depends on JSON::Fast, but JSON::Fast is not installed. So state of JSON::Fast::Hyper is not OK.

🦋 UPD: 「String::Utils:ver<0.0.21>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.20>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.19>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.18>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.17>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.16>:auth<zef:lizmat>:api<>」
🧚 STT: 「String::Utils:ver<0.0.15>:auth<zef:lizmat>:api<>」
...

There are multiple updates available for installed String::Utils dist.

1 - 🦋 UPD: 「paths:ver<10.0.9>:auth<zef:lizmat>:api<>」
2 - 🧚 STT: 「paths:ver<10.0.8>:auth<zef:lizmat>:api<>」
3 - 🦋 CLN: 「paths:ver<10.0.8>:auth<zef:lizmat>:api<>」
4 - 🧚 STT: 「paths:ver<10.0.9>:auth<zef:lizmat>:api<>」
5 - 🧚 STT: 「rak:ver<0.0.47>:auth<zef:lizmat>:api<>」
...
  1. There is an update available for paths dist
  2. the current state of paths:ver<10.0.8> dist is OK
  3. paths:ver<10.0.8> dist can be cleand, this means there is a higher version already installed (which is evident by next line), and no other dists depend on it.
  4. paths:ver<10.0.9> dist state is OK
  5. rak dist state is OK

Now I have an overview of the current state of the system, and if more info needed, I can run in debug mode and see more information like, dist dependencies, reverse dependencies, etc.

With this info I can install the missing deps or clean not needed dists. I also can update the system to get latest available versions, which what I'll do in the next section of this post.

update

update command is used for updating all installed dists or specific dist to latest available version.

From previous section I found out that there are updates for App::Rak and String::Utils dists, there is also a missing dependency JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO> and some dists can be cleaned.

So time to run the update command:

> pakku update
...
🦋 STT: 「...」
🦋 UPD: 「App::Rak:ver<0.2.17>:auth<zef:lizmat>:api<>」
🦋 UPD: 「String::Utils:ver<0.0.21>:auth<zef:lizmat>:api<>」
🦋 UPD: 「paths:ver<10.0.9>:auth<zef:lizmat>:api<>」
...

The update command starts by reading the current state, identify the updatable dists and resolve deps...

🧚 TST: 「JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>:api<>」
🦋 STG: 「App::Rak:ver<0.2.17>:auth<zef:lizmat>:api<>」
🦋 TST: 「App::Rak:ver<0.2.17>:auth<zef:lizmat>:api<>」
🦋 TST: 「01-basic.rakutest」
🧚 TST: 「App::Rak:ver<0.2.17>:auth<zef:lizmat>:api<>」
🦋 STG: 「String::Utils:ver<0.0.21>:auth<zef:lizmat>:api<>」
🦋 TST: 「String::Utils:ver<0.0.21>:auth<zef:lizmat>:api<>」
🦋 TST: 「01-basic.rakutest」
🦋 TST: 「02-selective-importing.t」
🧚 TST: 「String::Utils:ver<0.0.21>:auth<zef:lizmat>:api<>」
🧚 BIN: 「rak」

Installed JSON::Fast missing dep, updated App::Rak and String::Utils

🦋 RMV: 「App::Rak:ver<0.2.15>:auth<zef:lizmat>:api<> paths:ver<10.0.8>:auth<zef:lizmat>:api<>」
🦋 RMV: 「App::Rak:ver<0.2.15>:auth<zef:lizmat>:api<>」
🦋 RMV: 「paths:ver<10.0.8>:auth<zef:lizmat>:api<>」
🧚 -Ofun

Cleaning the not needed dists, the older versions of App::Rak and paths.
One might notice that String::Utils:ver<0.0.15> was not cleaned, and that is because App::Rak depends on that specific version.

If one doesn't want to clean older versions of dists, noclean option can be provided to update command.

Thanks for reading!

Top comments (0)