OSDN Git Service

Some bugs related to chk_if_target for obsolete ports are fixed.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sat, 4 Aug 2012 13:43:15 +0000 (22:43 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sat, 4 Aug 2012 13:43:15 +0000 (22:43 +0900)
The history section of the manual page is slightly revised.

modified:   portsreinstall
modified:   portsreinstall.8
modified:   portsreinstall.8~
modified:   portsreinstall~

portsreinstall
portsreinstall.8
portsreinstall.8~
portsreinstall~

index b427ed0..c43902c 100755 (executable)
@@ -10,7 +10,7 @@
 # ================================================
 
 APPNAME=`basename $0`
-MYVERSION=1.1.0+toward_1.2.0_20120801065617
+MYVERSION=1.1.0+toward_1.2.0_20120804223535
 
 PREFIX=${PREFIX:-/usr/local}
 CONFFILE=${PREFIX}/etc/${APPNAME}.conf
@@ -856,9 +856,9 @@ chk_if_target ()
        local prefix _is_all _is_target _is_required _is_former_required _is_dependent _is_former_dependent _is_relevant
        prefix=$1
        origin=$2
-       if [ -e "${DBDIR}/requires/$origin/chk_if_target.param" ]
+       if [ -e "${DBDIR}/all/$origin/chk_if_target.param" ]
        then
-               . "${DBDIR}/requires/$origin/chk_if_target.param"
+               . "${DBDIR}/all/$origin/chk_if_target.param"
        else
                _is_all=y
                _is_target=
@@ -903,7 +903,8 @@ chk_if_target ()
                echo _is_dependent=${_is_dependent} >> ${TMPDIR}/chk_if_target:results
                echo _is_former_dependent=${_is_former_dependent} >> ${TMPDIR}/chk_if_target:results
                echo _is_relevant=${_is_relevant} >> ${TMPDIR}/chk_if_target:results
-               mv "${TMPDIR}"/chk_if_target:results "${DBDIR}/requires/$origin/chk_if_target.param"
+               [ -d "${DBDIR}/all/$origin" ] || mkdir -p "${DBDIR}/all/$origin"
+               mv "${TMPDIR}"/chk_if_target:results "${DBDIR}/all/$origin/chk_if_target.param"
        fi
        eval ${prefix}_is_all=\$\{_is_all\}
        eval ${prefix}_is_target=\$\{_is_target\}
@@ -1318,21 +1319,21 @@ end
 i = 0
 beforebuild.each do |target, command|
         printf("BEFOREBUILD_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("BEFOREBUILD_COMMAND_%d_='%s'\n", i, command)
+        printf("BEFOREBUILD_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 
 i = 0
 beforedeinstall.each do |target, command|
         printf("BEFOREDEINSTALL_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("BEFOREDEINSTALL_COMMAND_%d_='%s'\n", i, command)
+        printf("BEFOREDEINSTALL_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 
 i = 0
 afterinstall.each do |target, command|
         printf("AFTERINSTALL_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("AFTERINSTALL_COMMAND_%d_='%s'\n", i, command)
+        printf("AFTERINSTALL_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 eof
@@ -1671,6 +1672,26 @@ then
        echo
 fi
 
+# Preparation of matching patterns of obsolete ports to be deleted
+if [ ! -e "${DBDIR}/COMPLETE_PREPARATION_OF_MATCHING_PATTERNS_OF_OBSOLETE_PORTS" ]
+then
+       echo "Starting preparation of matching patterns of obsolete ports to be deleted at `timestamp`"
+       if [ -f "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain" ]
+       then
+               echo "INFO: Restarting from the previously terminated point"
+       else
+               cp -p "${DBDIR}/moved_or_lost.list" "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain"
+       fi
+       cp "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain" "${DBDIR}/prepare_matching_patterns_obsolete_ports"
+       while read origin
+       do
+               chk_if_target currentorigin "$origin"
+               sed -i '' 1d "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain"
+       done < ${DBDIR}/prepare_matching_patterns_obsolete_ports
+       touch "${DBDIR}/COMPLETE_PREPARATION_OF_MATCHING_PATTERNS_OF_OBSOLETE_PORTS"
+       echo
+fi
+
 # Inspection of necessary updates
 if [ ! -e "${DBDIR}/COMPLETE_NECESSARY_UPDATES" ]
 then
index 169b5e8..302b403 100644 (file)
@@ -263,29 +263,31 @@ Configuration file of portupgrade(1).
 .SH HISTORY
 \fBportsreinstall\fR has been developed as below.
 .TP
-1.2.0 (1 August 2012)
-[BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
+1.2.0 (4 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.
 
-[CHANGE] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
+[NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
 
-[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.
+[CHANGED] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
 
-[CHANGE] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
+[CHANGED] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
 
-[CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled.
+[CHANGED] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled.
 
-[NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
+[BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
+
+[BUG FIX] Values of BEFOREBUILD, BEFOREDEINSTALL and AFTERINSTALL were not correctly imported from pkgtools.conf(5).
 .TP
 1.1.0 (28 April 2012)
 [NEW] Command of show deleted is newly added.
 
-[CHANGE] Origin names in messages and results of show command are changed to be accompanied with package names.
+[CHANGED] Origin names in messages and results of show command are changed to be accompanied with package names.
 
-[CHANGE] The default option for treating pkgtools.conf(5) is changed to \fB\-p\fR and \fB\-Q\fR is newly added.
+[CHANGED] The default option for treating pkgtools.conf(5) is changed to \fB\-p\fR and \fB\-Q\fR is newly added.
 
-[IMPROVE] Custom make environment variables and arguments are changed to be reflected in the phase of inspection of dependencies.
+[IMPROVED] Custom make environment variables and arguments are changed to be reflected in the phase of inspection of dependencies.
 
-[IMPROVE] Command of show todo is now available before starting reinstallation.
+[IMPROVED] Command of show todo is now available before starting reinstallation.
 
 [BUG FIX] Independence from ports\-mgmt/portupgrade* was incomplete.
 
@@ -319,22 +321,22 @@ Configuration file of portupgrade(1).
 
 [BUG FIX] Origin names with '+' were not correctly treated.
 
-[IMPROVE] Inspection of dependencies of installed packages gets faster.
+[IMPROVED] Inspection of dependencies of installed packages gets faster.
 .TP
 0.13.0 (28 August 2011)
-[IMPROVE] Phase of "Order the ports considering dependencies" is accelerated.
+[IMPROVED] Phase of "Order the ports considering dependencies" is accelerated.
 .TP
 0.12.0 (22 June 2011)
 [NEW] \fB\-q\fR, \fB\-d\fR and \fB\-N\fR options are added.
 
-[CHANGE] Settings for \fB\-x\fR and \fB\-s\fR options becomes to be transferred to restarted runs.
+[CHANGED] Settings for \fB\-x\fR and \fB\-s\fR options becomes to be transferred to restarted runs.
 .TP
 0.11.0 (17 May 2011)
 [NEW] Causes of errors are added to the report of failed ports.
 
-[CHANGE] Functionality of \fB\-t\fR option is changed and partly splitted into \fB\-T\fR.
+[CHANGED] Functionality of \fB\-t\fR option is changed and partly splitted into \fB\-T\fR.
 
-[IMPROVE] Refetch after fetch failure becomes smarter so as not to clean up distfiles.
+[IMPROVED] Refetch after fetch failure becomes smarter so as not to clean up distfiles.
 
 [MISC] Terminology 'abort' is corrected to be 'terminate'.
 .TP
index c5b6361..a145570 100644 (file)
@@ -263,18 +263,20 @@ Configuration file of portupgrade(1).
 .SH HISTORY
 \fBportsreinstall\fR has been developed as below.
 .TP
-1.2.0 (31 July 2012)
-[BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
+1.2.0 (4 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.
 
-[CHANGE] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
+[NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
 
-[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.
+[CHANGE] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
 
 [CHANGE] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
 
 [CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled.
 
-[NEW] Commands of \fBshow requirements\fR and  \fBshow dependents\fR are added.
+[BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
+
+[BUG FIX] Values of BEFOREBUILD, BEFOREDEINSTALL and AFTERINSTALL were not correctly imported from pkgtools.conf(5).
 .TP
 1.1.0 (28 April 2012)
 [NEW] Command of show deleted is newly added.
index 846058c..53dba8a 100755 (executable)
@@ -10,7 +10,7 @@
 # ================================================
 
 APPNAME=`basename $0`
-MYVERSION=1.1.0+toward_1.2.0_20120801061104
+MYVERSION=1.1.0+toward_1.2.0_20120801065617
 
 PREFIX=${PREFIX:-/usr/local}
 CONFFILE=${PREFIX}/etc/${APPNAME}.conf
@@ -856,9 +856,9 @@ chk_if_target ()
        local prefix _is_all _is_target _is_required _is_former_required _is_dependent _is_former_dependent _is_relevant
        prefix=$1
        origin=$2
-       if [ -e "${DBDIR}/requires/$origin/chk_if_target.param" ]
+       if [ -e "${DBDIR}/all/$origin/chk_if_target.param" ]
        then
-               . "${DBDIR}/requires/$origin/chk_if_target.param"
+               . "${DBDIR}/all/$origin/chk_if_target.param"
        else
                _is_all=y
                _is_target=
@@ -903,7 +903,8 @@ chk_if_target ()
                echo _is_dependent=${_is_dependent} >> ${TMPDIR}/chk_if_target:results
                echo _is_former_dependent=${_is_former_dependent} >> ${TMPDIR}/chk_if_target:results
                echo _is_relevant=${_is_relevant} >> ${TMPDIR}/chk_if_target:results
-               mv "${TMPDIR}"/chk_if_target:results "${DBDIR}/requires/$origin/chk_if_target.param"
+               [ -d "${DBDIR}/all/$origin" ] || mkdir -p "${DBDIR}/all/$origin"
+               mv "${TMPDIR}"/chk_if_target:results "${DBDIR}/all/$origin/chk_if_target.param"
        fi
        eval ${prefix}_is_all=\$\{_is_all\}
        eval ${prefix}_is_target=\$\{_is_target\}
@@ -1318,21 +1319,21 @@ end
 i = 0
 beforebuild.each do |target, command|
         printf("BEFOREBUILD_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("BEFOREBUILD_COMMAND_%d_='%s'\n", i, command)
+        printf("BEFOREBUILD_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 
 i = 0
 beforedeinstall.each do |target, command|
         printf("BEFOREDEINSTALL_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("BEFOREDEINSTALL_COMMAND_%d_='%s'\n", i, command)
+        printf("BEFOREDEINSTALL_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 
 i = 0
 afterinstall.each do |target, command|
         printf("AFTERINSTALL_TARGET_pkgtoolsconf_%d_='%s'\n", i, target)
-        printf("AFTERINSTALL_COMMAND_%d_='%s'\n", i, command)
+        printf("AFTERINSTALL_COMMAND_pkgtoolsconf_%d_='%s'\n", i, command)
         i = i + 1
 end
 eof
@@ -1671,6 +1672,26 @@ then
        echo
 fi
 
+# Preparation of matching patterns of obsolete ports to be deleted
+if [ ! -e "${DBDIR}/COMPLETE_PREPARATION_OF_MATCHING_PATTERNS_OF_OBSOLETE_PORTS" ]
+then
+       echo "Starting preparation of matching patterns of obsolete ports to be deleted at `timestamp`"
+       if [ -f "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain" ]
+       then
+               echo "INFO: Restarting from the previously terminated point"
+       else
+               cp -p "${DBDIR}/moved_or_lost.list" "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain"
+       fi
+       cp "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain" "${DBDIR}/prepare_matching_patterns_obsolete_ports"
+       while read origin
+       do
+               chk_if_target currentorigin "$origin"
+               sed -i '' 1d "${DBDIR}/prepare_matching_patterns_obsolete_ports.remain"
+       done < ${DBDIR}/prepare_matching_patterns_obsolete_ports
+       touch "${DBDIR}/COMPLETE_PREPARATION_OF_MATCHING_PATTERNS_OF_OBSOLETE_PORTS"
+       echo
+fi
+
 # Inspection of necessary updates
 if [ ! -e "${DBDIR}/COMPLETE_NECESSARY_UPDATES" ]
 then