[pacman-dev] [PATCH] Print "there is nothing to do" with NOOP transactions
Nagy Gabor
ngaba at bibl.u-szeged.hu
Wed Jan 20 20:03:26 EST 2010
This patch was inspired by FS#17859. (That is not a bug atm due to "target
loading"-interface change.)
>From now on, with "empty" transactions (e.g. -Ru needed_pkg) pacman prints
a " there is nothing to do" message. The " local database is up to date"
message is kept for -Su.
Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
---
Reason for resubmit: Xavier and I decided to keep the old -Su message to
not confuse scripts (and users).
src/pacman/remove.c | 1 +
src/pacman/sync.c | 6 +++++-
src/pacman/upgrade.c | 1 +
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 6d44350..61b57c7 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -118,6 +118,7 @@ int pacman_remove(alpm_list_t *targets)
/* Step 3: actually perform the removal */
alpm_list_t *pkglist = alpm_trans_get_remove();
if(pkglist == NULL) {
+ printf(_(" there is nothing to do\n"));
goto cleanup; /* we are done */
}
/* print targets and ask user confirmation */
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index a2ef616..3832f03 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -663,7 +663,11 @@ static int sync_trans(alpm_list_t *targets)
packages = alpm_trans_get_add();
if(packages == NULL) {
/* nothing to do: just exit without complaining */
- printf(_(" local database is up to date\n"));
+ if(config->op_s_upgrade) {
+ printf(_(" local database is up to date\n"));
+ } else {
+ printf(_(" there is nothing to do\n"));
+ }
goto cleanup;
}
diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c
index 57c7b79..ddb4796 100644
--- a/src/pacman/upgrade.c
+++ b/src/pacman/upgrade.c
@@ -132,6 +132,7 @@ int pacman_upgrade(alpm_list_t *targets)
/* print targets and ask user confirmation */
alpm_list_t *packages = alpm_trans_get_add();
if(packages == NULL) { /* we are done */
+ printf(_(" there is nothing to do\n"));
trans_release();
return(retval);
}
--
1.6.6
More information about the pacman-dev
mailing list