Skip to content

Commit 55111d1

Browse files
aldoborreroselfuryon
authored andcommitted
fix: obtain package version in update.py
1 parent 9a9dd23 commit 55111d1

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

maintainers/scripts/update/update.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async def commit_changes(
143143

144144

145145
async def check_changes(package: Dict, worktree: str, update_info: str):
146-
if "commit" in package["supportedFeatures"]:
146+
if "commit" in package.get("supportedFeatures", []):
147147
changes = json.loads(update_info)
148148
else:
149149
changes = [{}]
@@ -161,13 +161,11 @@ async def check_changes(package: Dict, worktree: str, update_info: str):
161161

162162
if "newVersion" not in changes[0]:
163163
attr_path = changes[0]["attrPath"]
164+
logging.info(f"Current worktree: {worktree}")
164165
obtain_new_version_process = await check_subprocess(
165-
"nix-instantiate",
166-
"--expr",
167-
f"with import ./. {{}}; lib.getVersion {attr_path}",
168-
"--eval",
169-
"--strict",
170-
"--json",
166+
"nix",
167+
"eval",
168+
f".#packages.x86_64-linux.{attr_path}.version",
171169
stdout=asyncio.subprocess.PIPE,
172170
stderr=asyncio.subprocess.PIPE,
173171
cwd=worktree,
@@ -196,7 +194,7 @@ async def check_changes(package: Dict, worktree: str, update_info: str):
196194

197195
async def merge_changes(
198196
merge_lock: asyncio.Lock,
199-
package: Package,
197+
package: Dict,
200198
update_info: str,
201199
temp_dir: Optional[Tuple[str, str]],
202200
) -> None:
@@ -226,7 +224,9 @@ async def updater(
226224
# A sentinel received, we are done.
227225
return
228226

229-
if not ("attrPath" in package or "commit" in package["supportedFeatures"]):
227+
if not (
228+
"commit" in package.get("supportedFeatures", []) or "attrPath" in package
229+
):
230230
temp_dir = None
231231

232232
await run_update_script(dir_root, merge_lock, temp_dir, package, keep_going)

maintainers/scripts/update/update.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ nix-shell "${rootDir}/${updateScript}" \
99
--argstr flakePath "${rootDir}" \
1010
--argstr keep-going 'true' \
1111
--argstr max-workers "4" \
12-
--argstr no-confirm "true"
12+
--argstr no-confirm "true" \
13+
--argstr commit 'true'

0 commit comments

Comments
 (0)