Jump to content




Packman - A package management tool


60 replies to this topic

#41 aaronmallen

  • Members
  • 14 posts
  • LocationTexas

Posted 04 November 2016 - 02:12 AM

View PostLyqyd, on 03 November 2016 - 06:58 PM, said:

Your suggestion has a few flaws that I can see:

- Credentials to push files to the data store would need to be baked in to packman, allowing anyone to easily recover them and use them maliciously.
- Development of packages without ComputerCraft installed is much more difficult.
- Storage of packages is centralized and must be managed by the owner of the data store.
- Exhaustive lists of past versions would need to be maintained and curated by someone, probably the owner of the data store.

I don't see very many advantages over the current system, honestly. I am quite happy with the current distributed system, as it allows package creators full control over their packages, with minimal centralized maintenance required.

I cannot disagree with almost anything you said here, I was probably being a little ambitious in hindsight... although supporting version would be fairly simple, even the way you have it now. All you would need is to allow for a sha/branch/tag argument. Checkout this github project I contributed to: https://github.com/e...ercraft-github. We simply allow for the argument to be passed and then change the url based on the desired tree. Version support would allow for me to write versions of my programs across different versions of CC... and it would be my burden as a package developer to explain how those versions are distributed.

View PostH4X0RZ, on 03 November 2016 - 10:38 PM, said:

@Lyqyd
BTW, why is Packman using a custom format for the packlist etc. instead of using something more... supported, like serialized tables or JSON?

I too would like to hear the story behind this decision...

#42 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 04 November 2016 - 03:38 PM

The packlist format was designed primarily to be read and written by humans. Serialized tables and JSON are both more difficult to work with than plain text, without the assistance of external tools. Packman is designed to be easy to get started with for developers that may not be accustomed to complex toolchains, as many in the ComputerCraft community are first-time programmers. The format is also simple enough that it can be automatically generated by those who want to go that route. An advantage that I found after picking the format is that it allows me to give reasonably specific locations where package specs are malformed, and to be able to continue parsing the remainder of a repo even if one package is malformed.

#43 aaronmallen

  • Members
  • 14 posts
  • LocationTexas

Posted 04 November 2016 - 07:26 PM

@Lyqyd are you using the size property for anything currently? I ran into a weird issue on another project where the "size" provided by the github api while seemingly using the same metric as CC's `fs.getSize()` were never exactly the same... in other words github may tell me a repo is 1200 but after downloading it to CC I would find it to be 1225 (just as an example).


This is how we ended up "solving" it:

local function hasEnoughSpace(repoSize, freeSpace)
	-- The value reported by github underestimates the one reported by CC. This tries
	-- to guess when this matters.
	local sizeError = 0.2

	local function warnAndContinue()
		write("Repository may be too large to download, attempt anyway? [Y/n]: ")
		local validAnswers = { [''] = 'yes', y = 'yes', yes = 'yes', n = 'no', no = 'no' }
		local input = io.read()
		while not validAnswers[input:lower()] do
			print("Please type [y]es or [n]o")
			input = io.read()
		end
		return validAnswers[input:lower()] == 'yes'
	end

	if repoSize > freeSpace then
		return false
	elseif repoSize * (1 + sizeError) > freeSpace then
		return warnAndContinue()
	else
		return true
	end
end

Edited by aaronmallen, 04 November 2016 - 07:31 PM.


#44 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 04 November 2016 - 07:44 PM

Interesting! Packman does not currently make use of the size property, though it is part of the original feature set I had planned when I started the project. I hope to get around to implementing the feature I had planned for it, but it is a low priority at the moment. Thanks for the code snippet, I was unaware that the reported sizes might vary that much.

#45 aaronmallen

  • Members
  • 14 posts
  • LocationTexas

Posted 10 November 2016 - 01:11 AM

Is there anyway I can convince you to support semantic versioning?

#46 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 12 November 2016 - 02:00 AM

I've done some work on the back end of things to get the installation sequence more in line with what I'd originally wanted to do. The package API is now its own package, so I'll be using that to push out updates to the API in the future. The pastebin installer has been updated to reflect this new way of doing things. Existing installations shouldn't notice any difference, except that there will be files that are unnecessarily listed as belonging to main/packman in the installation database.

#47 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 15 February 2017 - 09:55 PM

Can't install lnfs-deamon

Client installs fine but seems to have more dependencies than logic says it should.

Posted Image

While I'm here and talking about lnfsd, I haven't been successful in getting it to work. As I can't get it to install I'm hoping that the dependencies are shared with the client.
Posted Image

Edited by Lupus590, 15 February 2017 - 10:04 PM.


#48 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 16 February 2017 - 02:21 AM

Yikes. This has uncovered a bit of an architecture problem between LyqydOS, LyqydNet, and lsh. I'm gonna need a couple days to get that untangled. In the meantime, I've pushed an update to lnfsd that should allow it to be launched, at least.

