Pakku
Pakku
Package Manager for the Raku Programming Language.
Installation
Usage
Pakku manages Raku distributions with commands like add
, remove
, update
etc.
Full command consists of:
pakku [general-options] <command> [command-options] <dists>
There are two types of options:
General options:
These are the options that control the general behavior of Pakku, eg. specify the configuration file, run asynchronously or disable colors. The general options are valid for all commands, and must be placed before the command.
Command options:
These are the options that control the specified command, for example when installing a distributions one can add notest
option to disable testing. these options must be placed after the command.
Pakku Commands
add
Install distributions
options:
Examples:
remove
Remove distributions
options:
Examples:
list
List installed distributions
options:
Examples:
search
Search available distributions
options:
Examples:
build
Build distributions
Examples:
test
Test distributions
options:
Examples:
update
Update distributions to latest version
options:
Examples:
state
Check the state of installed distributions
options:
Examples:
download
Download distribution source
Examples:
nuke
Nuke directories
Examples:
config
Each Pakku command like add
, remove
, search
etc. corresponds to a config module with the same name in the config file.
one can use config command to enable
, disable
, set
, unset
an option in the config file.
options:
Examples:
help
Get help on a specific command
Examples:
Pakku General Options
Options:
Examples:
Most of Pakku
commands and options can be written in shorter form, for example:
The below are Pakku
commands as well!
ENV Options
Options can be set via environment variables as well:
General
Add
Test
Remove
List
Search
Update
State
Pakku Output
Pakku output aims to be tidy and concise, uses emojis, colors and three letters key words to convey messages.
For example, the π¦
emoji indicates that Pakku is starting a task, while π§
means Pakku successfully completed a task.
An output line like:
π¦ BLD: ο½’Inline::Perl5:ver<0.60>:auth<cpan:NINE>:api<>ο½£
means Pakku is starting to build Inline::Perl5:ver<0.60>:auth<cpan:NINE>:api<>
, and based on the result another output line could be:
π§ BLD: ο½’Inline::Perl5:ver<0.60>:auth<cpan:NINE>:api<>ο½£
# build success
π¦ BLD: ο½’Inline::Perl5:ver<0.60>:auth<cpan:NINE>:api<>ο½£
# build failure
Below is a list of output lines that one can see and their meaning:
π§ ADD β start add command
π¦ SPC β processing Spec
π¦ MTA β processing Meta
π¦ FTC β fetching
π¦ BLD β building
π¦ STG β staging
π¦ TST β testing
π§ BLD β build success
π§ TST β test success
π§ BIN β binary added
π WAI β waiting
π TOT β timed out
π¦ SPC β error processing Spec
π¦ MTA β error processing Meta
π¦ BLD β build failure
π¦ TST β test failure
π¦ CNF β config error
π¦ CMD β command error
Pakku verbosity levels:
- 1 `ο½’ all ο½£` π β All avaialble output
- 2 `ο½’debugο½£` π β Debug output
- 3 `ο½’ now ο½£` π¦ β What is happenning now
- 4 `ο½’info ο½£` π§ β Important things only
- 5 `ο½’warn ο½£` π β Warnings only
- 6 `ο½’errorο½£` π¦ β Errors only
- 0 `ο½’nothingο½£` β Nothing
[!WARNING] Pakku uses emoji and ANSI escape codes, If your terminal doesn't support them, you can disable colors, bars and spinners, (eg.
pakku nopretty nobar nospinner add Foo
), or disable permanently in config file. also for emojis, eg. to change thedebug
emoji for example, in config file replace"debug": {"prefix": "π"}
with"debug": {"prefix": "D"}
.
Command result:
-Ofun
- SuccessNofun
- Failure
Gotchas
Caching downloaded distributions
When one installs a distribution via pakku add dist
, Pakku first looks in the local cache to see if there is a downloaded distribution matches dist
specification, if nothing found in the cache, Pakku then searches the configured RecMan
and obtain the latest version of dist
(e.g. dist:ver<0.4.1>
), download, cache, and install it.
After sometime when a new version dist:ver<0.4.2>
is released and available in RecMan
, if one try to install dist
via pakku add dist
, what happens is Pakku will find dist:ver<0.4.1>
available in local cache and will install that version because it matches dist
specification. so one will not get the latest version dist:ver<0.4.2>
.
There are two ways to avoid this and get the latest version, either specify the version e.g. pakku add dist:ver<0.4.2>
or disable cache lookup e.g. pakku nocache add dist
(also, one can permenantly disable cache in config file).
Pakku installs to site repo by default
If the user doesn't have rw
permision to site
repo, one can change the default repo to home
in config file using:
pakku config add set to home
or specify the repo in the command e.g. pakku add to home dist
Credits
Thanks to Panda
and Zef
for Pakku
inspiration.
also Thanks to the nice #raku
community.
Motto
Light like a π§, Colorful like a π§
Author
Haytham Elganiny elganiny.haytham at gmail.com
Copyright and License
Copyright 2023 Haytham Elganiny
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.