Skip to content

Commit 92d5276

Browse files
authored
Merge pull request #486 from booxter/mix-aliases
Support mixing system aliases and names in the same command
2 parents 1c36d61 + 78341e4 commit 92d5276

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-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: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import concurrent.futures
33
import fcntl
4+
import itertools
45
import os
56
import subprocess
67
import sys
@@ -133,16 +134,14 @@ def __init__(
133134
self.skip_packages = skip_packages
134135
self.skip_packages_regex = skip_packages_regex
135136
self.local_system = current_system()
136-
match len(systems):
137-
case 0:
138-
msg = "Systems is empty"
139-
raise NixpkgsReviewError(msg)
140-
case 1:
141-
self.systems = self._process_aliases_for_systems(
142-
next(iter(systems)).lower()
143-
)
144-
case _:
145-
self.systems = set(systems)
137+
if not systems:
138+
msg = "Systems is empty"
139+
raise NixpkgsReviewError(msg)
140+
self.systems = set(
141+
itertools.chain(
142+
*[self._process_aliases_for_systems(s.lower()) for s in systems]
143+
)
144+
)
146145
self.allow = allow
147146
self.sandbox = sandbox
148147
self.build_graph = build_graph

0 commit comments

Comments
 (0)