The client does actually require the dependencies it lists, since it's a mounting utility for LyqydOS's vfs system (mounts the shares from lnfsd locally). The lnfs-daemon and -client dependencies are set up correctly. I should create a lightweight client at some point similar to an ftp client, but have not done so yet.

If you attempt to install lnfs-daemon, you should have more success.

#49 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 18 February 2017 - 10:33 PM

Okay, I think I've worked out the issues that were preventing this from working. Here are the installation instructions for getting lnfs-daemon and -client up and running:
  • On a new computer, place a wireless modem and install packman.
  • Run packman install lnfs-daemon and allow it to install all dependencies.
  • Edit startup and add shell.run("/usr/bin/lyqydnet") at the end.
  • Label the computer, and make note of its id.
  • Reboot the computer.
  • Run mkdir share and then lnfsd.
  • On a new advanced computer, place a wireless modem and install packman.
  • Run packman install lnfs-client and allow it to install all dependencies.
  • When LyqydOS asks if you'd like to run it on startup, enter y.
  • Edit /LyqydOS/.init and add lyqydnet under lnrd.
  • Label the advanced computer.
  • Reboot the advanced computer.
  • Hit F1 to run a program and enter shell.
  • Run mkdir mnt.
  • Run lnmount i:<id> public mnt, where <id> is the id of the computer you noted earlier.
At this point, the mnt folder on the advanced computer is essentially equivalent to the share folder on the first computer. You should be able to create and manipulate files as normal. If you want to monitor the network traffic, installing lyqydnet on a third computer and running netmon <id1> <id2> will allow you to see what's going on, and you can hit the S key to save the log.

#50 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 20 February 2017 - 06:37 PM

Followed instructions, got this on client:
When booting:
Posted Image

When in the shell (LyqydOs seems to work):
Posted Image

Everything on both computers is a fresh download save for packman, which I bootstrapped.

Edited by Lupus590, 20 February 2017 - 06:49 PM.


#51 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 23 February 2017 - 03:36 AM

I followed the instructions exactly on two new computers and was able to successfully run both programs. Can you upload your copy of /LyqydOS/env? On my end, line 602 is an end statement. Once you're able to run lnmount within LyqydOS, things should work correctly. I'm not sure what happened to your copy of that env file.

#52 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 23 February 2017 - 02:44 PM

I will wipe and try again with the client then

As for the bad file: http://pastebin.com/eP0RdK0e
for me 602 is also an end

Edit: Just reinstalled, same error on the same line with env, didn't make the change to lyqydos to run lyqynet this time though

If it helps, I'm running this modpack, with extra code added via this resource pack.

I also tried some other stuff, this is the result:
Posted Image

Edited by Lupus590, 23 February 2017 - 03:21 PM.


#53 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 25 February 2017 - 04:33 AM

I figured out what the issue was. I'm not sure why it was showing up as line 602 instead of line 598, but it should all work now. Hopefully.

#54 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 25 February 2017 - 12:47 PM

I had issues getting packman to update it (ended up having packman uninstall and install it again) but LyqydOS works properly now.

As for lnfs, files are not ending up on the server, I will investigate with the network monitor of yours later, I've got firewood to chop at the moment.

Edit: LyqydNet wasn't running on startup because I forgot to add it to .init

Edit2: still not working, also netmon isn't showing anything on the monitor that I've redirected it to

Edited by Lupus590, 25 February 2017 - 02:24 PM.


#55 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 04 March 2017 - 11:32 PM

I'm having trouble reproducing the issue, with your modpack, resource pack, and forge version. When following the instructions above, I'm getting things working correctly. Is there anything different in your environment?

Sorry for the delay, I've had a very busy week and simply didn't have time to sit down and break out the test environment.

#56 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 05 March 2017 - 07:14 PM

Just noticed that the version on github was out of date. I will try more attempts when time allows.

#57 Lupus590

  • Members
  • 1,962 posts
  • LocationUK

Posted 08 March 2017 - 06:16 PM

working now, thankyou for your help

fyi, i reinstalled everything but packman (bootstrapped again)

Edited by Lupus590, 08 March 2017 - 06:18 PM.


#58 Blizzard

  • Members
  • 5 posts

Posted 09 March 2017 - 08:18 AM

This implementation is actually really cool, good work!

#59 Wilma456

  • Members
  • 187 posts
  • LocationGermany

Posted 18 June 2017 - 02:29 PM

Packman doesen't work on the latest CC Beta.

#60 MineRobber___T

  • Members
  • 50 posts
  • LocationStop being nosy

Posted 23 June 2017 - 02:26 AM

packman is broken in the master branch of ComputerCraft. package.load doesn't exist anymore. Possibly check for the existance of package.load and compensate for not having it (or possibly create it?)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users