Open bioxz opened 1 month ago
quick answer to patch it on the related issue of the related repos. https://github.com/narc0tiq/factorio-updater/issues/66#issuecomment-2439549425
I will not accept a patch to mangle the provided input; please either make factorio-init
supply the correct argument to --package
or don't send one at all.
Here is the relevant place to fix in factorio-init
: https://github.com/Bisa/factorio-init/blob/94e949999b680946c0f7f6828bb98da607a4ca1a/factorio#L559-L561
You can't look only for Binary version
because now it might be Version
; honestly, given that 32-bit versions stopped existing many years ago, you can probably just keep it a static 64
and be fine for the next few decades (indeed, that's what #209 does).
You were just too fast for me.
Here is what's returned by factorio --version and than can be helped to determine the version:
Version: 2.0.10 (build 79578, linux64, headless) Version: 64
Either Version: 64 or linux64 could be the one to determine arch. I'll make something work based on linux64 and provide it here, but i don't have the knowledge of previous versions and if it would work or if you want to keep support 32 bit version that's not existent anymore.
Edit: here is the patch proposed, it detect 64 bit version, and keep the same system (just returning the command rather than conditionnal test).
diff --git a/factorio b/factorio
index 3fb7ad3..b9389d1 100755
--- a/factorio
+++ b/factorio
@@ -557,7 +557,7 @@ function get_bin_version(){
}
function get_bin_arch(){
- as_user "$BINARY --version |egrep '^Binary version: ' |egrep -o '[0-9]{2}'"
+ as_user "$BINARY --version |egrep '^Version: ' |egrep -o 'linux[0-9]{2}' |egrep -o '[0-9]{2}'"
}
Here is the relevant place to fix in
factorio-init
:You can't look only for
Binary version
because now it might beVersion
; honestly, given that 32-bit versions stopped existing many years ago, you can probably just keep it a static64
and be fine for the next few decades (indeed, that's what #209 does).
Right, I did not comment here again, but I don't think it's worth to fix the architecture detection (which is always dangerous, as it does not rely on a documented API, it could break at any time again) and instead just assume it's always the 64 bit build. I can't really image that there are any users who want to use the latest version of this repo to update a years old Factorio version. In the worst case one could always take an old version of this repo, which was fully working for the older versions of Factorio.
I guess due to a changed package name, using the update function does not work for 2.xDue to a change of the --version output of the binary, updates are not working for the 2.x version.
Factorio 1.x prints a Binary version, while 2.x prints just a Version:
This leads to the 64 missing in the package name.
Running the updater by hand did work (at least from 2.0.7 stable to 2.0.8 experimental). The server-init itself is also still running well.