summary refs log tree commit diff
path: root/pkgs/games/factorio
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-10-28 16:42:11 +0200
committerGitHub <noreply@github.com>2021-10-28 16:42:11 +0200
commitffc11df8d2090f7cbe05c506eae9f96a136acdd9 (patch)
treeeb9b476070f099f289beb4274d0ac52852cf2a1e /pkgs/games/factorio
parentfe5ba3bddaa6fdc246b5cc37b9f5efdb3c184ce9 (diff)
parent6b4dfd8db1b1cf4b3be5932124a45534c511122c (diff)
downloadnixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar.gz
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar.bz2
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar.lz
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar.xz
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.tar.zst
nixpkgs-ffc11df8d2090f7cbe05c506eae9f96a136acdd9.zip
Merge pull request #143057 from lukegb/factorio
Diffstat (limited to 'pkgs/games/factorio')
-rwxr-xr-xpkgs/games/factorio/update.py10
-rw-r--r--pkgs/games/factorio/versions.json16
2 files changed, 17 insertions, 9 deletions
diff --git a/pkgs/games/factorio/update.py b/pkgs/games/factorio/update.py
index 833a4ae068e..c234b36264e 100755
--- a/pkgs/games/factorio/update.py
+++ b/pkgs/games/factorio/update.py
@@ -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
diff --git a/pkgs/games/factorio/versions.json b/pkgs/games/factorio/versions.json
index 90d47260502..5d985854229 100644
--- a/pkgs/games/factorio/versions.json
+++ b/pkgs/games/factorio/versions.json
@@ -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",