summaryrefslogtreecommitdiffstats
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-10 02:42:01 +0200
committerAllan McRae <allan@archlinux.org>2017-04-12 03:47:33 +0200
commit04d211effa8d65020887112ee30c7b3b0fc28ad3 (patch)
tree9939b65851a6fc5bb6a0863d286b8da0d4876e74 /src/pacman/pacman.c
parent86f5c74694cb0403eaf11fa4734f307a0df345cb (diff)
downloadpacman-04d211effa8d65020887112ee30c7b3b0fc28ad3.tar.gz
pacman-04d211effa8d65020887112ee30c7b3b0fc28ad3.tar.xz
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 <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c6
1 files changed, 6 insertions, 0 deletions
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 <path>\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 <pkg> 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},