OSDN Git Service

[NEW] Commands of show inst_built_default and show inst_built_custom are added.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 26 Aug 2018 08:39:54 +0000 (16:39 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 26 Aug 2018 08:39:54 +0000 (16:39 +0800)
[NEW] show status newly has inst_built_default, inst_built_custom and fossil.

 Changes to be committed:
modified:   lib/libcommand_show.sh
modified:   lib/libdatabase_query.sh
modified:   lib/libdatabase_record.sh
modified:   lib/libmain.sh
modified:   lib/libreinstall.sh
modified:   lib/main/libcommand.sh
modified:   lib/main/libusage.sh
modified:   man/portsreinstall.8

lib/libcommand_show.sh
lib/libdatabase_query.sh
lib/libdatabase_record.sh
lib/libmain.sh
lib/libreinstall.sh
lib/main/libcommand.sh
lib/main/libusage.sh
man/portsreinstall.8

index d14fe77..e1f0435 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 | inst_by_pkg | failure | taboo | freeze | need | noneed | deleted | restored | fossil |conflict )
+       todo | done | redo | resolved | inst_by_pkg | inst_built_default | inst_built_custom | failure | taboo | freeze | need | noneed | deleted | restored | fossil |conflict )
                database_query_show_single_list_exec "$COMMAND_SHOW_SUBJECT" \
                        "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" || :
                ;;
@@ -79,7 +79,7 @@ command_show ()
                ;;
        status )
                grandtitle="Success/failure status in (re)installation"
-               lists='todo|done|redo|resolved|inst_by_pkg|failure|taboo|freeze|need|noneed|deleted|restored|conflict'
+               lists='todo|done|redo|resolved|inst_by_pkg|inst_built_default|inst_built_custom|failure|taboo|freeze|need|noneed|deleted|restored|fossil|conflict'
                database_query_show_list_inclusion_of_matching_port "$grandtitle" "$lists" "$pkgnamedb" \
                        "$COMMAND_SHOW_DEPTAG" "$COMMAND_SHOW_LEVEL" "$@"
                ;;
index 8e22ca4..70f454f 100644 (file)
@@ -633,6 +633,16 @@ database_query_show_single_list_exec ()
                message_echo
                list=installation_complete_by_pkg.list
                ;;
+       inst_built_default )
+               message_echo "The following ports are configured default and installed by ports"
+               message_echo
+               list=inst_by_port_with_default_conf.list
+               ;;
+       inst_built_custom )
+               message_echo "The following ports are configured non-default and installed by ports"
+               message_echo
+               list=inst_by_port_with_custom_conf.list
+               ;;
        failure )
                message_echo "The following ports experienced failures and kept to be old or uninstalled:"
                message_echo
@@ -744,9 +754,18 @@ database_query_exists_in_list ()
        inst_by_pkg )
                list=installation_complete_by_pkg.list
                ;;
+       inst_built_default )
+               list=inst_by_port_with_default_conf.list
+               ;;
+       inst_built_custom )
+               list=inst_by_port_with_custom_conf.list
+               ;;
        failure )
                list=failed.list
                ;;
+       fossil )
+               list=`ls "${DBDIR}"/fossil_pkgs/fossil_since_* | head -n 1`
+               ;;
        conflict )
                grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" 2> /dev/null \
                        | grep -q -E "^${origin_esc}[[:space:]]"
index d38f09c..e3e0d21 100644 (file)
@@ -80,6 +80,9 @@ database_record_failure ()
                done
        done
        rm -f "$nodedir/succeeded_once"
+       fileedit_rm_a_line "$origin" "${DBDIR}/inst_by_port_with_custom_conf.list"
+       fileedit_rm_a_line "$origin" "${DBDIR}/inst_by_port_with_default_conf.list"
+       fileedit_rm_a_line "$origin" "${DBDIR}/installation_complete_by_pkg.list"
        if [ -z "$clean" -o "@$clean" = @clean ]
        then
                message_echo "*** Trying to clean the failed build... (Ignore failures)"
index 8260ebe..dd35ad5 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.1.0
        COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.1.0_20180823234307
+       MYVERSION=4.0.0+toward_4.1.0_20180826163929
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
index cf77fa8..305bfe7 100644 (file)
@@ -127,7 +127,7 @@ reinstall_setup_make_args ()
                        pkgsys_is_dialog4ports_used && echo 'NO_DIALOG=yes'
                fi
                dbdir=$REINSTALL_DBNODE_DIR
