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 | failure | taboo | freeze | need | noneed | deleted | restored | conflict )
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" '' || :
29 grandtitle="Dependencies based on the initially installed packages"
30 title="The following port(s) was/were required by %s:"
31 list=requirements.$dbsuffix
36 grandtitle="Dependencies based on the latest ports tree"
37 title="The following port(s) is/are required by %s:"
38 list=requirements.$dbsuffix
40 pkgnamedb='moved_from'
43 grandtitle="Dependencies based on the initially installed packages"
44 title="The following port(s) depended on %s:"
45 list=dependents.$dbsuffix
50 grandtitle="Dependencies based on the latest ports tree"
51 title="The following port(s) depend(s) on %s:"
52 list=dependents.$dbsuffix
54 pkgnamedb='moved_from'
57 grandtitle="Possible additional conflict files"
58 title="The following packages' files conflict with %s:"
59 list=possible_additional_conflist.csv
61 pkgnamedb='moved_from'
62 database_query_show_two_column_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
65 grandtitle="Success/failure status in (re)installation"
66 lists='todo|done|redo|resolved|inst_by_pkg|failure|taboo|freeze|need|noneed|deleted|restored|conflict'
67 database_query_show_list_inclusion_of_matching_port "$grandtitle" "$lists" "$pkgnamedb" \
68 "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"
71 grandtitle="Error messages in (re)installation:"
72 title="\n==== %s ===="
75 pkgnamedb='moved_from'
76 database_query_show_log "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
79 case $COMMAND_SHOW_SUBJECT in
80 initrequirements | requirements | initdependents | dependents )
81 [ $COMMAND_SHOW_DEPTAG = none ] && \
82 message_echo "WARNING: This command has no meaning with the current options setting." >&2
83 database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"