@samitouri / QOSamiQemu / commits / eb01b388ea

scripts: add the possibility of a quick update of the pacakge

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo Bonzini committed Aug 21, 2026 at 10:00 UTC eb01b388eae9609f8ed1948981209beebaa380bc
1 file changed +17 -5
scripts/get-wraps-from-cargo-registry.py
+17 -5
@@ -166,10 +166,13 @@ class UpdateSubprojects:
166 orig_dir = section["directory"]
167
168 if self.dry_run:
169 - if orig_dir == source_namever:
170 - print(f"Will install {orig_dir} from registry.")
171 - else:
169 + if orig_dir != source_namever:
170 print(f"Will replace {orig_dir} with {source_namever}.")
171 + elif not os.path.exists(orig_dir) or self.cargo_registry:
172 + print(f"Will install {orig_dir} from {self.source.origin}.")
173 + else:
174 + print(f"Will update {orig_dir} from cache.")
175 + return
176 self.changes += 1
177 return
178
@@ -181,10 +184,19 @@ class UpdateSubprojects:
184 with open(wrap_file, "w") as f:
185 config.write(f)
186
184 - if orig_dir == source_namever:
187 + if orig_dir != source_namever:
188 + print(f"👉 Replacing {orig_dir} with {source_namever}.")
189 + elif not os.path.exists(orig_dir) or self.cargo_registry:
190 print(f"👉 Installing {orig_dir} from {self.source.origin}.")
191 else:
187 - print(f"👉 Replacing {orig_dir} with {source_namever}.")
192 + print(f"👉 Updating {orig_dir} from cache.")
193 + subprocess.run(
194 + ["meson", "subprojects", "update", "--reset", wrap_name],
195 + cwd=self.top_srcdir,
196 + env=env,
197 + check=True,
198 + )
199 + return
200
201 subprocess.run(
202 ["meson", "subprojects", "download", wrap_name],