-               [ -d "$dbdir" ] || dbdir=${DBDIR}/conf/each_port/$origin
+               [ -d "$dbdir" ] || dbdir=${DBDIR}/conf/each_port/$REINSTALL_ORIGIN
                cat "$dbdir/MARG.conf" 2> /dev/null || :
                flavor=`pkgsys_get_flavor_from_origin "$REINSTALL_ORIGIN"`
                [ -z "$flavor" ] || echo "FLAVOR=$flavor"
@@ -1044,6 +1044,9 @@ reinstall_exec_reinstall_by_pkg ()
                                if [ $opt_fetch_only = no -a "x$PKGSYS_USE_PKGNG" = xyes ] \
                                        && pkgsys_is_necessary_pkgtool "$REINSTALL_ORIGIN"
                                then
+                                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
+                                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+                                       fileedit_rm_a_line "$origin" "${DBDIR}/installation_complete_by_pkg.list"
                                        if reinstall_deinstall && pkg_is_tool_available && pkg_info_e "$pkg"
                                        then
                                                reinstall_register_stage_complete INSTALL_BY_PKG
@@ -1064,6 +1067,9 @@ reinstall_exec_reinstall_by_pkg ()
                                                then
                                                        message_fetch_only
                                                else
+                                                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
+                                                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+                                                       fileedit_rm_a_line "$origin" "${DBDIR}/installation_complete_by_pkg.list"
                                                        reinstall_backup_and_delete_remaining_install_conflicts__by_pkg "$pkg"
                                                        reinstall_pkg_backup || :
                                                        reinstall_register_stage in_add_pkg
@@ -1107,6 +1113,8 @@ reinstall_exec_reinstall_by_pkg ()
                        touch "$REINSTALL_DBNODE_DIR/installed_timestamp"
                        touch "$REINSTALL_DBNODE_DIR/installed_by_pkg"
                        fileedit_add_a_line_if_new "$origin" "${DBDIR}/installation_complete_by_pkg.list"
+                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+                       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
                        reinstall_deregister_stage in_bypkg
                        reinstall_tell_update_to_depandents
                        reinstall_closing_operations_after_successful_install
@@ -1121,6 +1129,8 @@ reinstall_exec_reinstall_by_pkg ()
                fi
        fi
        fileedit_rm_a_line "$origin" "${DBDIR}/installation_complete_by_pkg.list"
+       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
        return 1
 }
 
@@ -1470,6 +1480,9 @@ reinstall_exec_reinstall_install ()
        else
                reinstall_register_stage in_install
        fi
+       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
+       fileedit_rm_a_line "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+       fileedit_rm_a_line "$origin" "${DBDIR}/installation_complete_by_pkg.list"
        reinstall_pkg_backup || :
        if [ -e "$REINSTALL_DBNODE_DIR/BEFOREDEINSTALL.conf" ] && ! reinstall_chk_stage_complete BEFOREDEINSTALL
        then
@@ -1566,6 +1579,12 @@ reinstall_exec_reinstall_install ()
                done
                reinstall_register_stage_complete UPDATE_CONFLICTS
        fi
+       if database_query_is_default_conf "$REINSTALL_ORIGIN" quiet
+       then
+               fileedit_add_a_line_if_new "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_default_conf.list"
+       else
+               fileedit_add_a_line_if_new "$REINSTALL_ORIGIN" "${DBDIR}/inst_by_port_with_custom_conf.list"
+       fi
        if [ -e "$REINSTALL_DBNODE_DIR/AFTERINSTALL.conf" ] && ! reinstall_chk_stage_complete AFTERINSTALL
        then
                message_echo "-- AFTERINSTALL operations (start)"
index ad5b401..f6c210d 100644 (file)
@@ -234,7 +234,7 @@ command_all_parse_args ()
                        shift || :
                fi
                case $COMMAND_SHOW_SUBJECT in
-               todo | done | redo | resolved | inst_by_pkg | failure | taboo | freeze | need | noneed | restored | deleted | fossil | conflict )
+               todo | done | redo | resolved | inst_by_pkg | inst_built_default | inst_built_custom | failure | taboo | freeze | need | noneed | restored | deleted | fossil | conflict )
                        _command_parse_args__chk_no_arg $#
                        ;;
                leaves | obsolete )
