Git Product home page Git Product logo

pakku's Introduction

WHAT?

Pakku - A Package Manager for Raku

WHY?

Because TMTOWTDI

WHEN?

When she become a fully grown butterfly. currently Pakku is at larva.0 version and growing. She can do basic stuff but still little clumsy!

MOTTO

Light as a ๐Ÿฆ‹, Colorful as a ๐Ÿฆ‹

INSTALLATION

Pakku installs herself in a custom CompUnit::Repository outside of Raku's default repos.

Requires git to be available in $PATH

git clone https://github.com/hythm7/Pakku.git

cd Pakku

# install to home directory
./tools/install-pakku.raku

# or to different destination
# ./tools/install-pakku.raku --dest=/path/to/pakku


# if you prefer a ready to use distribution:
# wget https://github.com/hythm7/Pakku/raw/master/distribution/Pakku-larva.0.txz
# tar xf Pakku-larva.0.txz  # Pakku location: .pakku/bin/pakku

FEATURES

  • Add distribution
  • Remove distribution
  • List distribution
  • Build distribution
  • Test distribution
  • Download distribution

Overview

Pakku is shy butterfly, she is a bug of little words, So every Pakku command result will be one of:

  • Ofun - Desired operation completed successfully
  • Nofun - Desired operation did not complete successfully
  • All Good - Nothing to be done (eg. removing uninstalled distribution)

Of course unless Pakku panicked and she doesn't know what to do, then you will be greeted with an Exception

However Pakku can be really talkative when need be. She suggests her new friends set the verbosity level to at least info specially when adding a Distribution with many dependencies or multiple Distributions at once.

USAGE

Add distribution

pakku add MyModule
pakku add nodeps MyModule
pakku add notest MyModule
pakku add into   /opt/MyApp MyModule
pakku add force  into home  MyModule1 MyModule2


Options:

deps            โ†’ add dependencies
nodeps          โ†’ dont add dependencies
deps requires   โ†’ add required dependencies only
deps recommends โ†’ add required and recommended dependencies
deps only       โ†’ add dependencies only
build           โ†’ build distribution
nobuild         โ†’ bypass build
test            โ†’ test distribution
notest          โ†’ bypass test
force           โ†’ force add distribution even if installed
noforce         โ†’ no force
into <repo>     โ†’ add distribution to repo <home site vendor core /path/to/MyApp>

Remove distribution

pakku remove MyModule


Options:

from <repo> โ†’ remove distribution from provided repo only

List distribution

pakku list
pakku list MyModule
pakku list local   MyModule
pakku list remote  MyModule
pakku list details MyModule
pakku list repo home
pakku list repo /opt/MyApp MyModule


Options:

local       โ†’ list local
remote      โ†’ list remote
details     โ†’ list details
repo <name> โ†’ list repo

Build distribution

pakku build MyModule
pakku build .

Test distribution

pakku test MyModule
pakku test ./MyModule

Pakku Options

pakku update   add MyModule
pakku noupdate add MyModule
pakku dont     add MyModule
pakku nopretty add MyModule
pakku verbose  trace  add    MyModule
pakku pretty   please remove MyModule


Options:

update          โ†’ update ecosystem to get latest before adding distribution
pretty          โ†’ colorfull butterfly
nopretty        โ†’ no color
dont            โ†’ do everything but dont do it
verbose <level> โ†’ verbose level <silent trace debug info warn error fatal>
please          โ†’ be nice to the butterfly, she will be nice to you (TBD)

Check distribution (download)

pakku check MyModule

Print Help

pakku
pakku add
pakku help
pakku help list
pakku help help

Feeling Perlish Today?

Most of Pakku commands and options can be written in shorter form, for example:

