Skip to content

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

22 points15 comments
Open on Reddit
About this post
Posted
Archived
Score
22 · 100% up
Kind
Text
ID
7slpc2

Author

19
posts
1.7k
comments
10
media
View profile

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.

16 points

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.

2 points

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.

7 points

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!

11 points

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)

7 points
unknown author

Deleted before we saved it.

1 points

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.

3 points

If you reached that package, you should have read my comment there as well.

maybe the whole download code could be exiled to a separate project: it adds the following benefits:

  • Could be portable (to other distros, or even systems if written in POSIX sh)
  • can be used by all factorio* PKGBUILDs
  • would make the PKGBUILD of factorio* much lighter
  • safety: we get one package for downloads, and not a convoluted PKGBUILD that might change for reasons other than build procedure or version update

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)

2 points

I didn't say hardcoding was necessary, I said it was the only thing the script does differently.

could be portable to other distros

Not relevant to Arch or the AUR

used by all factorio* PKGBUILDs

The only relevant ones are factorio and factorio-experimental and 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:

https://wiki.archlinux.org/index.php/Arch_Linux

Simplicity

Arch Linux defines simplicity as without unnecessary additions or modifications.

Requiring the user to install a different package just to download the file doesn't make it simpler or easier for anyone.

lighter PKGBUILD

The current one is not bloated by any means

safety: one package for downloads

  1. That doesn't make it safer

  2. Your script doesn't check the hash of the downloads, so actually the current package is safer.

not a convoluted PKGBUILD that might change

  1. It's not convoluted

  2. That applies to literally all PKGBUILD files in the AUR

Sorry mate, I appreciate the enthusiasm, but there is no reason for factorio-dl to exist.

3 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.