Comments on my revisited Factorio PKGBUILD?
Hi all,
I recently worked on https://gitlab.com/moviuro/factorio-dl (it's on the AUR), and in particular this revisited Factorio PKGBUILD (https://gitlab.com/moviuro/factorio-dl/snippets/1691785). Because I need to use a custom DLAGENT, I don't know if I follow the best practices.
Any constructive criticism is welcome,
Cheers
About this post
- Posted
- Archived
- Score
- 22 · 100% up
- Kind
- Text
- ID
- 7slpc2
16 comments
The factorio-dl thing is bad. Don't do it. Provide the PKGBUILD and let people supply their downloaded version of factorio to build the package.
Downloading the game is a PITA. I don't want to open my browser to download the update (Windows much?). Would you say the same to all -hib PKGBUILDs? (Humble Bundle)
"Supplying their own version of the game" is already possible because makepkg(1) will not download a source file if it already exists right next to the PKGBUILD.
I had no idea this was actually a widespread thing. However, they do it arguably more propper then this PKGBUILD. On the fly modifications of makepkg variables isn't something you want to do, and they go about this by telling you how to add this to your own makepkg. They also support adding passwords from ENV vars, you don't do this either. https://github.com/hagabaka/hib-dlagent
It's an OK'ish approach.
This game installs though Steam just fine. Is the point of this to avoid using the Steam Client? Genuinely interested as it's such a great game!
Yes. I don't have steam on my Linux machine. The script itself is also portable, so you can get the DRM-free version of the game download directly on your server (script works on Linux and BSD).
But the main goal was to have a painless experience with makepkg. Hit makepkg -sri; and that's it, updated! (Current PKGBUILD requires user interaction, which is not desirable)
Deleted before we saved it.
What is wrong with the current package? It automatically downloads and installs the game.
https://aur.archlinux.org/packages/factorio/
It looks like the only thing that your package does differently is that your username and password is hardcoded in a conf file instead of you entering it during installation. If you really want to hardcode your username and password, then you can just edit the PKGBUILD and put it in there.
If you reached that package, you should have read my comment there as well.
And hardcoding is not necessary :
-p password; or FACTORIO_PASSWORD="" factorio-dl; or factorio-dl -i (see https://gitlab.com/moviuro/factorio-dl/blob/cda4cfbbae25f7d05284d34e840ca7f8141ebea8/factorio-dl#L23-25) or even: https://gitlab.com/moviuro/factorio-dl/blob/cda4cfbbae25f7d05284d34e840ca7f8141ebea8/README.md#L29-31)I didn't say hardcoding was necessary, I said it was the only thing the script does differently.
Not relevant to Arch or the AUR
The only relevant ones are
factorioandfactorio-experimentaland those should be separate packages. The current PKGBUILDs work just fine.I'd like to point you to the number one principal of Arch Linux:
Requiring the user to install a different package just to download the file doesn't make it simpler or easier for anyone.
The current one is not bloated by any means
That doesn't make it safer
Your script doesn't check the hash of the downloads, so actually the current package is safer.
It's not convoluted
That applies to literally all PKGBUILD files in the AUR
Sorry mate, I appreciate the enthusiasm, but there is no reason for
factorio-dlto exist.