OSDN Git Service

[IMPROVED] A countermeasure for a build failure in a restarted build from a terminate...
authorUser Alatnmw Alat Nmw <alatnmw@Tariff.EmpireNmw>
Sat, 17 Nov 2012 10:43:23 +0000 (19:43 +0900)
committerUser Alatnmw Alat Nmw <alatnmw@Tariff.EmpireNmw>
Sat, 17 Nov 2012 10:43:23 +0000 (19:43 +0900)
modified:   portsreinstall
modified:   portsreinstall.8
modified:   portsreinstall.8~
modified:   portsreinstall~

portsreinstall
portsreinstall.8
portsreinstall.8~
portsreinstall~

index 36c932c..b63cc37 100755 (executable)
@@ -10,7 +10,7 @@
 # ================================================
 
 APPNAME=`basename "$0"`
-MYVERSION=2.0.0
+MYVERSION=2.0.0+toward_2.0.1_20121117194301
 
 PREFIX=${PREFIX:-/usr/local}
 CONFFILE=${PREFIX}/etc/${APPNAME}.conf
@@ -2276,8 +2276,10 @@ then
                if [ -e "${DBDIR}/requires/$origin/status/in_build" ]
                then
                        echo "(Restarting the previously terminated build process...)"
+                       flag_restarted_build=yes
                else
                        touch "${DBDIR}/requires/$origin/status/in_build"
+                       flag_restarted_build=no
                fi
                if [ -e "${DBDIR}/requires/$origin/BEFOREBUILD.conflist" -a ! -e "${DBDIR}/requires/$origin/status/COMPLETE_BEFOREBUILD" ]
                then
@@ -2365,6 +2367,30 @@ then
                        if env ${MAKE_ENVS} make ${MAKE_ARGS}
                        then
                                :
+                       elif [ $flag_restarted_build = yes ]
+                       then
+                               rm "${DBDIR}/requires/$origin/status/COMPLETE_CLEAN_BEFORE_BUILD"
+                               echo "INFO: This failure may be due to restarting from a terminated build." >&2
+                               echo "WARNING: Retrying build after cleaning for ${PORTSDIR}/$position_msg." >&2
+                               env ${MAKE_ENVS} make clean ${MAKE_ARGS} || \
+                               {
+                                       echo "ERROR: Check the permission of directory ${PORTSDIR}/$position_msg." >&2
+                                       echo 'build and clean after build failure' > ${DBDIR}/requires/$origin/note_failtre
+                                       record_failure $origin noclean
+                                       rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+                                       cmt_fail_reinst "$origin"
+                                       continue
+                               }
+                               if env ${MAKE_ENVS} make ${MAKE_ARGS}
+                               then
+                                       :
+                               else
+                                       echo 'build' > ${DBDIR}/requires/$origin/note_failtre
+                                       record_failure $origin
+                                       rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+                                       cmt_fail_reinst "$origin"
+                                       continue
+                               fi
                        else
                                echo 'build' > ${DBDIR}/requires/$origin/note_failtre
                                record_failure $origin
index 825be14..331a784 100644 (file)
@@ -275,6 +275,9 @@ Configuration file of portupgrade(1).
 .SH HISTORY
 \fBportsreinstall\fR has been developed as below.
 .TP
+2.0.1 (17 November 2012)
+[IMPROVED] A countermeasure for a build failure in a restarted build from a terminated build is implemented.
+.TP
 2.0.0 (12 August 2012)
 [NEW] Options \fB\-X\fR, \fB\-r\fR and \fB\-R\fR are added so as to compensate a fact that \fB\-x\fR, \fB\-t\fR and \fB\-T\fR cannot specify package names with commas.
 
index 5163631..825be14 100644 (file)
@@ -275,7 +275,7 @@ Configuration file of portupgrade(1).
 .SH HISTORY
 \fBportsreinstall\fR has been developed as below.
 .TP
-2.0.0 (11 August 2012)
+2.0.0 (12 August 2012)
 [NEW] Options \fB\-X\fR, \fB\-r\fR and \fB\-R\fR are added so as to compensate a fact that \fB\-x\fR, \fB\-t\fR and \fB\-T\fR cannot specify package names with commas.
 
 [NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
index 8bedbc7..3bb9caf 100755 (executable)
@@ -10,7 +10,7 @@
 # ================================================
 
 APPNAME=`basename "$0"`
-MYVERSION=1.1.0+toward_2.0.0_20120811170759
+MYVERSION=2.0.0+toward_2.0.1_20121117185829
 
 PREFIX=${PREFIX:-/usr/local}
 CONFFILE=${PREFIX}/etc/${APPNAME}.conf
@@ -2276,8 +2276,10 @@ then
                if [ -e "${DBDIR}/requires/$origin/status/in_build" ]
                then
                        echo "(Restarting the previously terminated build process...)"
+                       flag_restarted_build=yes
                else
                        touch "${DBDIR}/requires/$origin/status/in_build"
+                       flag_restarted_build=no
                fi
                if [ -e "${DBDIR}/requires/$origin/BEFOREBUILD.conflist" -a ! -e "${DBDIR}/requires/$origin/status/COMPLETE_BEFOREBUILD" ]
                then
@@ -2365,6 +2367,30 @@ then
                        if env ${MAKE_ENVS} make ${MAKE_ARGS}
                        then
                                :
+                       elif [ $flag_restarted_build = yes ]
+                       then
+                               rm "${DBDIR}/requires/$origin/status/COMPLETE_CLEAN_BEFORE_BUILD"
+                               echo "INFO: This failure may be due to restarting from a terminated build." >&2
+                               echo "WARNING: Retrying build after cleaning for ${PORTSDIR}/$position_msg." >&2
+                               env ${MAKE_ENVS} make clean ${MAKE_ARGS} || \
+                               {
+                                       echo "ERROR: Check the permission of directory ${PORTSDIR}/$position_msg." >&2
+                                       echo 'build and clean after build failure' > ${DBDIR}/requires/$origin/note_failtre
+                                       record_failure $origin noclean
+                                       rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+                                       cmt_fail_reinst "$origin"
+                                       continue
+                               }
+                               if env ${MAKE_ENVS} make ${MAKE_ARGS}
+                               then
+                                       :
+                               else
+                                       echo 'build' > ${DBDIR}/requires/$origin/note_failtre
+                                       record_failure $origin
+                                       rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+                                       cmt_fail_reinst "$origin"
+                                       continue
+                               fi
                        else
                                echo 'build' > ${DBDIR}/requires/$origin/note_failtre
                                record_failure $origin