63 lines
1.5 KiB
Diff
63 lines
1.5 KiB
Diff
commit 58509996aabea52ffc40e5e01c9eb00730c6cdcc
|
|
Author: Juan RP <xtraeme@gmail.com>
|
|
Date: Fri Jun 21 19:19:09 2019 +0200
|
|
|
|
xbps-install: skip trans if all pkgs are installed or uptodate.
|
|
|
|
Fixes an issue pointed out by @Johnnynator
|
|
|
|
diff --git a/bin/xbps-install/main.c b/bin/xbps-install/main.c
|
|
index 8cbba174..371f26c8 100644
|
|
--- bin/xbps-install/main.c
|
|
+++ bin/xbps-install/main.c
|
|
@@ -124,7 +124,7 @@ main(int argc, char **argv)
|
|
const char *rootdir, *cachedir, *confdir;
|
|
int i, c, flags, rv, fflag = 0;
|
|
bool syncf, yes, reinstall, drun, update;
|
|
- int maxcols;
|
|
+ int maxcols, eexist = 0;
|
|
|
|
rootdir = cachedir = confdir = NULL;
|
|
flags = rv = 0;
|
|
@@ -244,6 +244,8 @@ main(int argc, char **argv)
|
|
exit(rv);
|
|
}
|
|
|
|
+ eexist = optind;
|
|
+
|
|
if (update && (argc == optind)) {
|
|
/* Update all installed packages */
|
|
rv = dist_upgrade(&xh, maxcols, yes, drun);
|
|
@@ -254,11 +256,15 @@ main(int argc, char **argv)
|
|
if (rv == EEXIST) {
|
|
/* pkg already updated, ignore */
|
|
rv = 0;
|
|
+ eexist++;
|
|
} else if (rv != 0) {
|
|
xbps_end(&xh);
|
|
exit(rv);
|
|
}
|
|
}
|
|
+ if (eexist == argc)
|
|
+ return 0;
|
|
+
|
|
rv = exec_transaction(&xh, maxcols, yes, drun);
|
|
} else if (!update) {
|
|
/* Install target packages */
|
|
@@ -267,11 +273,15 @@ main(int argc, char **argv)
|
|
if (rv == EEXIST) {
|
|
/* pkg already installed, ignore */
|
|
rv = 0;
|
|
+ eexist++;
|
|
} else if (rv != 0) {
|
|
xbps_end(&xh);
|
|
exit(rv);
|
|
}
|
|
}
|
|
+ if (eexist == argc)
|
|
+ return 0;
|
|
+
|
|
rv = exec_transaction(&xh, maxcols, yes, drun);
|
|
}
|
|
|