OSDN Git Service

Version 3.0.5+toward_3.0.6_20140531202509
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sat, 31 May 2014 11:25:36 +0000 (20:25 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sat, 31 May 2014 11:25:36 +0000 (20:25 +0900)
[BUG FIX] Some message output failed with a warning "3: Bad file descriptor" in some environment (detected in 10.0-RELEASE).

modified:   bin/portsreinstall
modified:   lib/libcommand.sh
modified:   lib/libdatabase_query.sh
modified:   lib/libmessage.sh
modified:   man/portsreinstall.8

bin/portsreinstall
lib/libcommand.sh
lib/libdatabase_query.sh
lib/libmessage.sh
man/portsreinstall.8

index 59fc5fc..7185855 100755 (executable)
@@ -15,7 +15,7 @@ APPNAME=`basename "$0"`
 # MYVERSION=3.0.6
 # COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+)$'
 # Template for development versions
-MYVERSION=3.0.5+toward_3.0.6_20140531053505
+MYVERSION=3.0.5+toward_3.0.6_20140531202509
 COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.0\.[0-9]+)$'
 MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
 MYPREFIX=${MYPREFIX:-/usr/local}
@@ -142,12 +142,16 @@ temp_terminate_process_common ()
 
 temp_terminate_process ()
 {
+       local tmp_msg
+       tmp_msg=${TMPDIR}/temp_terminate_process:msg
        [ $errno -eq 0 -o $opt_batch_mode = yes ] && return
        temp_terminate_process_common
-       [ -n "$COMMAND_RESTART" ] || message_cat 3<< eof
+       [ -n "$COMMAND_RESTART" ] && return
+       cat > $tmp_msg << eof
  Instead, if you only want to construct the temporary database so as to stop before the actual reinstallation, execute as:
   ${APPNAME} prepare
 eof
+       message_cat "$tmp_msg"
 }
 
 # ============= Opening title =============
index 3f0c5b8..a2c7999 100644 (file)
@@ -728,6 +728,7 @@ command_exec_irrespective_of_saved_options ()
                tmp_pkgs=${TMPDIR}/command_exec_irrespective_of_saved_options:pkgs
                tmp_orgs=${TMPDIR}/command_exec_irrespective_of_saved_options:orgs
                tmp_pkgs_for_an_org=${TMPDIR}/command_exec_irrespective_of_saved_options:pkgs_for_an_org
+               tmp_pkgs_for_an_org_msg=${TMPDIR}/command_exec_irrespective_of_saved_options:pkgs_for_an_org_msg
                _command_exec_irrespective_of_saved_options__notify_ignored_options
                if [ $# -eq 0 ]
                then
@@ -757,7 +758,8 @@ command_exec_irrespective_of_saved_options ()
                        message_echo "Port [$origin] has multiply registered packages."
                        message_echo "The valid one will be [$pkg_valid]."
                        message_echo "Invalid one(s) will be as follows and to be deleted:"
-                       sed 1d "$tmp_pkgs_for_an_org" | cut -d ' ' -f 2 | message_cat <&3
+                       sed 1d "$tmp_pkgs_for_an_org" | cut -d ' ' -f 2 > $tmp_pkgs_for_an_org_msg
+                       message_cat "$tmp_pkgs_for_an_org_msg"
                        errout=/dev/stderr
                        [ "x$opt_batch_mode" = xyes ] && errout=/dev/null
                        if backup_pkg=`pkgsys_create_backup_pkg "$pkg_valid" "${DBDIR}/backup_packages"`
@@ -988,16 +990,19 @@ command_exec_before_building_tempdb ()
 # ============= Execute command operations which must be done before actual (re/de)installation processes =============
 command_exec_before_actual_re_de_installation ()
 {
+       local tmp_msg
        case $COMMAND_MODE in
        do|redo)
                case $COMMAND_DO_MODE in
                prepare)
-                       message_cat 3<< eof
+                       tmp_msg=${TMPDIR}/command_exec_before_actual_re_de_installation:msg
+                       cat > "$tmp_msg" << eof
 Done (skipped reinstallation) at `message_timestamp`
 
  You can restart this process from the aborted/terminated point by executing without options or arguments as:
   ${APPNAME}
 eof
+                       message_cat "$tmp_msg"
                        temp_terminate_process ()
                        {
                        }
index d221096..12597c3 100644 (file)
@@ -205,7 +205,7 @@ database_query_get_makevar_val ()
 # ============= Check whether configurations for a port is default =============
 database_query_is_default_conf ()
 {
-       local origin mode dbpath tmp_msg is_customized is_requiremnt_replaced files origin_regexp tmp_old tmp_new origin_requirement
+       local origin mode dbpath tmp_msg is_customized is_requiremnt_replaced files origin_regexp tmp_old tmp_new origin_requirement tmp_msg_customized
        origin=$1
        mode=$2
        dbpath=${DBDIR}/requires/$origin
@@ -257,8 +257,10 @@ database_query_is_default_conf ()
        [ `wc -c < $dbpath/is_customized` -eq 0 ] && return
        if [ "x$mode" != xquiet ]
        then
+               tmp_msg_customized=${TMPDIR}/database_query_is_default_conf:msg_customized
                message_echo "INFO: This port is configured to be non-default because of"
-               sed 's/^/         /' "$dbpath/is_customized" | message_cat <&3
+               sed 's/^/         /' "$dbpath/is_customized" > $tmp_msg_customized
+               message_cat "$tmp_msg_customized"
                message_echo "      so the prebuilt package is not used."
        fi
        return 1
index 1bf2f15..34f3d03 100644 (file)
@@ -63,18 +63,13 @@ message_echo ()
 }
 
 # ============= Output a message from stdin except for the batch mode =============
-# Input must be given via descriptor 3 if no file is given as the argument.
+# Use via pipe or redirection without argument is discouraged because it violates the screen size detection.
 message_cat ()
 {
        local ncolumns
        [ "x$opt_batch_mode" = xyes ] && return
        ncolumns=`misc_get_console_column_size`
-       if [ $# -eq 0 ]
-       then
-               fold -s -w $ncolumns <&3
-       else
-               fold -s -w $ncolumns "$@"
-       fi
+       fold -s -w $ncolumns "$@"
 }
 
 # ============= Output a credit =============
index 2afac27..346bb4e 100644 (file)
@@ -919,6 +919,8 @@ Configuration file of \fBportupgrade\fR(1).
 [BUG FIX] It silently failed to launch if the ports tree is missing or broken.
 .PP
 [BUG FIX] The short help lacked descriptions on \fBneed\fR command.
+.PP
+[BUG FIX] Some message output failed with a warning "3: Bad file descriptor" in some environment (detected in 10.0-RELEASE).
 .RE
 .TP
 3.0.5 (14 December 2013)