mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-08 12:28:00 -05:00
Rename -t --orphans to -t --unrequired (FS#9144).
It turns out the orphan name was misleading. Real orphans are packages installed as dependency no longer required by any others (-Qtd). The -t option only shows package not required by any others, so --unrequired describes it better. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
abd14fdac0
commit
aec7c13648
@ -177,7 +177,7 @@ _pacman ()
|
|||||||
changelog) mod="${mod}c" ;;
|
changelog) mod="${mod}c" ;;
|
||||||
deps) mod="${mod}d" ;;
|
deps) mod="${mod}d" ;;
|
||||||
explicit) mod="${mod}e" ;;
|
explicit) mod="${mod}e" ;;
|
||||||
orphans) mod="${mod}t" ;;
|
unrequired) mod="${mod}t" ;;
|
||||||
foreign) mod="${mod}m" ;;
|
foreign) mod="${mod}m" ;;
|
||||||
owns) mod="${mod}o" ;;
|
owns) mod="${mod}o" ;;
|
||||||
file) mod="${mod}p" ;;
|
file) mod="${mod}p" ;;
|
||||||
@ -298,7 +298,7 @@ _pacman ()
|
|||||||
-o --owns \
|
-o --owns \
|
||||||
-p --file \
|
-p --file \
|
||||||
-s --search \
|
-s --search \
|
||||||
-t --orphans \
|
-t --unrequired \
|
||||||
-u --upgrades \
|
-u --upgrades \
|
||||||
--config \
|
--config \
|
||||||
--logfile \
|
--logfile \
|
||||||
|
@ -38,7 +38,6 @@ _pacman_opts_pkgfile=(
|
|||||||
|
|
||||||
# options for passing to _arguments: subactions for --query command
|
# options for passing to _arguments: subactions for --query command
|
||||||
_pacman_opts_query_actions=(
|
_pacman_opts_query_actions=(
|
||||||
'-e[List orphaned packages]:*:orphans:->query_orphans'
|
|
||||||
'-g[View all members of a package group]:*:package groups:->query_group'
|
'-g[View all members of a package group]:*:package groups:->query_group'
|
||||||
'-o[Query the package that owns a file]:file:_files'
|
'-o[Query the package that owns a file]:file:_files'
|
||||||
'-p[Package file to query]:*:package file:->query_file'
|
'-p[Package file to query]:*:package file:->query_file'
|
||||||
@ -135,11 +134,6 @@ _pacman_action_query() {
|
|||||||
"$_pacman_opts_query_modifiers[@]" \
|
"$_pacman_opts_query_modifiers[@]" \
|
||||||
'*:groups:_pacman_completions_installed_groups'
|
'*:groups:_pacman_completions_installed_groups'
|
||||||
;;
|
;;
|
||||||
query_orphans)
|
|
||||||
_arguments -s : \
|
|
||||||
"$_pacman_opts_common[@]" \
|
|
||||||
"$_pacman_opts_query_modifiers[@]"
|
|
||||||
;;
|
|
||||||
query_owner)
|
query_owner)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
|
@ -194,7 +194,7 @@ Query Options[[QO]]
|
|||||||
This will search each locally-installed package for names or
|
This will search each locally-installed package for names or
|
||||||
descriptions that match `regexp`.
|
descriptions that match `regexp`.
|
||||||
|
|
||||||
*-t, \--orphans*::
|
*-t, \--unrequired*::
|
||||||
Restrict or filter output to packages not required by any currently
|
Restrict or filter output to packages not required by any currently
|
||||||
installed package.
|
installed package.
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ typedef struct __config_t {
|
|||||||
unsigned short op_q_info;
|
unsigned short op_q_info;
|
||||||
unsigned short op_q_list;
|
unsigned short op_q_list;
|
||||||
unsigned short op_q_foreign;
|
unsigned short op_q_foreign;
|
||||||
unsigned short op_q_orphans;
|
unsigned short op_q_unrequired;
|
||||||
unsigned short op_q_deps;
|
unsigned short op_q_deps;
|
||||||
unsigned short op_q_explicit;
|
unsigned short op_q_explicit;
|
||||||
unsigned short op_q_owns;
|
unsigned short op_q_owns;
|
||||||
|
@ -108,7 +108,7 @@ static void usage(int op, const char * const myname)
|
|||||||
printf(_(" -o, --owns <file> query the package that owns <file>\n"));
|
printf(_(" -o, --owns <file> query the package that owns <file>\n"));
|
||||||
printf(_(" -p, --file <package> query a package file instead of the database\n"));
|
printf(_(" -p, --file <package> query a package file instead of the database\n"));
|
||||||
printf(_(" -s, --search <regex> search locally-installed packages for matching strings\n"));
|
printf(_(" -s, --search <regex> search locally-installed packages for matching strings\n"));
|
||||||
printf(_(" -t, --orphans list all packages not required by any package\n"));
|
printf(_(" -t, --unrequired list all packages not required by any package\n"));
|
||||||
printf(_(" -u, --upgrades list all packages that can be upgraded\n"));
|
printf(_(" -u, --upgrades list all packages that can be upgraded\n"));
|
||||||
printf(_(" -q, --quiet show less information for query and search\n"));
|
printf(_(" -q, --quiet show less information for query and search\n"));
|
||||||
} else if(op == PM_OP_SYNC) {
|
} else if(op == PM_OP_SYNC) {
|
||||||
@ -325,7 +325,7 @@ static int parseargs(int argc, char *argv[])
|
|||||||
{"root", required_argument, 0, 'r'},
|
{"root", required_argument, 0, 'r'},
|
||||||
{"recursive", no_argument, 0, 's'},
|
{"recursive", no_argument, 0, 's'},
|
||||||
{"search", no_argument, 0, 's'},
|
{"search", no_argument, 0, 's'},
|
||||||
{"orphans", no_argument, 0, 't'},
|
{"unrequired", no_argument, 0, 't'},
|
||||||
{"upgrades", no_argument, 0, 'u'},
|
{"upgrades", no_argument, 0, 'u'},
|
||||||
{"sysupgrade", no_argument, 0, 'u'},
|
{"sysupgrade", no_argument, 0, 'u'},
|
||||||
{"verbose", no_argument, 0, 'v'},
|
{"verbose", no_argument, 0, 'v'},
|
||||||
@ -461,7 +461,7 @@ static int parseargs(int argc, char *argv[])
|
|||||||
config->flags |= PM_TRANS_FLAG_RECURSE;
|
config->flags |= PM_TRANS_FLAG_RECURSE;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
config->op_q_orphans = 1;
|
config->op_q_unrequired = 1;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
config->op_s_upgrade = 1;
|
config->op_s_upgrade = 1;
|
||||||
|
@ -263,7 +263,7 @@ static int is_foreign(pmpkg_t *pkg)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_orphan(pmpkg_t *pkg)
|
static int is_unrequired(pmpkg_t *pkg)
|
||||||
{
|
{
|
||||||
alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg);
|
alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg);
|
||||||
if(requiredby == NULL) {
|
if(requiredby == NULL) {
|
||||||
@ -289,8 +289,8 @@ static int filter(pmpkg_t *pkg)
|
|||||||
if(config->op_q_foreign && !is_foreign(pkg)) {
|
if(config->op_q_foreign && !is_foreign(pkg)) {
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
/* check if this pkg is orphaned */
|
/* check if this pkg is unrequired */
|
||||||
if(config->op_q_orphans && !is_orphan(pkg)) {
|
if(config->op_q_unrequired && !is_unrequired(pkg)) {
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user