pacman: move --nosave to transaction flags

--nosave is now useful when installing packages as it can be combined
with --nokeep to reinstall the packages backup files without generating
a pacsave.
This commit is contained in:
morganamilo 2021-09-20 18:36:53 +01:00
parent ddcceb9314
commit 36d3d8401c
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5
2 changed files with 11 additions and 10 deletions

View file

@ -210,6 +210,11 @@ Transaction Options (apply to '-S', '-R' and '-U')
dependencies are installed and there are no package conflicts in the dependencies are installed and there are no package conflicts in the
system. Specify this option twice to skip all dependency checks. system. Specify this option twice to skip all dependency checks.
*-n, \--nosave*::
Instructs pacman to ignore file backup designations. Normally, when a
file is removed from the system, the database is checked to see if the
file should be renamed with a '.pacsave' extension.
*\--assume-installed* <package=version>:: *\--assume-installed* <package=version>::
Add a virtual package "package" with version "version" to the transaction Add a virtual package "package" with version "version" to the transaction
to satisfy dependencies. This allows to disable specific dependency checks to satisfy dependencies. This allows to disable specific dependency checks
@ -375,11 +380,6 @@ Remove Options (apply to '-R')[[RO]]
or more target packages. This operation is recursive and must be used or more target packages. This operation is recursive and must be used
with care, since it can remove many potentially needed packages. with care, since it can remove many potentially needed packages.
*-n, \--nosave*::
Instructs pacman to ignore file backup designations. Normally, when a
file is removed from the system, the database is checked to see if the
file should be renamed with a '.pacsave' extension.
*-s, \--recursive*:: *-s, \--recursive*::
Remove each target specified including all of their dependencies, provided Remove each target specified including all of their dependencies, provided
that (A) they are not required by other packages; and (B) they were not that (A) they are not required by other packages; and (B) they were not

View file

@ -123,7 +123,6 @@ static void usage(int op, const char * const myname)
printf("%s: %s {-R --remove} [%s] <%s>\n", str_usg, myname, str_opt, str_pkg); printf("%s: %s {-R --remove} [%s] <%s>\n", str_usg, myname, str_opt, str_pkg);
printf("%s:\n", str_opt); printf("%s:\n", str_opt);
addlist(_(" -c, --cascade remove packages and all packages that depend on them\n")); addlist(_(" -c, --cascade remove packages and all packages that depend on them\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(_(" -u, --unneeded remove unneeded packages\n")); addlist(_(" -u, --unneeded remove unneeded packages\n"));
@ -200,6 +199,7 @@ static void usage(int op, const char * const myname)
__attribute__((fallthrough)); __attribute__((fallthrough));
case PM_OP_REMOVE: case PM_OP_REMOVE:
addlist(_(" -d, --nodeps skip dependency version checks (-dd to skip all checks)\n")); addlist(_(" -d, --nodeps skip dependency version checks (-dd to skip all checks)\n"));
addlist(_(" -n, --nosave remove configuration files\n"));
addlist(_(" --assume-installed <package=version>\n" addlist(_(" --assume-installed <package=version>\n"
" add a virtual package to satisfy dependencies\n")); " add a virtual package to satisfy dependencies\n"));
addlist(_(" --dbonly only modify database entries, not package files\n")); addlist(_(" --dbonly only modify database entries, not package files\n"));
@ -632,6 +632,11 @@ static int parsearg_trans(int opt)
config->flags |= ALPM_TRANS_FLAG_NODEPVERSION; config->flags |= ALPM_TRANS_FLAG_NODEPVERSION;
} }
break; break;
case OP_NOSAVE:
case 'n':
config->flags |= ALPM_TRANS_FLAG_NOSAVE;
break;
case OP_DBONLY: case OP_DBONLY:
config->flags |= ALPM_TRANS_FLAG_DBONLY; config->flags |= ALPM_TRANS_FLAG_DBONLY;
config->flags |= ALPM_TRANS_FLAG_NOSCRIPTLET; config->flags |= ALPM_TRANS_FLAG_NOSCRIPTLET;
@ -681,10 +686,6 @@ static int parsearg_remove(int opt)
case 'c': case 'c':
config->flags |= ALPM_TRANS_FLAG_CASCADE; config->flags |= ALPM_TRANS_FLAG_CASCADE;
break; break;
case OP_NOSAVE:
case 'n':
config->flags |= ALPM_TRANS_FLAG_NOSAVE;
break;
case OP_RECURSIVE: case OP_RECURSIVE:
case 's': case 's':
if(config->flags & ALPM_TRANS_FLAG_RECURSE) { if(config->flags & ALPM_TRANS_FLAG_RECURSE) {