Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle verbosity in extract_appimage for non-returning errors (#1233) #1282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ bool extract_appimage(const char* const appimage_path, const char* const _prefix
} else {
struct stat st;
if (!overwrite && stat(prefixed_path_to_extract, &st) == 0 && st.st_size == inode.xtra.reg.file_size) {
fprintf(stderr, "File exists and file size matches, skipping\n");
if (verbose) {
fprintf(stderr, "File exists and file size matches, skipping\n");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where I am checking for verbose flag. The other fprintfs were being called before a return so I thought it'd be unwise for verbose == False to block them. Can add in if required.

}
continue;
}

Expand Down Expand Up @@ -656,7 +658,9 @@ int main(int argc, char *argv[]) {
exit(1);
}

if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, true)) {
const bool verbose = (getenv("VERBOSE") != NULL);

if (!extract_appimage(appimage_path, "squashfs-root/", pattern, true, verbose)) {
exit(1);
}

Expand Down
Loading