feat: removed keepoptdep references, changed logic to take into account RECURSEALL instead
This commit is contained in:
parent
2adbb6e4de
commit
09f1e13659
4 changed files with 3 additions and 18 deletions
|
@ -2818,8 +2818,7 @@ typedef enum _alpm_transflag_t {
|
||||||
ALPM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
|
ALPM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
|
||||||
/** Ignore dependency conflicts. */
|
/** Ignore dependency conflicts. */
|
||||||
ALPM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
|
ALPM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
|
||||||
/** Cancel removal of package if it's optdepends of another package. */
|
/* (1 << 12) flag can go here */
|
||||||
ALPM_TRANS_FLAG_KEEPOPTIONALS = (1 << 12),
|
|
||||||
/** Do not install a package if it is already installed and up to date. */
|
/** Do not install a package if it is already installed and up to date. */
|
||||||
ALPM_TRANS_FLAG_NEEDED = (1 << 13),
|
ALPM_TRANS_FLAG_NEEDED = (1 << 13),
|
||||||
/** Use ALPM_PKG_REASON_EXPLICIT when installing packages. */
|
/** Use ALPM_PKG_REASON_EXPLICIT when installing packages. */
|
||||||
|
|
|
@ -268,18 +268,12 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||||
removing_optdepends = remove_notify_needed_optdepends(handle, trans->remove);
|
removing_optdepends = remove_notify_needed_optdepends(handle, trans->remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -Rks or Rsk == -Rs then -Rk */
|
if ((trans->flags & ALPM_TRANS_FLAG_RECURSE)
|
||||||
if (trans->flags & ALPM_TRANS_FLAG_RECURSE
|
&& !(trans->flags & ALPM_TRANS_FLAG_RECURSEALL)
|
||||||
&& trans->flags & ALPM_TRANS_FLAG_KEEPOPTIONALS
|
|
||||||
&& removing_optdepends) {
|
&& removing_optdepends) {
|
||||||
RET_ERR(handle, ALPM_ERR_REMOVING_OPTDEPENDS_DEPS, -1);
|
RET_ERR(handle, ALPM_ERR_REMOVING_OPTDEPENDS_DEPS, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(trans->flags & ALPM_TRANS_FLAG_RECURSE)
|
|
||||||
&& trans->flags & ALPM_TRANS_FLAG_KEEPOPTIONALS) {
|
|
||||||
_alpm_log(handle, ALPM_LOG_WARNING, _("-k is set without -s or --recursive, ignoring flag...\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
|
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
|
||||||
event.type = ALPM_EVENT_CHECKDEPS_DONE;
|
event.type = ALPM_EVENT_CHECKDEPS_DONE;
|
||||||
EVENT(handle, &event);
|
EVENT(handle, &event);
|
||||||
|
|
|
@ -209,7 +209,6 @@ enum {
|
||||||
OP_UPGRADES,
|
OP_UPGRADES,
|
||||||
OP_SYSUPGRADE,
|
OP_SYSUPGRADE,
|
||||||
OP_UNNEEDED,
|
OP_UNNEEDED,
|
||||||
OP_KEEPOPTDEP,
|
|
||||||
OP_VERBOSE,
|
OP_VERBOSE,
|
||||||
OP_DOWNLOADONLY,
|
OP_DOWNLOADONLY,
|
||||||
OP_REFRESH,
|
OP_REFRESH,
|
||||||
|
|
|
@ -126,8 +126,6 @@ static void usage(int op, const char * const myname)
|
||||||
addlist(_(" -n, --nosave remove configuration files\n"));
|
addlist(_(" -n, --nosave remove configuration files\n"));
|
||||||
addlist(_(" -s, --recursive remove unnecessary dependencies\n"
|
addlist(_(" -s, --recursive remove unnecessary dependencies\n"
|
||||||
" (-ss includes explicitly installed dependencies)\n"));
|
" (-ss includes explicitly installed dependencies)\n"));
|
||||||
addlist(_(" -k, --keepoptdep keep the packages flagged as optdepends by other packages\n"
|
|
||||||
" (only applied when using -s or --recursive)\n"));
|
|
||||||
addlist(_(" -u, --unneeded remove unneeded packages\n"));
|
addlist(_(" -u, --unneeded remove unneeded packages\n"));
|
||||||
} else if(op == PM_OP_UPGRADE) {
|
} else if(op == PM_OP_UPGRADE) {
|
||||||
printf("%s: %s {-U --upgrade} [%s] <%s>\n", str_usg, myname, str_opt, str_file);
|
printf("%s: %s {-U --upgrade} [%s] <%s>\n", str_usg, myname, str_opt, str_file);
|
||||||
|
@ -731,10 +729,6 @@ static int parsearg_remove(int opt)
|
||||||
case 'u':
|
case 'u':
|
||||||
config->flags |= ALPM_TRANS_FLAG_UNNEEDED;
|
config->flags |= ALPM_TRANS_FLAG_UNNEEDED;
|
||||||
break;
|
break;
|
||||||
case OP_KEEPOPTDEP:
|
|
||||||
case 'k':
|
|
||||||
config->flags |= ALPM_TRANS_FLAG_KEEPOPTIONALS;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -960,7 +954,6 @@ static int parseargs(int argc, char *argv[])
|
||||||
{"upgrades", no_argument, 0, OP_UPGRADES},
|
{"upgrades", no_argument, 0, OP_UPGRADES},
|
||||||
{"sysupgrade", no_argument, 0, OP_SYSUPGRADE},
|
{"sysupgrade", no_argument, 0, OP_SYSUPGRADE},
|
||||||
{"unneeded", no_argument, 0, OP_UNNEEDED},
|
{"unneeded", no_argument, 0, OP_UNNEEDED},
|
||||||
{"keepoptdep", no_argument, 0, OP_KEEPOPTDEP},
|
|
||||||
{"verbose", no_argument, 0, OP_VERBOSE},
|
{"verbose", no_argument, 0, OP_VERBOSE},
|
||||||
{"downloadonly", no_argument, 0, OP_DOWNLOADONLY},
|
{"downloadonly", no_argument, 0, OP_DOWNLOADONLY},
|
||||||
{"refresh", no_argument, 0, OP_REFRESH},
|
{"refresh", no_argument, 0, OP_REFRESH},
|
||||||
|
|
Loading…
Add table
Reference in a new issue