2 # ==============================================================================
3 # portsreinstall library script
4 # - "show" command operation -
5 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
6 # This software is distributed under the 2-Clause BSD License.
7 # ==============================================================================
9 # ============= Execute command operations which should be done without upgrade of tools =============
12 local flag_filter_skip_unchanged flag_filter_only_target listdb pkgnamedb dbsuffix list origin_target
13 flag_filter_skip_unchanged=
14 flag_filter_only_target=
15 pkgnamedb='moved_from obsolete initial'
16 [ -n "$COMMAND_SHOW_DEPTAG" ] || COMMAND_SHOW_DEPTAG=`options_get_dependency_type`
17 [ -n "$COMMAND_SHOW_LEVEL" ] || COMMAND_SHOW_LEVEL=`options_get_dependency_level`
18 dbsuffix=$COMMAND_SHOW_DEPTAG.$COMMAND_SHOW_LEVEL
19 case $COMMAND_SHOW_SUBJECT in
20 todo | done | redo | resolved | inst_by_pkg | inst_built_default | inst_built_custom | failure | taboo | freeze | need | noneed | deleted | restored | fossil |conflict | moved )
21 database_query_show_single_list_exec "$COMMAND_SHOW_SUBJECT" \
22 "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" || :
25 database_query_show_single_list_exec "$COMMAND_SHOW_SUBJECT" \
26 "$COMMAND_SHOW_KEYWORD" '' || :
28 build_conflict_pkgs | inst_conflict_pkgs )
29 case $COMMAND_SHOW_SUBJECT in
31 message_echo "Installed conflicting packages in the build:"
35 message_echo "Installed conflicting packages in the installation:"
39 pkgsys_eval_ports_glob "$@" | while read origin
41 pkgsys_get_conflicting_installed_pkgs "$mode" "$origin"
45 grandtitle="Dependencies based on the initially installed packages"
46 title="The following port(s) was/were required by %s:"
47 list=requirements.$dbsuffix
52 grandtitle="Dependencies based on the latest ports tree"
53 title="The following port(s) is/are required by %s:"
54 list=requirements.$dbsuffix
56 pkgnamedb='moved_from'
59 grandtitle="Dependencies based on the initially installed packages"
60 title="The following port(s) depended on %s:"
61 list=dependents.$dbsuffix
66 grandtitle="Dependencies based on the latest ports tree"
67 title="The following port(s) depend(s) on %s:"
68 list=dependents.$dbsuffix
70 pkgnamedb='moved_from'
73 grandtitle="Possible additional conflict files"
74 title="The following packages' files conflict with %s:"
75 list=possible_additional_conflict.csv
77 pkgnamedb='moved_from'
78 database_query_show_two_column_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
81 grandtitle="Success/failure status in (re)installation"
82 lists='todo|done|redo|resolved|inst_by_pkg|inst_built_default|inst_built_custom|failure|taboo|freeze|need|noneed|deleted|restored|fossil|conflict'
83 database_query_show_list_inclusion_of_matching_port "$grandtitle" "$lists" "$pkgnamedb" \
84 "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"
87 grandtitle="Error messages in (re)installation:"
88 title="\n==== %s ===="
91 pkgnamedb='moved_from'
92 database_query_show_log "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
95 case $COMMAND_SHOW_SUBJECT in
96 initrequirements | requirements | initdependents | dependents )
97 [ $COMMAND_SHOW_DEPTAG = none ] && \
98 message_echo "WARNING: This command has no meaning with the current options setting." >&2
99 database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"