From 04d211effa8d65020887112ee30c7b3b0fc28ad3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 9 Apr 2017 20:42:01 -0400 Subject: add --overwrite option to ignore file conflicts Allows for safer, more fine-grained control for overwriting files than --force's all-or-nothing approach. Implements FS#31549. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- src/pacman/pacman.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index fe96cb3b..e0e7d01d 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -190,6 +190,8 @@ static void usage(int op, const char * const myname) case PM_OP_SYNC: case PM_OP_UPGRADE: addlist(_(" --force force install, overwrite conflicting files\n")); + addlist(_(" --overwrite \n" + " overwrite conflicting files (can be used more than once)\n")); addlist(_(" --asdeps install packages as non-explicitly installed\n")); addlist(_(" --asexplicit install packages as explicitly installed\n")); addlist(_(" --ignore ignore a package upgrade (can be used more than once)\n")); @@ -708,6 +710,9 @@ static int parsearg_upgrade(int opt) case OP_FORCE: config->flags |= ALPM_TRANS_FLAG_FORCE; break; + case OP_OVERWRITE_FILES: + parsearg_util_addlist(&(config->overwrite_files)); + break; case OP_ASDEPS: config->flags |= ALPM_TRANS_FLAG_ALLDEPS; break; @@ -929,6 +934,7 @@ static int parseargs(int argc, char *argv[]) {"assume-installed", required_argument, 0, OP_ASSUMEINSTALLED}, {"debug", optional_argument, 0, OP_DEBUG}, {"force", no_argument, 0, OP_FORCE}, + {"overwrite", required_argument, 0, OP_OVERWRITE_FILES}, {"noprogressbar", no_argument, 0, OP_NOPROGRESSBAR}, {"noscriptlet", no_argument, 0, OP_NOSCRIPTLET}, {"ask", required_argument, 0, OP_ASK}, -- cgit v1.2.3-54-g00ecf