Remove the last traces of the pacman --force option

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2018-05-29 13:57:13 +10:00
parent e4be26b732
commit 7d05ffceaf
10 changed files with 2 additions and 114 deletions

View file

@ -1461,8 +1461,7 @@ alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
typedef enum _alpm_transflag_t { typedef enum _alpm_transflag_t {
/** Ignore dependency checks. */ /** Ignore dependency checks. */
ALPM_TRANS_FLAG_NODEPS = 1, ALPM_TRANS_FLAG_NODEPS = 1,
/** Ignore file conflicts and overwrite files. */ /* (1 << 1) flag can go here */
ALPM_TRANS_FLAG_FORCE = (1 << 1),
/** Delete files even if they are tagged as backup. */ /** Delete files even if they are tagged as backup. */
ALPM_TRANS_FLAG_NOSAVE = (1 << 2), ALPM_TRANS_FLAG_NOSAVE = (1 << 2),
/** Ignore version numbers when checking dependencies. */ /** Ignore version numbers when checking dependencies. */

View file

@ -401,8 +401,7 @@ static alpm_pkg_t *_alpm_find_file_owner(alpm_handle_t *handle, const char *path
static int _alpm_can_overwrite_file(alpm_handle_t *handle, const char *path, const char *rootedpath) static int _alpm_can_overwrite_file(alpm_handle_t *handle, const char *path, const char *rootedpath)
{ {
return handle->trans->flags & ALPM_TRANS_FLAG_FORCE return _alpm_fnmatch_patterns(handle->overwrite_files, path) == 0
|| _alpm_fnmatch_patterns(handle->overwrite_files, path) == 0
|| _alpm_fnmatch_patterns(handle->overwrite_files, rootedpath) == 0; || _alpm_fnmatch_patterns(handle->overwrite_files, rootedpath) == 0;
} }

View file

@ -716,11 +716,6 @@ static int parsearg_upgrade(int opt)
return 0; return 0;
} }
switch(opt) { switch(opt) {
case OP_FORCE:
pm_printf(ALPM_LOG_WARNING,
_("option --force is deprecated; use --overwrite instead\n"));
config->flags |= ALPM_TRANS_FLAG_FORCE;
break;
case OP_OVERWRITE_FILES: case OP_OVERWRITE_FILES:
parsearg_util_addlist(&(config->overwrite_files)); parsearg_util_addlist(&(config->overwrite_files));
break; break;

View file

@ -813,9 +813,6 @@ int sync_prepare_execute(void)
alpm_strerror(err)); alpm_strerror(err));
switch(err) { switch(err) {
case ALPM_ERR_FILE_CONFLICTS: case ALPM_ERR_FILE_CONFLICTS:
if(config->flags & ALPM_TRANS_FLAG_FORCE) {
printf(_("unable to %s directory-file conflicts\n"), "--force");
}
for(i = data; i; i = alpm_list_next(i)) { for(i = data; i; i = alpm_list_next(i)) {
alpm_fileconflict_t *conflict = i->data; alpm_fileconflict_t *conflict = i->data;
switch(conflict->type) { switch(conflict->type) {

View file

@ -276,11 +276,7 @@ TESTS += test/pacman/tests/upgrade005.py
TESTS += test/pacman/tests/upgrade006.py TESTS += test/pacman/tests/upgrade006.py
TESTS += test/pacman/tests/upgrade010.py TESTS += test/pacman/tests/upgrade010.py
TESTS += test/pacman/tests/upgrade011.py TESTS += test/pacman/tests/upgrade011.py
TESTS += test/pacman/tests/upgrade012.py
TESTS += test/pacman/tests/upgrade013.py TESTS += test/pacman/tests/upgrade013.py
TESTS += test/pacman/tests/upgrade014.py
TESTS += test/pacman/tests/upgrade015.py
TESTS += test/pacman/tests/upgrade016.py
TESTS += test/pacman/tests/upgrade020.py TESTS += test/pacman/tests/upgrade020.py
TESTS += test/pacman/tests/upgrade021.py TESTS += test/pacman/tests/upgrade021.py
TESTS += test/pacman/tests/upgrade022.py TESTS += test/pacman/tests/upgrade022.py
@ -299,7 +295,6 @@ TESTS += test/pacman/tests/upgrade041.py
TESTS += test/pacman/tests/upgrade042.py TESTS += test/pacman/tests/upgrade042.py
TESTS += test/pacman/tests/upgrade043.py TESTS += test/pacman/tests/upgrade043.py
TESTS += test/pacman/tests/upgrade045.py TESTS += test/pacman/tests/upgrade045.py
TESTS += test/pacman/tests/upgrade046.py
TESTS += test/pacman/tests/upgrade050.py TESTS += test/pacman/tests/upgrade050.py
TESTS += test/pacman/tests/upgrade051.py TESTS += test/pacman/tests/upgrade051.py
TESTS += test/pacman/tests/upgrade052.py TESTS += test/pacman/tests/upgrade052.py

View file

@ -1,14 +0,0 @@
self.description = "Install a package with a filesystem conflict (--force)"
p = pmpkg("dummy")
p.files = ["bin/dummy", "usr/man/man1/dummy.1"]
self.addpkg(p)
self.filesystem = ["bin/dummy"]
self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
self.addrule("FILE_MODIFIED=bin/dummy")
self.addrule("FILE_EXIST=usr/man/man1/dummy.1")

View file

@ -1,23 +0,0 @@
self.description = "Install two packages with a conflicting file (--force)"
p1 = pmpkg("dummy")
p1.files = ["bin/dummy",
"usr/man/man1/dummy.1",
"usr/common"]
p2 = pmpkg("foobar")
p2.files = ["bin/foobar",
"usr/man/man1/foobar.1",
"usr/common"]
for p in p1, p2:
self.addpkg(p)
self.args = "-U --force %s" % " ".join([p.filename() for p in (p1, p2)])
self.addrule("PACMAN_RETCODE=0")
for p in p1, p2:
self.addrule("PKG_EXIST=%s" % p.name)
self.addrule("PKG_FILES=%s|usr/common" % p.name)
for f in p.files:
self.addrule("FILE_EXIST=%s" % f)

View file

@ -1,14 +0,0 @@
self.description = "Install a package with an existing file (--force)"
p = pmpkg("dummy")
p.files = ["etc/dummy.conf"]
self.addpkg(p)
self.filesystem = ["etc/dummy.conf"]
self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
self.addrule("FILE_MODIFIED=etc/dummy.conf")
self.addrule("!FILE_PACNEW=etc/dummy.conf")

View file

@ -1,15 +0,0 @@
self.description = "Install a package with an existing file (--force, new modified)"
p = pmpkg("dummy")
p.files = ["etc/dummy.conf*"]
p.backup = ["etc/dummy.conf"]
self.addpkg(p)
self.filesystem = ["etc/dummy.conf"]
self.args = "-U --force %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
self.addrule("!FILE_MODIFIED=etc/dummy.conf")
self.addrule("FILE_PACNEW=etc/dummy.conf")

View file

@ -1,31 +0,0 @@
self.description = "File relocation between two packages (reverse order, --force)"
lp1 = pmpkg("dummy")
lp1.files = ["bin/dummy"]
lp2 = pmpkg("foobar")
lp2.files = ["bin/foobar",
"usr/share/file"]
for p in lp1, lp2:
self.addpkg2db("local", p)
p1 = pmpkg("dummy")
p1.files = ["bin/dummy",
"usr/share/file"]
p2 = pmpkg("foobar")
p2.files = ["bin/foobar"]
for p in p1, p2:
self.addpkg(p)
self.args = "-U --force %s" % " ".join([p.filename() for p in (p1, p2)])
self.addrule("PACMAN_RETCODE=0")
for p in p1, p2:
self.addrule("PKG_EXIST=%s" % p.name)
self.addrule("FILE_MODIFIED=bin/dummy")
self.addrule("FILE_MODIFIED=bin/foobar")
self.addrule("FILE_EXIST=usr/share/file")
self.addrule("FILE_MODIFIED=usr/share/file")