Skip to content

Commit 9d0accf

Browse files
committed
Support mixing system aliases and names in the same command
Signed-off-by: Ihar Hrachyshka <[email protected]>
1 parent c3d1b06 commit 9d0accf

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ since the architecture/operating system mismatches.
355355
By default, `nixpkgs-review` targets only the current system
356356
(`--systems current`). You can also explicitly provide one or several systems to
357357
target (`--systems "x86_64-linux aarch64-darwin"`). We also provide aliases for
358-
the flag:
358+
the flag, which can also be mixed with the system names.
359359

360360
| Alias | Transforms to |
361361
| ---------------------------------------------------- | --------------------------------------------------------- |

nixpkgs_review/review.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import argparse
22
import concurrent.futures
3+
import itertools
34
import os
45
import subprocess
56
import sys
@@ -129,16 +130,10 @@ def __init__(
129130
self.skip_packages = skip_packages
130131
self.skip_packages_regex = skip_packages_regex
131132
self.local_system = current_system()
132-
match len(systems):
133-
case 0:
134-
msg = "Systems is empty"
135-
raise NixpkgsReviewError(msg)
136-
case 1:
137-
self.systems = self._process_aliases_for_systems(
138-
next(iter(systems)).lower()
139-
)
140-
case _:
141-
self.systems = set(systems)
133+
if not systems:
134+
msg = "Systems is empty"
135+
raise NixpkgsReviewError(msg)
136+
self.systems = set(itertools.chain(*[self._process_aliases_for_systems(s.lower()) for s in systems]))
142137
self.allow = allow
143138
self.sandbox = sandbox
144139
self.build_graph = build_graph

0 commit comments

Comments
 (0)