Jump to content




Packman - A package management tool


60 replies to this topic

#1 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 March 2015 - 06:06 AM

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.

#2 GopherAtl

  • Members
  • 888 posts

Posted 06 March 2015 - 12:06 PM

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...

#3 RoD

  • Members
  • 313 posts

Posted 06 March 2015 - 05:48 PM

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

#4 ElvishJerricco

  • Members
  • 803 posts

Posted 06 March 2015 - 06:07 PM

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.


#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 March 2015 - 07:45 PM

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!

#6 ElvishJerricco

  • Members
  • 803 posts

Posted 06 March 2015 - 07:58 PM

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

#7 s0r00t

  • Members
  • 61 posts

Posted 08 March 2015 - 07:54 PM

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?

#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 08 March 2015 - 08:24 PM

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.

#9 s0r00t

  • Members
  • 61 posts

Posted 09 March 2015 - 05:26 PM

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

#10 comp500

  • Members
  • 66 posts

Posted 09 April 2015 - 06:35 PM

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

#11 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 10 April 2015 - 10:21 AM

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"

#12 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 10 April 2015 - 11:34 AM

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.

#13 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 10 April 2015 - 11:45 AM

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 :/

#14 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 10 April 2015 - 01:09 PM

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.

#15 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 10 April 2015 - 01:24 PM

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.

#16 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 May 2015 - 07:23 PM

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.

#17 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 17 June 2015 - 05:23 AM

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!

#18 ry00000

  • Members
  • 244 posts
  • LocationComputer, Base, SwitchCraft, Cube-earth, Blockiverse, Computer

Posted 17 June 2015 - 11:37 AM

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

#19 ThomasRules

  • New Members
  • 1 posts

Posted 19 July 2015 - 07:26 PM

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)

#20 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 July 2015 - 07:29 PM

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





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users