Skip to content

Commit 2893093

Browse files
committed
Sync check_patches_clean_apply.py with kilted
See RoboStack/ros-kilted#16
1 parent 728a4c5 commit 2893093

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

check_patches_clean_apply.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ def prepare_patch_recipes() -> List[Path]:
121121
dest_recipe_file = dest_recipe_dir / "recipe.yaml"
122122

123123
copy_patch_files(filtered, recipe_file.parent, dest_recipe_dir)
124-
write_minimal_recipe(dest_recipe_file, pkg, filtered)
124+
# append "-check-patches" to the package name in the dummy recipe
125+
patched_pkg = dict(pkg)
126+
patched_pkg["name"] = f"{patched_pkg['name']}-check-patches"
127+
write_minimal_recipe(dest_recipe_file, patched_pkg, filtered)
125128
recreated.append(dest_recipe_file)
126129

127130
return recreated
@@ -142,31 +145,30 @@ def main() -> None:
142145
args = parse_args()
143146

144147
if not RECIPES_DIR.is_dir():
145-
print("recipes/ folder not found – abort.")
146-
return
148+
print("recipes/ folder not found – abort.")
149+
sys.exit(1)
147150

148151
if args.clean:
149152
shutil.rmtree(PATCH_RECIPES_DIR, ignore_errors=True)
150-
print("🧹 Removed recipes_only_patch/")
153+
print(" Removed recipes_only_patch/")
151154
return
152155

153156
if PATCH_RECIPES_DIR.exists():
154-
print("♻️ Refreshing recipes_only_patch/ …")
157+
print("Refreshing recipes_only_patch/ …")
155158
shutil.rmtree(PATCH_RECIPES_DIR)
156159

157160
recreated = prepare_patch_recipes()
158161
if not recreated:
159-
print("⚠️ No recipes with patches found – nothing to test.")
162+
print("No recipes with patches found – nothing to test.")
160163
return
161164

162-
print(f"Prepared {len(recreated)} minimal recipe(s) in {PATCH_RECIPES_DIR}/")
165+
print(f"Prepared {len(recreated)} minimal recipe(s) in {PATCH_RECIPES_DIR}/")
163166

164167
if not args.dry:
165168
run_rattler_build()
166169
else:
167-
print("💡 --dry given – rattler-build not executed.")
170+
print("--dry given – rattler-build not executed.")
168171

169172

170173
if __name__ == "__main__":
171174
main()
172-

0 commit comments

Comments
 (0)