Confirm index deletion before network I/O, but defer the deletion itself to * the final guarded activation after the verified binary is ready. Returns 0 * to continue and 1 to abort. */
| 11728 | * the final guarded activation after the verified binary is ready. Returns 0 |
| 11729 | * to continue and 1 to abort. */ |
| 11730 | static int update_prepare_clear_indexes(const char *home, bool dry_run, bool *delete_indexes_out) { |
| 11731 | if (delete_indexes_out) { |
| 11732 | *delete_indexes_out = false; |
| 11733 | } |
| 11734 | int index_count = count_db_indexes(home); |
| 11735 | if (index_count == 0) { |
| 11736 | return 0; |
| 11737 | } |
| 11738 | printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count); |
| 11739 | cbm_list_indexes(home); |
| 11740 | printf("\n"); |
| 11741 | if (dry_run) { |
| 11742 | printf("(dry-run — indexes would be deleted)\n\n"); |
| 11743 | return 0; |
| 11744 | } |
| 11745 | if (!prompt_yn("Delete these indexes and continue with update?")) { |
| 11746 | printf("Update cancelled.\n"); |
| 11747 | return CLI_TRUE; |
| 11748 | } |
| 11749 | if (delete_indexes_out) { |
| 11750 | *delete_indexes_out = true; |
| 11751 | } |
| 11752 | return 0; |
| 11753 | } |
| 11754 | |
| 11755 | /* Download and verify before disruption, then activate under daemon locks. */ |
| 11756 | static int download_verify_install(const char *url, const char *ext, const char *os, |
no test coverage detected