OSDN Git Service

[BUG FIX] Error messages from failed detection of option configuration were not output.
[portsreinstall/current.git] / lib / libdatabase_build.sh
index a56c60c..0b83431 100644 (file)
@@ -459,7 +459,7 @@ database_build_is_currentpkg_latest ()
 # ============= Recursively inspect dependencies of a port and build a node database of the information =============
 database_build_inspect_dependencies ()
 {
-       local origin_orig origin_dependent origin_orig_regexp origin origin_regexp tag stage dbpath origin_id origin_dependency DEPTH_INDEX_orig nlines iline dist_subdir_rpl inspected_level inspected_levels_compatible origin_tmp inspected_level_tmp conf_updated
+       local origin_orig origin_dependent origin_orig_regexp origin origin_regexp tag stage dbpath origin_id origin_dependency DEPTH_INDEX_orig nlines iline dist_subdir_rpl inspected_level inspected_levels_compatible origin_tmp inspected_level_tmp conf_updated tmp_portsdb_work tmp_portopt
        origin_orig=$1
        origin_dependent=$2
        [ -z "$origin_orig" ] && return
@@ -503,11 +503,19 @@ database_build_inspect_dependencies ()
                                cp -R "${DBDIR}/conf/each_port/$origin/"* "$dbpath/" > /dev/null 2>&1 || :
                        fi
                        tmp_portsdb_work=${TMPDIR}/database_build_inspect_dependencies:portsdb_work
+                       tmp_portopt=${TMPDIR}/database_build_inspect_dependencies:portopt
                        [ -d "$tmp_portsdb_work" ] || mkdir "$tmp_portsdb_work"
                        ( set -e
                                export PORT_DBDIR=$tmp_portsdb_work
                                export __MAKE_CONF=
-                               database_build_make "$origin" showconfig > $dbpath/ports_options.default
+                               if database_build_make "$origin" showconfig > $tmp_portopt
+                               then
+                                       cp "$tmp_portopt" "$dbpath"/ports_options.default
+                               else
+                                       cat "$tmp_portopt" >&2
+                                       message_echo 'Error in detecting the default options.' 2>&1
+                                       exit 1
+                               fi
                        )
                        if [ `wc -c < $dbpath/ports_options.default` -gt 0 ]
                        then
@@ -520,7 +528,14 @@ database_build_inspect_dependencies ()
                                else
                                        database_build_make "$origin" config-conditional
                                fi
-                               database_build_make "$origin" showconfig > $dbpath/ports_options.current
+                               if database_build_make "$origin" showconfig > $tmp_portopt
+                               then
+                                       cp "$tmp_portopt" "$dbpath"/ports_options.current
+                               else
+                                       cat "$tmp_portopt" >&2
+                                       message_echo 'Error in detecting the current options.' 2>&1
+                                       exit 1
+                               fi
                        else
                                cp /dev/null "$dbpath/ports_options.current"
                        fi