From 9a1ff474f1fe03e8bfdaf81ffc9a4881a44baea9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 15 Feb 2012 15:16:23 -0600 Subject: Revert "Enable recursive/needed sync on SyncFirst" This reverts commit 09034520325efcc2e684f05fa7a99c02bad1f5be. Tests affected by this revert have been adjusted; additionally a few EXIST tests have been removed where there is already a VERSION test doing the job for us. Signed-off-by: Dan McGee --- src/pacman/sync.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 4f10e6b9..fcc887ae 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -963,8 +963,6 @@ int pacman_sync(alpm_list_t *targets) FREELIST(targs); targs = packages; config->flags = 0; - config->flags |= ALPM_TRANS_FLAG_RECURSE; - config->flags |= ALPM_TRANS_FLAG_NEEDED; config->op_s_upgrade = 0; } else { FREELIST(packages); -- cgit v1.2.3 From 85712814cdbfa301e5827fafd6bfb8ac0886079c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 15 Feb 2012 15:40:01 -0600 Subject: Revert "Add -S --recursive operation" This reverts commit f3fa77bcf1d792971c314f8c0de255866e89f3f3 along with making other necessary changes to fully back this (mis)feature out until we can do it correctly. The quick summary here is this was not implemented correctly; provides are not fully taken into account in this logic, and making that happen exposes a lot of other flaws in this code that are covered up later on in the dependency resolving process by several other pieces of convoluted and conditional logic. Tests have been adjusted accordingly. Some test EXISTS conditions have been removed as we already know the package is installed locally, and we also are checking the VERSION condition anyway. With these two related revert commits, we do have some changes in test pass/fail results: * upgrade078.py: does not pass, this is due to --recursive getting removed for -U/-S operations after this commit. * sync302.py: the version checks have been disabled, so this test continues to pass but has been scaled back in scope. * sync303.py: now passes, was failing before. * sync304.py: still failing, was failing before. * sync305.py: now passes, was failing before. * sync306.py: still passes, was passing before. Signed-off-by: Dan McGee --- src/pacman/conf.h | 1 - src/pacman/pacman.c | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 9e14925a..42f25298 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -127,7 +127,6 @@ enum { OP_ARCH, OP_PRINTFORMAT, OP_GPGDIR, - OP_RECURSIVE, OP_DBONLY }; diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 381e0b71..c0c3bb8b 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -135,7 +135,6 @@ static void usage(int op, const char * const myname) } else if(op == PM_OP_UPGRADE) { printf("%s: %s {-U --upgrade} [%s] <%s>\n", str_usg, myname, str_opt, str_file); addlist(_(" --needed do not reinstall up to date packages\n")); - addlist(_(" --recursive reinstall all dependencies of target packages\n")); printf("%s:\n", str_opt); } else if(op == PM_OP_QUERY) { printf("%s: %s {-Q --query} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg); @@ -167,7 +166,6 @@ static void usage(int op, const char * const myname) addlist(_(" -w, --downloadonly download packages but do not install/upgrade anything\n")); addlist(_(" -y, --refresh download fresh package databases from the server\n")); addlist(_(" --needed do not reinstall up to date packages\n")); - addlist(_(" --recursive reinstall all dependencies of target packages\n")); } else if(op == PM_OP_DATABASE) { printf("%s: %s {-D --database} <%s> <%s>\n", str_usg, myname, str_opt, str_pkg); printf("%s:\n", str_opt); @@ -512,9 +510,6 @@ static int parsearg_remove(int opt) case 'c': config->flags |= ALPM_TRANS_FLAG_CASCADE; break; case 'n': config->flags |= ALPM_TRANS_FLAG_NOSAVE; break; case 's': - case OP_RECURSIVE: - /* 's' is the legacy flag here, but since recursive is used in -S without - * a shortopt, we need to do funky tricks */ if(config->flags & ALPM_TRANS_FLAG_RECURSE) { config->flags |= ALPM_TRANS_FLAG_RECURSEALL; } else { @@ -537,7 +532,6 @@ static int parsearg_upgrade(int opt) case OP_ASDEPS: config->flags |= ALPM_TRANS_FLAG_ALLDEPS; break; case OP_ASEXPLICIT: config->flags |= ALPM_TRANS_FLAG_ALLEXPLICIT; break; case OP_NEEDED: config->flags |= ALPM_TRANS_FLAG_NEEDED; break; - case OP_RECURSIVE: config->flags |= ALPM_TRANS_FLAG_RECURSE; break; case OP_IGNORE: parsearg_util_addlist(&(config->ignorepkg)); break; @@ -612,6 +606,7 @@ static int parseargs(int argc, char *argv[]) {"print", no_argument, 0, 'p'}, {"quiet", no_argument, 0, 'q'}, {"root", required_argument, 0, 'r'}, + {"recursive", no_argument, 0, 's'}, {"search", no_argument, 0, 's'}, {"unrequired", no_argument, 0, 't'}, {"upgrades", no_argument, 0, 'u'}, @@ -637,7 +632,6 @@ static int parseargs(int argc, char *argv[]) {"arch", required_argument, 0, OP_ARCH}, {"print-format", required_argument, 0, OP_PRINTFORMAT}, {"gpgdir", required_argument, 0, OP_GPGDIR}, - {"recursive", no_argument, 0, OP_RECURSIVE}, {"dbonly", no_argument, 0, OP_DBONLY}, {0, 0, 0, 0} }; -- cgit v1.2.3 From fe659153d5971e41b7483bb40c31cd40f58f9d9c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 19 Feb 2012 23:24:26 -0600 Subject: Give better error messages on database locking failures This was noted when trying to perform an operation on a pacman database on a read-only file system. Print the actual underlying errno string, and only show the "you can remove" message if the lock file actually exists. Before: $ pacman -Su error: failed to init transaction (unable to lock database) if you're sure a package manager is not already running, you can remove /e/db.lck After: $ pacman -Su error: failed to init transaction (unable to lock database) error: could not lock database: Read-only file system Signed-off-by: Dan McGee --- src/pacman/util.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pacman/util.c b/src/pacman/util.c index 0b076d97..f7f8ecf5 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -69,9 +69,13 @@ void trans_init_error(void) pm_printf(ALPM_LOG_ERROR, _("failed to init transaction (%s)\n"), alpm_strerror(err)); if(err == ALPM_ERR_HANDLE_LOCK) { - fprintf(stderr, _(" if you're sure a package manager is not already\n" - " running, you can remove %s\n"), - alpm_option_get_lockfile(config->handle)); + const char *lockfile = alpm_option_get_lockfile(config->handle); + pm_printf(ALPM_LOG_ERROR, _("could not lock database: %s\n"), + strerror(errno)); + if(access(lockfile, F_OK) == 0) { + fprintf(stderr, _(" if you're sure a package manager is not already\n" + " running, you can remove %s\n"), lockfile); + } } } -- cgit v1.2.3