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. */
| 11375 | * the final guarded activation after the verified binary is ready. Returns 0 |
| 11376 | * to continue and 1 to abort. */ |
| 11377 | static int update_prepare_clear_indexes(const char *home, bool dry_run, bool *delete_indexes_out) { |
| 11378 | if (delete_indexes_out) { |
| 11379 | *delete_indexes_out = false; |
| 11380 | } |
| 11381 | int index_count = count_db_indexes(home); |
| 11382 | if (index_count == 0) { |
| 11383 | return 0; |
| 11384 | } |
| 11385 | printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count); |
| 11386 | cbm_list_indexes(home); |
| 11387 | printf("\n"); |
| 11388 | if (dry_run) { |
| 11389 | printf("(dry-run — indexes would be deleted)\n\n"); |
| 11390 | return 0; |
| 11391 | } |
| 11392 | if (!prompt_yn("Delete these indexes and continue with update?")) { |
| 11393 | printf("Update cancelled.\n"); |
| 11394 | return CLI_TRUE; |
| 11395 | } |
| 11396 | if (delete_indexes_out) { |
| 11397 | *delete_indexes_out = true; |
| 11398 | } |
| 11399 | return 0; |
| 11400 | } |
| 11401 | |
| 11402 | /* Download and verify before disruption, then activate under daemon locks. */ |
| 11403 | static int download_verify_install(const char *url, const char *ext, const char *os, |
no test coverage detected