Skip to content

Commit

Permalink
Shortcircuit for -Su when target list is empty
Browse files Browse the repository at this point in the history
The "Resolving dependencies... Please wait" message is displayed when target
list is empty for the -Su option. In addition, there is unnecessary changing
of directories and creation of data structures. Remove these when the target
list is empty.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
  • Loading branch information
yanhan committed Jun 28, 2011
1 parent ec077b6 commit deb3849
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ static int upgrade_pkgs(alpm_list_t *targets, struct pw_hashdb *hashdb)
int ret = 0;

char cwd[PATH_MAX];
if (!targets) {
return 0;
}

if (!getcwd(cwd, PATH_MAX)) {
return error(PW_ERR_GETCWD);
}
Expand Down

0 comments on commit deb3849

Please sign in to comment.