Merge pull request #143057 from lukegb/factorio
This commit is contained in:
commit
ffc11df8d2
|
@ -23,6 +23,8 @@ FLAGS = flags.FLAGS
|
|||
flags.DEFINE_string('username', '', 'Factorio username for retrieving binaries.')
|
||||
flags.DEFINE_string('token', '', 'Factorio token for retrieving binaries.')
|
||||
flags.DEFINE_string('out', '', 'Output path for versions.json.')
|
||||
flags.DEFINE_list('release_type', '', 'If non-empty, a comma-separated list of release types to update (e.g. alpha).')
|
||||
flags.DEFINE_list('release_channel', '', 'If non-empty, a comma-separated list of release channels to update (e.g. experimental).')
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -65,7 +67,7 @@ RELEASE_CHANNELS = [
|
|||
|
||||
def find_versions_json() -> str:
|
||||
if FLAGS.out:
|
||||
return out
|
||||
return FLAGS.out
|
||||
try_paths = ["pkgs/games/factorio/versions.json", "versions.json"]
|
||||
for path in try_paths:
|
||||
if os.path.exists(path):
|
||||
|
@ -118,6 +120,12 @@ def merge_versions(old: OurVersionJSON, new: OurVersionJSON) -> OurVersionJSON:
|
|||
old_system = old.get(system_name, {})
|
||||
old_release_type = old_system.get(release_type_name, {})
|
||||
old_release = old_release_type.get(release_channel_name, {})
|
||||
if FLAGS.release_type and release_type_name not in FLAGS.release_type:
|
||||
logging.info("%s/%s/%s: not in --release_type, not updating", system_name, release_type_name, release_channel_name)
|
||||
return old_release
|
||||
if FLAGS.release_channel and release_channel_name not in FLAGS.release_channel:
|
||||
logging.info("%s/%s/%s: not in --release_channel, not updating", system_name, release_type_name, release_channel_name)
|
||||
return old_release
|
||||
if not "sha256" in old_release:
|
||||
logging.info("%s/%s/%s: not copying sha256 since it's missing", system_name, release_type_name, release_channel_name)
|
||||
return release
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
"x86_64-linux": {
|
||||
"alpha": {
|
||||
"experimental": {
|
||||
"name": "factorio_alpha_x64-1.1.42.tar.xz",
|
||||
"name": "factorio_alpha_x64-1.1.45.tar.xz",
|
||||
"needsAuth": true,
|
||||
"sha256": "08h2pxzsk7sigjqnqm1jxya3i9i5g2mgl378gmbp2jcy2mnn4dvm",
|
||||
"sha256": "1gqf8p253qwlsg66fzh6nb264ckmg2wrrvg7grcxxniki7whd759",
|
||||
"tarDirectory": "x64",
|
||||
"url": "https://factorio.com/get-download/1.1.42/alpha/linux64",
|
||||
"version": "1.1.42"
|
||||
"url": "https://factorio.com/get-download/1.1.45/alpha/linux64",
|
||||
"version": "1.1.45"
|
||||
},
|
||||
"stable": {
|
||||
"name": "factorio_alpha_x64-1.1.42.tar.xz",
|
||||
|
@ -30,12 +30,12 @@
|
|||
},
|
||||
"headless": {
|
||||
"experimental": {
|
||||
"name": "factorio_headless_x64-1.1.42.tar.xz",
|
||||
"name": "factorio_headless_x64-1.1.45.tar.xz",
|
||||
"needsAuth": false,
|
||||
"sha256": "1l217fcjcwfi0g5dilsi703cl0wyxsqdqn422hwdbp2ql839k422",
|
||||
"sha256": "1ga35yricj5k2b00hwyb7jgpa0c4v73q3lj9sn424rjxixy6naxf",
|
||||
"tarDirectory": "x64",
|
||||
"url": "https://factorio.com/get-download/1.1.42/headless/linux64",
|
||||
"version": "1.1.42"
|
||||
"url": "https://factorio.com/get-download/1.1.45/headless/linux64",
|
||||
"version": "1.1.45"
|
||||
},
|
||||
"stable": {
|
||||
"name": "factorio_headless_x64-1.1.42.tar.xz",
|
||||
|
|
Loading…
Reference in a new issue