Skip to content

Commit

Permalink
Merge pull request #1342 from ejoerns/install-error-cleanup
Browse files Browse the repository at this point in the history
Minor Cleanups For Install Error Codes
  • Loading branch information
jluebbe committed Feb 22, 2024
2 parents 993b5ae + fc1548d commit 9419d71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions include/install.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ GQuark r_install_error_quark(void);

typedef enum {
R_INSTALL_ERROR_FAILED,
R_INSTALL_ERROR_NOSRC,
R_INSTALL_ERROR_NODST,
R_INSTALL_ERROR_COMPAT_MISMATCH,
R_INSTALL_ERROR_REJECTED,
R_INSTALL_ERROR_MARK_BOOTABLE,
R_INSTALL_ERROR_MARK_NONBOOTABLE,
R_INSTALL_ERROR_TARGET_GROUP,
R_INSTALL_ERROR_DOWNLOAD_MF,
R_INSTALL_ERROR_HANDLER,
R_INSTALL_ERROR_NO_SUPPORTED,
R_INSTALL_ERROR_MOUNTED,
} RInstallError;

Expand Down
4 changes: 2 additions & 2 deletions src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,14 +915,14 @@ static gboolean pre_install_checks(gchar* bundledir, GPtrArray *install_plans, G
}

if (!g_file_test(plan->image->filename, G_FILE_TEST_EXISTS)) {
g_set_error(error, R_INSTALL_ERROR, R_INSTALL_ERROR_NOSRC,
g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
"Source image '%s' not found in bundle", plan->image->filename);
return FALSE;
}

skip_filename_checks:
if (!g_file_test(plan->target_slot->device, G_FILE_TEST_EXISTS)) {
g_set_error(error, R_INSTALL_ERROR, R_INSTALL_ERROR_NODST,
g_set_error(error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
"Destination device '%s' not found", plan->target_slot->device);
return FALSE;
}
Expand Down

0 comments on commit 9419d71

Please sign in to comment.