add    โ†’ a     update  โ†’ u     noupdate โ†’ nu    silent โ†’ ยซS 0ยป
remove โ†’ r     pretty  โ†’ p     nopretty โ†’ np    trace  โ†’ ยซT 1ยป
list   โ†’ l     deps    โ†’ d     nodeps   โ†’ nd    debug  โ†’ ยซD 2ยป
build  โ†’ b     force   โ†’ f     noforce  โ†’ nf    info   โ†’ ยซI 3ยป
test   โ†’ t     verbose โ†’ v     details  โ†’ d     warn   โ†’ ยซW 4ยป
check  โ†’ c     local   โ†’ l     local    โ†’ l     error  โ†’ ยซE 5ยป
help   โ†’ h     remote  โ†’ r     remote   โ†’ r     fatal  โ†’ ยซF 6ยป

So this is a valid Pakku command:

pakku nu vD a f nt MyModule

Did I mention that the below are Pakku commands as well?

pakku ๐›’ โŸณ โ†“ ๐Ÿ”— ๐Ÿ”จ MyModule
pakku ๐Ÿ‘“ ๐Ÿฆ‹ โ†‘ MyModule
pakku โ†ช ๐ŸŒŽ
pakku โ“

Can you guess what they do? A full list is here,You can add you favourite ones too if you like.

CONFIGURATION

All options can be set in command line or in the config file pakku.cnf in installtion dir. Config file example is provided below:

### Pakku Config

# <pakku>
#   update           # update ecosystem
#   pretty           # colors
#   verbose info     # < 0 1 2 3 4 5 6 >
#   dont             # dont do it (dry run)
#
# <add>
#   deps       # add deps as well < deps nodeps only requires recommends >
#   build      # build            < build nobuild >
#   test       # test             < test notest >
#   force      # force install    < force noforce >
#   into  home # install into specific repo 
#
# <remove>
#   from home  # remove from specific repo
#
# <list>
#   local   # local  dists
#   remote  # remote dists
#   details # list   details
#
# custom Log colors, also override unicode
# if symbols not showing
# <log>
#   trace name T:
#   debug name D:
#   info  name I:
#   warn  name W:
#   error name E:
#   fatal name F:
#
#   trace color reset
#   debug color green
#   info  color blue
#   warn  color yellow
#   error color magenta
#   fatal color red

# Add your own source provided it contains
# a valid list of distributions meta files
<source>
https://raw.githubusercontent.com/hythm7/raku-ecosystem/master/resources/ecosystem.json

NOTES

Pakku ecosystem source is a github file that contains available modules in p6c and cpan. Its LTA, slow and doesn't scale well (needs to download the file and parse it).

Ideally there need to be an online Recommendation Manager service which can be used by Raku's package managers to send a request for a Distribution and get back json contains the Distribution's META along with it's dependencies. Working on such online Recommendation Manager will take time and I wanted to release Pakku sooner. I might work on such Recommendation Manager after Pakku becomes little more stable.

Known Issues

  • %?RESOURCES is not available inside a custom repo during the testing phase, might cause test failure for some modules, see here for more info. as temporary workaround you can bypass tests if it failed in custom repo installation.

  • There is version of File::Directory::Tree:ver<0.000.001> in the ecosystem it's source-url points to a different version File::Directory::Tree:ver<*>, This causes an issue for Pakku if File::Directory::Tree:ver<*> is already installed, first Pakku will see a different version, but when get source-url and start installing an error will be thrown that this version is already installed. as a temp workaround use force

TODO

  • Write more tests
  • Fix bugs
  • Redo things if a better way revealed to me
  • Improve the performance to live up to the motto

CAVEATS

Currently Pakku Works on GNU/Linux, Unfortunately I don't have access to Windows or Mac machine to test and make it compatible with different Operating Systems. However, PRs are very welcome :)

CREDITS

Thanks to Panda and Zef, for Pakku inspiration. also Thanks for the nice #perl6 and #raku community.

AUTHOR

Haytham Elganiny elganiny.haytham at gmail.com

COPYRIGHT AND LICENSE

Copyright 2019 Haytham Elganiny

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

pakku's People

Contributors

hythm7 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.