index eb5e579..b1dbb7b 100644 (file)
@@ -79,7 +79,8 @@ USAGE: portsreinstall [OPTIONS] [--] [command]
           | packupgrade create | packupgrade crop [path] | packupgrade clean
           | make glob [target] [arguments...]
           | glob globs... | pkg globs... | options
-          | show todo | show done | show resolved | show inst_by_pkg | show failure | show redo
+          | show todo | show done | show resolved | show failure | show redo
+          | show inst_by_pkg | show inst_built_default | show inst_built_custom
           | show taboo | show need | show noneed | show restored | show deleted
           | show fossil | show conflict
           | show build_conflict_pkgs | show inst_conflict_pkgs
index 5cfbf43..af9e791 100644 (file)
@@ -267,10 +267,6 @@ With \fB\-a\fR option, the first and second columns denote the flavored origin a
 Manually reinstalled ports registered by \fBok\fR command.
 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
-\fBinst_by_pkg\fR
-Ports installed by the default packages because their configurations are default.
-With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
-.TP
 \fBfailure\fR
 Failed ports.
 With \fB\-a\fR option, the first, second and third columns denote the flavored origin, initial/new/current package name, failed make target and manually resolved status (yes or no), respectively.
@@ -279,6 +275,18 @@ With \fB\-a\fR option, the first, second and third columns denote the flavored o
 Ports to be reinstalled after success in any of their failed requirements.
 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
 .TP
+\fBinst_by_pkg\fR
+Ports installed by the default packages because their configurations are default.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
+.TP
+\fBinst_built_default\fR
+Ports locally built and installed with the default configurations including their all requirements.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
+.TP
+\fBinst_built_custom\fR
+Ports locally built and installed with the non-default configurations or having any of their requirements non-default.
+With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
+.TP
 \fBtaboo\fR
 Taboo ports registered by \fBtaboo\fR command.
 With \fB\-a\fR option, the first and second columns denote the flavored origin and initial/new/current package name, respectively.
@@ -353,7 +361,7 @@ In other words, if something is outputted, the port Makefile can have some defec
 .TP
 \fBstatus\fR \fIglob1\fR [\fIglob2\fR ...]
 Current success/failure status in (re)installation of matching ports/packages.
-Returned values are null, "todo", "done", "resolved", "inst_by_pkg", "failure", "redo", "taboo", "freeze", "need", "noneed", "restored", "deleted", "fossil", or "conflict",  where null means that they are untouched in the current option configuration or temporary reset due to configuration changes. 
+Returned values are null, "todo", "done", "resolved", "failure", "redo", "inst_by_pkg", "inst_built_default", "inst_built_custom", "taboo", "freeze", "need", "noneed", "restored", "deleted", "fossil", or "conflict",  where null means that they are untouched in the current option configuration or temporary reset due to configuration changes. 
 .TP
        \fBerrormessage\fR \fIglob1\fR [\fIglob2\fR ...]
 Error message in (re)installation of matching ports/packages.
@@ -1143,9 +1151,9 @@ Configuration file of \fBportupgrade\fR(1).
 .PP
 [NEW] \fBauto\fR and \fBdestroy\fR commands are added to \fBportsreinstall\-chroot\fR(8).
 .PP
-[NEW] \fBpkg\fR, \fBmake\fR, \fBshow build_conflict_pkgs\fR, \fBshow inst_conflict_pkgs\fR, \fBshow errormessage\fR, \fBshow inst_by_pkg\fR, \fBshow fossil\fR, \fBshow leaves\fR and \fBshow obsolete\fR commands are added.
+[NEW] \fBpkg\fR, \fBmake\fR, \fBshow build_conflict_pkgs\fR, \fBshow inst_conflict_pkgs\fR, \fBshow errormessage\fR, \fBshow inst_by_pkg\fR, \fBshow inst_built_default\fR, \fBshow inst_built_custom\fR, \fBshow fossil\fR, \fBshow leaves\fR and \fBshow obsolete\fR commands are added.
 .PP
-[NEW] Command \fBshow status\fR newly supports \fBinst_by_pkg\fR.
+[NEW] Command \fBshow status\fR newly supports \fBinst_by_pkg\fR, \fBinst_built_default\fR, \fBinst_built_custom\fR and \fBfossil\fR.
 .PP
 [NEW] BUILDCONFLICT and INSTCONFLICT sections are added to ${LOCALBASE}/etc/portsreinstall.conf.
 .PP