summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-11 19:35:33 +0200
committerDan McGee <dan@archlinux.org>2011-10-14 15:13:38 +0200
commit0d2600c575033774485f84ad67cbc602592237ab (patch)
tree55e813faed36b47a2ef7757d2eb5a81ee6275f31
parent8605284e0d1b70d9845ca4c6362d7d451f503d32 (diff)
downloadpacman-0d2600c575033774485f84ad67cbc602592237ab.tar.gz
pacman-0d2600c575033774485f84ad67cbc602592237ab.tar.xz
Remove -f short option for --force
This is not something that should be used on a frequent basis, and giving it a short option encourages use without making the drawbacks obvious. For the 1% of situations that require it, the 5 extra keystrokes are a fair price to pay. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--contrib/bash_completion.in4
-rw-r--r--contrib/zsh_completion.in4
-rw-r--r--doc/pacman.8.txt2
-rw-r--r--src/pacman/conf.h3
-rw-r--r--src/pacman/pacman.c6
-rw-r--r--test/pacman/tests/upgrade012.py2
-rw-r--r--test/pacman/tests/upgrade014.py2
-rw-r--r--test/pacman/tests/upgrade015.py2
-rw-r--r--test/pacman/tests/upgrade016.py2
-rw-r--r--test/pacman/tests/upgrade046.py2
10 files changed, 15 insertions, 14 deletions
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in
index 78bde21d..eb31b5e5 100644
--- a/contrib/bash_completion.in
+++ b/contrib/bash_completion.in
@@ -76,8 +76,8 @@ _pacman() {
remove=('cascade dbonly nodeps nosave print recursive unneeded' 'c n p s u')
sync=('asdeps asexplicit clean dbonly downloadonly force groups ignore ignoregroup
info list needed nodeps print refresh recursive search sysupgrade'
- 'c f g i l p s u w y')
- upgrade=('asdeps asexplicit force needed nodeps print recursive' 'f p')
+ 'c g i l p s u w y')
+ upgrade=('asdeps asexplicit force needed nodeps print recursive' 'p')
common=('arch cachedir config dbpath debug help logfile noconfirm
noprogressbar noscriptlet quiet root verbose' 'b d h q r v')
core=('database help query remove sync upgrade version' 'D Q R S U V h')
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in
index f7e0b923..71ef901b 100644
--- a/contrib/zsh_completion.in
+++ b/contrib/zsh_completion.in
@@ -32,8 +32,8 @@ _pacman_opts_common=(
# options for passing to _arguments: options for --upgrade commands
_pacman_opts_pkgfile=(
'-d[Skip dependency checks]'
- '-f[Overwrite conflicting files]'
'--dbonly[Only remove database entry, do not remove files]'
+ '--force[Overwrite conflicting files]'
'--needed[Do not reinstall up to date packages]'
'--recursive[Reinstall all dependencies of target packages]'
'*:package file:_files -g "*.pkg.tar.*(.)"'
@@ -85,7 +85,6 @@ _pacman_opts_sync_actions=(
# options for passing to _arguments: options for --sync command
_pacman_opts_sync_modifiers=(
'-d[Skip dependency checks]'
- '-f[Overwrite conflicting files]'
'-i[View package information]'
'-l[List all packages in a repository]'
'-p[Print download URIs for each package to be installed]'
@@ -98,6 +97,7 @@ _pacman_opts_sync_modifiers=(
_pacman_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]'
'--asexplicit[Install packages as explicitly installed]'
+ '--force[Overwrite conflicting files]'
)
# handles --help subcommand
diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 59853812..39551e15 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -201,7 +201,7 @@ Transaction Options (apply to '-S', '-R' and '-U')
Upgrade Options (apply to '-S' and '-U')[[UO]]
--------------------------------------------
-*-f, \--force*::
+*\--force*::
Bypass file conflict checks and overwrite conflicting files. If the
package that is about to be installed contains files that are already
installed, this option will cause all those files to be overwritten.
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 9e14925a..325fbb64 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -128,7 +128,8 @@ enum {
OP_PRINTFORMAT,
OP_GPGDIR,
OP_RECURSIVE,
- OP_DBONLY
+ OP_DBONLY,
+ OP_FORCE
};
/* clean method */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index ac793dfc..fa35e8de 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -177,7 +177,7 @@ static void usage(int op, const char * const myname)
switch(op) {
case PM_OP_SYNC:
case PM_OP_UPGRADE:
- addlist(_(" -f, --force force install, overwrite conflicting files\n"));
+ addlist(_(" --force force install, overwrite conflicting files\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"));
@@ -530,7 +530,7 @@ static int parsearg_upgrade(int opt)
if(parsearg_trans(opt) == 0)
return 0;
switch(opt) {
- case 'f': config->flags |= ALPM_TRANS_FLAG_FORCE; break;
+ case OP_FORCE: config->flags |= ALPM_TRANS_FLAG_FORCE; break;
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;
@@ -596,7 +596,6 @@ static int parseargs(int argc, char *argv[])
{"nodeps", no_argument, 0, 'd'},
{"deps", no_argument, 0, 'd'},
{"explicit", no_argument, 0, 'e'},
- {"force", no_argument, 0, 'f'},
{"groups", no_argument, 0, 'g'},
{"help", no_argument, 0, 'h'},
{"info", no_argument, 0, 'i'},
@@ -622,6 +621,7 @@ static int parseargs(int argc, char *argv[])
{"config", required_argument, 0, OP_CONFIG},
{"ignore", required_argument, 0, OP_IGNORE},
{"debug", optional_argument, 0, OP_DEBUG},
+ {"force", no_argument, 0, OP_FORCE},
{"noprogressbar", no_argument, 0, OP_NOPROGRESSBAR},
{"noscriptlet", no_argument, 0, OP_NOSCRIPTLET},
{"ask", required_argument, 0, OP_ASK},
diff --git a/test/pacman/tests/upgrade012.py b/test/pacman/tests/upgrade012.py
index dba8dc18..4d9f0cd1 100644
--- a/test/pacman/tests/upgrade012.py
+++ b/test/pacman/tests/upgrade012.py
@@ -6,7 +6,7 @@ self.addpkg(p)
self.filesystem = ["bin/dummy"]
-self.args = "-Uf %s" % p.filename()
+self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
diff --git a/test/pacman/tests/upgrade014.py b/test/pacman/tests/upgrade014.py
index 1632dd36..93c2fe2b 100644
--- a/test/pacman/tests/upgrade014.py
+++ b/test/pacman/tests/upgrade014.py
@@ -13,7 +13,7 @@ p2.files = ["bin/foobar",
for p in p1, p2:
self.addpkg(p)
-self.args = "-Uf %s" % " ".join([p.filename() for p in p1, p2])
+self.args = "-U --force %s" % " ".join([p.filename() for p in p1, p2])
self.addrule("PACMAN_RETCODE=0")
for p in p1, p2:
diff --git a/test/pacman/tests/upgrade015.py b/test/pacman/tests/upgrade015.py
index 22f7c36b..ea6046cb 100644
--- a/test/pacman/tests/upgrade015.py
+++ b/test/pacman/tests/upgrade015.py
@@ -6,7 +6,7 @@ self.addpkg(p)
self.filesystem = ["etc/dummy.conf"]
-self.args = "-Uf %s" % p.filename()
+self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
diff --git a/test/pacman/tests/upgrade016.py b/test/pacman/tests/upgrade016.py
index dd31c9ab..b6b3f3ae 100644
--- a/test/pacman/tests/upgrade016.py
+++ b/test/pacman/tests/upgrade016.py
@@ -7,7 +7,7 @@ self.addpkg(p)
self.filesystem = ["etc/dummy.conf"]
-self.args = "-Uf %s" % p.filename()
+self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
diff --git a/test/pacman/tests/upgrade046.py b/test/pacman/tests/upgrade046.py
index 12390647..a02a7132 100644
--- a/test/pacman/tests/upgrade046.py
+++ b/test/pacman/tests/upgrade046.py
@@ -20,7 +20,7 @@ p2.files = ["bin/foobar"]
for p in p1, p2:
self.addpkg(p)
-self.args = "-Uf %s" % " ".join([p.filename() for p in p1, p2])
+self.args = "-U --force %s" % " ".join([p.filename() for p in p1, p2])
self.addrule("PACMAN_RETCODE=0")
for p in p1, p2: