Skip to content

Commit

Permalink
Move the empty remote pkglist check up.
Browse files Browse the repository at this point in the history
This avoids any unnecessary calculations, and also ensures that the
output for an unavailable package from an empty remote package
repository is the same as it was prior to the previous commit.
  • Loading branch information
Jonathan Perkin committed May 26, 2020
1 parent ac6911e commit 144a22d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ pkgin_install(char **opkgargs, int do_inst, int upgrade)
char h_psize[H_BUF], h_fsize[H_BUF], h_free[H_BUF];
struct stat st;

if (SLIST_EMPTY(&r_plisthead)) {
printf("%s\n", MSG_EMPTY_AVAIL_PKGLIST);
return EXIT_FAILURE;
}

/* transform command line globs into pkgnames */
if ((pkgargs = glob_to_pkgarg(opkgargs, &rc)) == NULL) {
printf(MSG_NOTHING_TO_DO);
Expand Down
6 changes: 0 additions & 6 deletions impact.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ pkg_impact(char **pkgargs, int *rc)
char tmpicon;
#endif

if (SLIST_EMPTY(&r_plisthead)) {
printf("%s\n", MSG_EMPTY_AVAIL_PKGLIST);
*rc = EXIT_FAILURE;
return NULL;
}

TRACE("[>]-entering impact\n");

impacthead = init_head();
Expand Down

0 comments on commit 144a22d

Please sign in to comment.