pacman: add --nokeep

This commit is contained in:
morganamilo 2021-09-20 18:31:55 +01:00
parent 0c701af590
commit ddcceb9314
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5
3 changed files with 9 additions and 0 deletions

View file

@ -269,6 +269,9 @@ Upgrade Options (apply to '-S' and '-U')[[UO]]
*\--needed*:: *\--needed*::
Do not reinstall the targets that are already up-to-date. Do not reinstall the targets that are already up-to-date.
*\--nokeep*::
Overwrite backup files when installing packages.
*\--overwrite* <glob>:: *\--overwrite* <glob>::
Bypass file conflict checks and overwrite conflicting files. If the Bypass file conflict checks and overwrite conflicting files. If the
package that is about to be installed contains files that are already package that is about to be installed contains files that are already

View file

@ -169,6 +169,7 @@ enum {
OP_LOGFILE, OP_LOGFILE,
OP_IGNOREGROUP, OP_IGNOREGROUP,
OP_NEEDED, OP_NEEDED,
OP_NOKEEP,
OP_ASEXPLICIT, OP_ASEXPLICIT,
OP_ARCH, OP_ARCH,
OP_PRINTFORMAT, OP_PRINTFORMAT,

View file

@ -164,6 +164,7 @@ static void usage(int op, const char * const myname)
addlist(_(" -y, --refresh download fresh package databases from the server\n" addlist(_(" -y, --refresh download fresh package databases from the server\n"
" (-yy to force a refresh even if up to date)\n")); " (-yy to force a refresh even if up to date)\n"));
addlist(_(" --needed do not reinstall up to date packages\n")); addlist(_(" --needed do not reinstall up to date packages\n"));
addlist(_(" --nokeep overwrite backup files when installing packages\n"));
} else if(op == PM_OP_DATABASE) { } else if(op == PM_OP_DATABASE) {
printf("%s: %s {-D --database} <%s> <%s>\n", str_usg, myname, str_opt, str_pkg); printf("%s: %s {-D --database} <%s> <%s>\n", str_usg, myname, str_opt, str_pkg);
printf("%s:\n", str_opt); printf("%s:\n", str_opt);
@ -731,6 +732,9 @@ static int parsearg_upgrade(int opt)
case OP_NEEDED: case OP_NEEDED:
config->flags |= ALPM_TRANS_FLAG_NEEDED; config->flags |= ALPM_TRANS_FLAG_NEEDED;
break; break;
case OP_NOKEEP:
config->flags |= ALPM_TRANS_FLAG_NOKEEP;
break;
case OP_IGNORE: case OP_IGNORE:
parsearg_util_addlist(&(config->ignorepkg)); parsearg_util_addlist(&(config->ignorepkg));
break; break;
@ -941,6 +945,7 @@ static int parseargs(int argc, char *argv[])
{"logfile", required_argument, 0, OP_LOGFILE}, {"logfile", required_argument, 0, OP_LOGFILE},
{"ignoregroup", required_argument, 0, OP_IGNOREGROUP}, {"ignoregroup", required_argument, 0, OP_IGNOREGROUP},
{"needed", no_argument, 0, OP_NEEDED}, {"needed", no_argument, 0, OP_NEEDED},
{"nokeep", no_argument, 0, OP_NOKEEP},
{"asexplicit", no_argument, 0, OP_ASEXPLICIT}, {"asexplicit", no_argument, 0, OP_ASEXPLICIT},
{"arch", required_argument, 0, OP_ARCH}, {"arch", required_argument, 0, OP_ARCH},
{"print-format", required_argument, 0, OP_PRINTFORMAT}, {"print-format", required_argument, 0, OP_PRINTFORMAT},