|
26 | 26 | # Load catalog query functions |
27 | 27 | . "$DIR/lib/catalog.sh" |
28 | 28 |
|
| 29 | +# Load pin library (user-local version pins) |
| 30 | +. "$DIR/lib/pins.sh" |
| 31 | + |
29 | 32 | # Load config query functions (for user preferences like auto_update) |
30 | 33 | . "$DIR/lib/config.sh" |
31 | 34 |
|
@@ -410,11 +413,9 @@ process_tool() { |
410 | 413 | fi |
411 | 414 | else |
412 | 415 | # Upgrade succeeded - remove any existing pin to avoid stale pins |
413 | | - if catalog_has_tool "$tool"; then |
414 | | - local existing_pin="$(catalog_get_property "$tool" pinned_version)" |
415 | | - if [ -n "$existing_pin" ] && [ "$existing_pin" != "never" ]; then |
416 | | - "$ROOT"/scripts/unpin_version.sh "$tool" || true |
417 | | - fi |
| 416 | + local existing_pin="$(pins_get "$tool")" |
| 417 | + if [ -n "$existing_pin" ] && [ "$existing_pin" != "never" ]; then |
| 418 | + "$ROOT"/scripts/unpin_version.sh "$tool" || true |
418 | 419 | fi |
419 | 420 | fi |
420 | 421 | ;; |
@@ -459,11 +460,9 @@ process_tool() { |
459 | 460 | else |
460 | 461 | printf " ✓ Auto-update enabled. This tool will update automatically in future.\n" |
461 | 462 | # Remove any existing pin |
462 | | - if catalog_has_tool "$tool"; then |
463 | | - local existing_pin_a="$(catalog_get_property "$tool" pinned_version)" |
464 | | - if [ -n "$existing_pin_a" ]; then |
465 | | - "$ROOT"/scripts/unpin_version.sh "$tool" || true |
466 | | - fi |
| 463 | + local existing_pin_a="$(pins_get "$tool")" |
| 464 | + if [ -n "$existing_pin_a" ]; then |
| 465 | + "$ROOT"/scripts/unpin_version.sh "$tool" || true |
467 | 466 | fi |
468 | 467 | fi |
469 | 468 | ;; |
@@ -741,20 +740,20 @@ while read -r line; do |
741 | 740 | continue |
742 | 741 | fi |
743 | 742 |
|
744 | | - # Check if tool is pinned (use catalog name for pin check) |
| 743 | + # Check if tool is pinned (read from user-local pins file) |
745 | 744 | # Skip pin checks if IGNORE_PINS=1 |
746 | 745 | if [ "$IGNORE_PINS" != "1" ]; then |
747 | | - pinned_version="$(catalog_get_property "$catalog_name" pinned_version)" |
| 746 | + pinned_version="$(pins_get "$catalog_name")" |
748 | 747 |
|
749 | | - # For multi-version tools, check pinned_versions object AND base tool pin |
| 748 | + # For multi-version tools, check cycle-specific pin AND base tool pin |
750 | 749 | if [ -n "$is_multi_version" ]; then |
751 | 750 | # First check if the BASE tool (e.g., php) is pinned to "never" - skip ALL versions |
752 | 751 | if [ "$pinned_version" = "never" ]; then |
753 | 752 | continue |
754 | 753 | fi |
755 | 754 | # Then check version-specific pin |
756 | 755 | version_cycle="${tool_name##*@}" |
757 | | - multi_pin="$(catalog_get_pinned_version "$catalog_name" "$version_cycle")" |
| 756 | + multi_pin="$(pins_get_cycle "$catalog_name" "$version_cycle")" |
758 | 757 | if [ "$multi_pin" = "never" ]; then |
759 | 758 | continue |
760 | 759 | fi |
|
0 commit comments