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. */
| 13491 | * the final guarded activation after the verified binary is ready. Returns 0 |
| 13492 | * to continue and 1 to abort. */ |
| 13493 | static int update_prepare_clear_indexes(const char *home, bool dry_run, bool *delete_indexes_out) { |
| 13494 | if (delete_indexes_out) { |
| 13495 | *delete_indexes_out = false; |
| 13496 | } |
| 13497 | int index_count = count_db_indexes(home); |
| 13498 | if (index_count == 0) { |
| 13499 | return 0; |
| 13500 | } |
| 13501 | printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count); |
| 13502 | cbm_list_indexes(home); |
| 13503 | printf("\n"); |
| 13504 | if (dry_run) { |
| 13505 | printf("(dry-run — indexes would be deleted)\n\n"); |
| 13506 | return 0; |
| 13507 | } |
| 13508 | if (!prompt_yn("Delete these indexes and continue with update?")) { |
| 13509 | printf("Update cancelled.\n"); |
| 13510 | return CLI_TRUE; |
| 13511 | } |
| 13512 | if (delete_indexes_out) { |
| 13513 | *delete_indexes_out = true; |
| 13514 | } |
| 13515 | return 0; |
| 13516 | } |
| 13517 | |
| 13518 | /* Download and verify before disruption, then activate under daemon locks. */ |
| 13519 | static int download_verify_install(const char *url, const char *ext, const char *os, |
no test coverage detected