Git Product home page Git Product logo

pacm's Introduction

Pacm

Simple package manager for managing binary applications. A simple ini config is used to declare what packages should be installed and managed. pacm won't attempt to add itself to your PATH, this will need to be done manually.

pacm works with a single config file. This config file can declare packages and recipes. A recipe is a definition for where to download the recipe from and how to extract the recipe. A package is a combination of recipe and a version of that recipe: <recipe>@<version. These can be defined in your config file.

Recipes

Some default ones can be found at https://github.com/vishen/pacm-recipes.

New recipes can be added to your config file and will take precendence over recipes from any remote recipes.

Config

Will by default look for a config path at ~/.config/pacm/config.

dir=/some/path/on/disk

[[email protected]]
	active=true
[[email protected]]

[[email protected]]
	active=true
[[email protected]]

[[email protected]]
[[email protected]]
	active=true

dir indicates which directory to install binaries to. This will need to be added to your path.

[<recipe>@<version>] where recipe is a [recipe <name>] declared somewhere in a config file (ie: https://github.com/vishen/pacm-recipes/blob/e22e9659bfdaee20ade7a1654753c05a41597426/kubectl/recipe.ini).

Installing

go get -u github.com/vishen/pacm

Commands

Simple package manager for binaries

Usage:
  pacm [command]

Available Commands:
  activate     Activate packages
  clean        Clean up cached archives
  ensure       Ensure that your binaries are up-to-date
  help         Help about any command
  list-updates Available updates for installed package
  status       Status of installed packages
  update       Update packages

Flags:
  -f, --config string      pacm config file to load (defaults to ~/.config/pacm/config)
  -d, --download-remotes   download remote package repositories
  -h, --help               help for pacm
  -x, --log-commands       log commands being run
  -v, --verbose            verbose debug logging

Use "pacm [command] --help" for more information about a command.

Running

Make sure that you have added the dir path to you PATH, otherwise you won't have the installed binaries available to you.

When running pacm activate and pacm update, your ini config will be overwritten to reflect the changes you have made.

# Ensure that your config file and what is installed on disk is correct.
$ pacm ensure

$ terraform version
Terraform v0.12.0-rc1

Your version of Terraform is out of date! The latest version
is 0.12.0. You can update by downloading from www.terraform.io/downloads.html

# Active a package <recipe>@<version>. 
# NOTE: The package needs to be in your config file (otherwise use pacm update).
$ pacm activate [email protected]

$ terraform version
Terraform v0.11.13

Your version of Terraform is out of date! The latest version
is 0.12.0. You can update by downloading from www.terraform.io/downloads.html

# List updates from github about a recipe.
$ pacm list-updates terraform
+--------------------------+------------------+--------------+-------------------------------+
|           TAG            |      STATUS      | GITHUBSTATUS |           PUBLISHED           |
+--------------------------+------------------+--------------+-------------------------------+
| [email protected]        |                  |              | 2019-05-22 20:24:00 +0000 UTC |
| [email protected]    | installed        | pre-release  | 2019-02-28 22:59:41 +0000 UTC |
| [email protected] |                  | pre-release  | 2018-10-20 00:49:09 +0000 UTC |
| [email protected]       |                  |              | 2019-05-16 20:49:01 +0000 UTC |
| [email protected]       | active,installed |              | 2019-03-11 18:51:43 +0000 UTC |
| [email protected] |                  | pre-release  | 2019-01-28 12:39:21 +0000 UTC |
| [email protected]       |                  |              | 2019-03-08 20:09:11 +0000 UTC |
| [email protected]       |                  |              | 2018-10-23 15:06:04 +0000 UTC |
| [email protected]  |                  | pre-release  | 2018-10-15 20:24:38 +0000 UTC |
| [email protected]    |                  | pre-release  | 2017-11-09 19:59:50 +0000 UTC |
| [email protected]  |                  | pre-release  | 2017-11-03 23:48:26 +0000 UTC |
| [email protected]        |                  |              | 2017-11-16 19:34:52 +0000 UTC |
+--------------------------+------------------+--------------+-------------------------------+

# Update a recipe.
$ pacm update [email protected]

$ terraform version
Terraform v0.12.0

$ pacm list-updates terraform
+--------------------------+------------------+--------------+-------------------------------+
|           TAG            |      STATUS      | GITHUBSTATUS |           PUBLISHED           |
+--------------------------+------------------+--------------+-------------------------------+
| [email protected]        | active,installed |              | 2019-05-22 20:24:00 +0000 UTC |
| [email protected]    | installed        | pre-release  | 2019-02-28 22:59:41 +0000 UTC |
| [email protected] |                  | pre-release  | 2018-10-20 00:49:09 +0000 UTC |
| [email protected]       |                  |              | 2019-05-16 20:49:01 +0000 UTC |
| [email protected]       | installed        |              | 2019-03-11 18:51:43 +0000 UTC |
| [email protected] |                  | pre-release  | 2019-01-28 12:39:21 +0000 UTC |
| [email protected]       |                  |              | 2019-03-08 20:09:11 +0000 UTC |
| [email protected]       |                  |              | 2018-10-23 15:06:04 +0000 UTC |
| [email protected]  |                  | pre-release  | 2018-10-15 20:24:38 +0000 UTC |
| [email protected]    |                  | pre-release  | 2017-11-09 19:59:50 +0000 UTC |
| [email protected]  |                  | pre-release  | 2017-11-03 23:48:26 +0000 UTC |
| [email protected]        |                  |              | 2017-11-16 19:34:52 +0000 UTC |
+--------------------------+------------------+--------------+-------------------------------+

pacm's People

Contributors

vishen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pacm's Issues

Follow symlinks when uncompressing a file

When uncompressing a file, pacm should follow symlinks (only if that are inside the package) and write out the file. This is needed for nodejs which has the following:

$ ls -hal node-v10.16.0-linux-x64/bin/                                                                                             
total 40M
drwxr-xr-x 2 jonathan.pentecost jonathan.pentecost 4.0K Jul 13 10:07 ./
drwxr-xr-x 6 jonathan.pentecost jonathan.pentecost 4.0K Jul 13 10:07 ../
-rwxrwxr-x 1 jonathan.pentecost jonathan.pentecost  40M Jul 13 10:07 node*
lrwxrwxrwx 1 jonathan.pentecost jonathan.pentecost   38 Jul 13 10:07 npm -> ../lib/node_modules/npm/bin/npm-cli.js*
lrwxrwxrwx 1 jonathan.pentecost jonathan.pentecost   38 Jul 13 10:07 npx -> ../lib/node_modules/npm/bin/npx-cli.js*

So currently, only node is written to disk, the others are ignored. But npm and npx should both be written to disk (rather than symlinked).

Ensure removes all symlinks when bad recipe or other error.

pacm ensure removes all symlinks before it tries to then download all packages, but if an error happens when downloading and installing the packages it exits with an error and all of the symlinks have been deleted.

Maybe look at moving the symlink to a backup symlink and on an error it can symlink back?

Unpack includes, shares and source code for a recipe / package.

Some packages are archived along with source code or code for stdlib functionality etc. It might be useful to be able to have an "install" config variable which would be a directory for installed code to be saved at (this could also be overwritten by the package in the config?).

A good example is node / npm which comes with a node executable which is a single binary, and then npm which is a javascript script which relies on code from the packaged lib/, share/ and cinclude to be in a known location.

This would also be useful for protoc which includes some includes/ proto files for useful proto definitions.

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.