From 0d2600c575033774485f84ad67cbc602592237ab Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Oct 2011 12:35:33 -0500 Subject: 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 --- contrib/bash_completion.in | 4 ++-- contrib/zsh_completion.in | 4 ++-- doc/pacman.8.txt | 2 +- src/pacman/conf.h | 3 ++- src/pacman/pacman.c | 6 +++--- test/pacman/tests/upgrade012.py | 2 +- test/pacman/tests/upgrade014.py | 2 +- test/pacman/tests/upgrade015.py | 2 +- test/pacman/tests/upgrade016.py | 2 +- test/pacman/tests/upgrade046.py | 2 +- 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 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: -- cgit v1.2.3-70-g09d2