←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

Packman - A package management tool

Lyqyd's Photo Lyqyd 06 Mar 2015

Packman is a package manager for ComputerCraft. It allows you to easily add and remove software from computers, and includes dependency resolution so you won't have to run around tracking down the various APIs that shiny new program needs. It has support for multiple repositories, so program authors can get their own package lists added in and keep their software up to date. Packman can update your programs for you if there are new versions available. Packman can download from a variety of sources, including pastebin, github and bitbucket. Packman includes support for running setup and cleanup scripts when installing/removing packages.

You can grab packman via a small script I've put on pastebin:

pastebin run 4zyreNZy

This script will automatically download packman, then have it fetch the other files it needs and finally install a small package that makes packman easier to use (as it installs in /usr/bin, this initially installed package adds /usr/bin to the shell path on startup).

Many of my ComputerCraft programs are easily installed through packman, such as LyqydOS, LyqydNet, Touchpoint, and nsh. You can also find neat things like Gopher's minesweeper game among the available packages!

If you want to get your packages listed, simply create a valid package list at a static URL (such as a pastebin paste you can edit, or a file in a github repo) and send a pull request adding your pack's URL with an appropriate name to the repolist on github.
Quote

GopherAtl's Photo GopherAtl 06 Mar 2015

About time this got it's own thread instead of being hidden away!

I feel like I should note that the version of minesweeper currently on packman is the version that only runs in LyqydOS; the version for CraftOS is not, and can be found here, though I may look into combining them into a single program that switches modes at some point...
Quote

RoD's Photo RoD 06 Mar 2015

This is going to make things easy form now on. Thanks for sharing :D
Quote

ElvishJerricco's Photo ElvishJerricco 06 Mar 2015

This is great! Couple of questions:

Could I add in Grin as a package type? Makes it possible to distribute binaries, and also keeps source separate from release. Should be a fairly simple addition.

Also, maybe users should be able to add custom repos from a local list of repos? EDIT: Or can they just manually add to repolist on the install? But I guess that fails to survive updates to packman.
Edited by ElvishJerricco, 06 March 2015 - 06:36 PM.
Quote

Lyqyd's Photo Lyqyd 06 Mar 2015

Yeah, you're free to submit a PR adding any feature you think would be valuable. A PR adding a grin download type correctly would very likely be accepted!

Custom repositories could be added by users simply by placing a valid repo file in /etc/repositories. As long as the custom repo wasn't named the same as any of the included ones, it wouldn't be blasted away. I haven't put too much thought into allowing custom URLs to be added to the repo list, so that they would be updated automatically, but that may be a valuable feature.

Thanks for the interest!
Quote

ElvishJerricco's Photo ElvishJerricco 06 Mar 2015

View PostLyqyd, on 06 March 2015 - 07:45 PM, said:

Yeah, you're free to submit a PR adding any feature you think would be valuable. A PR adding a grin download type correctly would very likely be accepted!

Custom repositories could be added by users simply by placing a valid repo file in /etc/repositories. As long as the custom repo wasn't named the same as any of the included ones, it wouldn't be blasted away. I haven't put too much thought into allowing custom URLs to be added to the repo list, so that they would be updated automatically, but that may be a valuable feature.

Thanks for the interest!

Great! This whole project is very promising. Already got a fork going to add Grin in =P
Quote

s0r00t's Photo s0r00t 08 Mar 2015

Looks great!
Maybe you could rename it to something else, packman is an overused/already used name.
Also, 2 things :
-What is a package? Raw lua?
-Is the repo list like sources.list?
Quote

Lyqyd's Photo Lyqyd 08 Mar 2015

The name is fine.

A package is a file or collection of files, which can include anything that ComputerCraft can successfully download. For most downloading methods (pastebin, raw, github, bitbucket), this means plain ASCII files. The grin download method can also get binary files, as it downloads a base64'd file prepared beforehand. The package's files are then placed according to the specifications of the package and an installer script is run (if specified).

The repo list is a list of files containing package lists. This is to allow package creators greater control over their packages and their update schedules, so that they don't have to submit a pull request to the main package list in order to update their software.
Quote

s0r00t's Photo s0r00t 09 Mar 2015

View PostLyqyd, on 08 March 2015 - 08:24 PM, said:

The name is fine.

A package is a file or collection of files, which can include anything that ComputerCraft can successfully download. For most downloading methods (pastebin, raw, github, bitbucket), this means plain ASCII files. The grin download method can also get binary files, as it downloads a base64'd file prepared beforehand. The package's files are then placed according to the specifications of the package and an installer script is run (if specified).

The repo list is a list of files containing package lists. This is to allow package creators greater control over their packages and their update schedules, so that they don't have to submit a pull request to the main package list in order to update their software.

Thanks for the answer ;)
I'll look into packman, seems cool :D
Quote

comp500's Photo comp500 09 Apr 2015

View PostGopherAtl, on 06 March 2015 - 12:06 PM, said:

About time this got it's own thread instead of being hidden away!
Agreed! I don't know if I've already found and read this thread, but anyway, I should add links to this new thread on my gh repo.
Also, expect new awesome stuff from me in my Packman repo.

... hint hint shell modifications hint hint
Quote

DannySMc's Photo DannySMc 10 Apr 2015

View PostLyqyd, on 06 March 2015 - 06:06 AM, said:

Packman is a package manager for ComputerCraft. It allows you to easily add and remove software from computers, and includes dependency resolution so you won't have to run around tracking down the various APIs that shiny new program needs. It has support for multiple repositories, so program authors can get their own package lists added in and keep their software up to date. Packman can update your programs for you if there are new versions available. Packman can download from a variety of sources, including pastebin, github and bitbucket. Packman includes support for running setup and cleanup scripts when installing/removing packages.

You can grab packman via a small script I've put on pastebin:

pastebin run 4zyreNZy

This script will automatically download packman, then have it fetch the other files it needs and finally install a small package that makes packman easier to use (as it installs in /usr/bin, this initially installed package adds /usr/bin to the shell path on startup).

Many of my ComputerCraft programs are easily installed through packman, such as LyqydOS, LyqydNet, Touchpoint, and nsh. You can also find neat things like Gopher's minesweeper game among the available packages!

If you want to get your packages listed, simply create a valid package list at a static URL (such as a pastebin paste you can edit, or a file in a github repo) and send a pull request adding your pack's URL with an appropriate name to the repolist on github.

When using this it doesn't work? it says: "could not fetch packman"
Quote

Bomb Bloke's Photo Bomb Bloke 10 Apr 2015

That'd suggest that the installer was unable to connect to github's servers at all. You still can't get it to run after waiting a few minutes, I'd recommend checking ComputerCraft's http whitelist settings.
Quote

DannySMc's Photo DannySMc 10 Apr 2015

View PostBomb Bloke, on 10 April 2015 - 11:34 AM, said:

That'd suggest that the installer was unable to connect to github's servers at all. You still can't get it to run after waiting a few minutes, I'd recommend checking ComputerCraft's http whitelist settings.

Everything is fine, it just won't download it :/
Quote

Bomb Bloke's Photo Bomb Bloke 10 Apr 2015

Works for me!

Are you perhaps connecting via a proxy? Many schools filter traffic through proxies, for example, and github may possibly be refusing the connection on that basis.
Quote

DannySMc's Photo DannySMc 10 Apr 2015

I am not at school? I am at work xD I am like nearly 20 I wish I was still at school :P but yes I assume we do use a proxy so will try it when I am at home.
Quote

Lyqyd's Photo Lyqyd 02 May 2015

I've pushed an update to this that adds incremental updates for the github and bitbucket fetching methods. If you update packages that are fetched those two ways, it will compare the sha hash of the file provided by the host to the last known version of the file and only update files that appear to have changed.

I've also made a major behind-the-scenes change to all of the download methods (except grin) to use a transaction-based system for changing files. They will now download everything, and then create folders and write files if everything was successfully fetched. This helps prevent out of sync state between the files on the system and the database of installed packages/files.
Quote

Lyqyd's Photo Lyqyd 17 Jun 2015

I'm excited to announce that nitrogenfingers has added several of his programs as packages for packman, so you can now fetch some of his awesome stuff through Packman. A quick packman fetch search nitro should show you all of the new packages!
Quote

ry00000's Photo ry00000 17 Jun 2015

Awesome Lyqyd! Oeed will surely add Packman to OneOS, I think.
Quote

ThomasRules's Photo ThomasRules 19 Jul 2015

It's probably worth mentioning that you need to reboot the computer after running the pastebin code in order to make it work (it took me about 5 minutes to work this out)
Quote

Lyqyd's Photo Lyqyd 19 Jul 2015

Whoops! I've updated the easy-shell extension to add /usr/bin to the shell path when it is installed as well. Thanks!
Quote