OSDN Git Service

Commands of show build_conflict_pkgs and show inst_conflict_pkgs are added.
[portsreinstall/current.git] / lib / libcommand_show.sh
index fc78dd7..5f5ce8e 100644 (file)
@@ -17,7 +17,7 @@ command_show ()
        [ -n "$COMMAND_SHOW_LEVEL" ] || COMMAND_SHOW_LEVEL=`options_get_dependency_level`
        dbsuffix=$COMMAND_SHOW_DEPTAG.$COMMAND_SHOW_LEVEL
        case $COMMAND_SHOW_SUBJECT in
-       todo | done | redo | resolved | failure | taboo | freeze | need | noneed | deleted | restored | conflict )
+       todo | done | redo | resolved | inst_by_pkg | failure | taboo | freeze | need | noneed | deleted | restored | conflict )
                database_query_show_single_list_exec "$COMMAND_SHOW_SUBJECT" \
                        "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" || :
                ;;
@@ -25,15 +25,26 @@ command_show ()
                database_query_show_single_list_exec "$COMMAND_SHOW_SUBJECT" \
                        "$COMMAND_SHOW_KEYWORD" '' || :
                ;;
+       build_conflict_pkgs | inst_conflict_pkgs )
+               case $COMMAND_SHOW_SUBJECT in
+               build_conflict_pkgs )
+                       mode=build
+                       ;;
+               inst_conflict_pkgs )
+                       mode=install
+                       ;;
+               esac
+               pkgsys_eval_ports_glob "$@" | while read origin
+               do
+                       pkgsys_get_conflicting_installed_pkgs "$mode" "$origin"
+               done | sort -u
+               ;;
        initrequirements )
                grandtitle="Dependencies based on the initially installed packages"
                title="The following port(s) was/were required by %s:"
                list=requirements.$dbsuffix
                listdb='initial'
                pkgnamedb='initial'
-               [ $COMMAND_SHOW_DEPTAG = none ] && \
-                       message_echo "WARNING: This command has no meaning with the current options setting." >&2
-               database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        requirements )
                grandtitle="Dependencies based on the latest ports tree"
@@ -41,9 +52,6 @@ command_show ()
                list=requirements.$dbsuffix
                listdb='requires'
                pkgnamedb='moved_from'
-               [ $COMMAND_SHOW_DEPTAG = none ] && \
-                       message_echo "WARNING: This command has no meaning with the current options setting." >&2
-               database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        initdependents )
                grandtitle="Dependencies based on the initially installed packages"
@@ -51,9 +59,6 @@ command_show ()
                list=dependents.$dbsuffix
                listdb='initial'
                pkgnamedb='initial'
-               [ $COMMAND_SHOW_DEPTAG = none ] && \
-                       message_echo "WARNING: This command has no meaning with the current options setting." >&2
-               database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        dependents )
                grandtitle="Dependencies based on the latest ports tree"
@@ -61,21 +66,18 @@ command_show ()
                list=dependents.$dbsuffix
                listdb='requires'
                pkgnamedb='moved_from'
-               [ $COMMAND_SHOW_DEPTAG = none ] && \
-                       message_echo "WARNING: This command has no meaning with the current options setting." >&2
-               database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        conflict_files )
                grandtitle="Possible additional conflict files"
                title="The following packages' files conflict with %s:"
-               list=possible_additional_conflist.csv
+               list=possible_additional_conflict.csv
                listdb='requires'
                pkgnamedb='moved_from'
                database_query_show_two_column_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        status )
                grandtitle="Success/failure status in (re)installation"
-               lists='todo|done|redo|resolved|failure|taboo|freeze|need|noneed|deleted|restored|conflict'
+               lists='todo|done|redo|resolved|inst_by_pkg|failure|taboo|freeze|need|noneed|deleted|restored|conflict'
                database_query_show_list_inclusion_of_matching_port "$grandtitle" "$lists" "$pkgnamedb" \
                        "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"
                ;;
@@ -88,4 +90,11 @@ command_show ()
                database_query_show_log "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$@"
                ;;
        esac
+       case $COMMAND_SHOW_SUBJECT in
+       initrequirements | requirements | initdependents | dependents )
+               [ $COMMAND_SHOW_DEPTAG = none ] && \
+                       message_echo "WARNING: This command has no meaning with the current options setting." >&2
+               database_query_show_port_lists "$grandtitle" "$title" "$list" "$listdb" "$pkgnamedb" "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"
+               ;;
+       esac
 }