OSDN Git Service

Version 3.1.1+toward_3.2.0_20141228231007
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 28 Dec 2014 14:10:26 +0000 (23:10 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Sun, 28 Dec 2014 14:10:26 +0000 (23:10 +0900)
[IMPROVED] Support for cases that ports-mgmt/pkg-devel or ports-mgmt/dialog4ports-static is used are implemented.

modified:   bin/portsreinstall
modified:   lib/libpkgsys.sh
modified:   lib/libusage.sh
modified:   man/portsreinstall.8

bin/portsreinstall
lib/libpkgsys.sh
lib/libusage.sh
man/portsreinstall.8

index b1795ef..19add3e 100755 (executable)
@@ -15,7 +15,7 @@ APPNAME=`basename "$0"`
 # MYVERSION=3.2.0
 # COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+)$'
 # Template for development versions
-MYVERSION=3.1.1+toward_3.2.0_20141228193746
+MYVERSION=3.1.1+toward_3.2.0_20141228231007
 COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+\+toward_3\.[1-2]\.[0-9]+_[0-9]+|3\.[1-2]\.[0-9]+)$'
 MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
 MYPREFIX=${MYPREFIX:-/usr/local}
@@ -338,8 +338,8 @@ _program_exec_and_record_completion__operation ()
        local DEPTH_INDEX
        message_section_title "Preliminary inspection of tools which have to be up-to-date"
        {
-               [ "$PKGSYS_USE_PKGNG" = yes ] && echo 'ports-mgmt/pkg'
-               pkgsys_is_dialog4ports_used && echo 'ports-mgmt/dialog4ports'
+               [ "$PKGSYS_USE_PKGNG" = yes ] && pkgsys_portsmgmt_pkg
+               pkgsys_is_dialog4ports_used && pkgsys_portsmgmt_dialog4ports
                [ -n "$MYPORTORIGIN" ] && echo "$MYPORTORIGIN"
        } 2> /dev/null > ${DBDIR}/stage.loop_list/tools_to_inspect
        DEPTH_INDEX='--'
@@ -349,7 +349,7 @@ _program_exec_and_record_completion__operation ()
 }
 program_exec_and_record_completion PRELIMINARY_INSPECTION_OF_TOOLS
 
-# Upgrade of ports-mgmt/pkg if new
+# Upgrade of pkg(8) if new
 # (No need depend on PARSE_CONF because REINSTALLATION will take the task.)
 if [ \( "$COMMAND_MODE" = do -o "$COMMAND_MODE" = redo \) \
        -a $opt_dry_run = no -a $opt_suppress_pkgtools_upadte = no \
@@ -359,11 +359,11 @@ then
        _program_exec_and_record_completion__operation ()
        {
                local _MSG_CURRENT_STAGE_general
-               _MSG_CURRENT_STAGE_general="pkgng upgrade"
+               _MSG_CURRENT_STAGE_general="pkg(8) upgrade"
                temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
-               message_section_title "Upgrade of ports-mgmt/pkg if new"
+               message_section_title "Upgrade of `pkgsys_portsmgmt_pkg` if new"
                touch "${DBDIR}/target_all"
-               reinstall_exec ports-mgmt/pkg
+               reinstall_exec `pkgsys_portsmgmt_pkg`
                reinstall_restore_conflicts
                rm -f "${DBDIR}/target_all"
                temp_set_msg_current_stage
@@ -372,7 +372,7 @@ then
        program_exec_and_record_completion UPGRADE_PKGNG
 fi
 
-# Upgrade of ports-mgmt/dialog4ports if new
+# Upgrade of dialog4ports(1) if new
 # (No need depend on PARSE_CONF because REINSTALLATION will take the task.)
 if [ \( "$COMMAND_MODE" = do -o "$COMMAND_MODE" = redo \) \
        -a $opt_dry_run = no -a $opt_suppress_pkgtools_upadte = no ] \
@@ -382,11 +382,11 @@ then
        _program_exec_and_record_completion__operation ()
        {
                local _MSG_CURRENT_STAGE_general
-               _MSG_CURRENT_STAGE_general="pkgng dialog4ports"
+               _MSG_CURRENT_STAGE_general="dialog4ports(1) upgrade"
                temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
-               message_section_title "Upgrade of dialog4ports if new"
+               message_section_title "Upgrade of `pkgsys_portsmgmt_dialog4ports` if new"
                touch "${DBDIR}/target_all"
-               reinstall_exec ports-mgmt/dialog4ports
+               reinstall_exec `pkgsys_portsmgmt_dialog4ports`
                reinstall_restore_conflicts
                rm -f "${DBDIR}/target_all"
                temp_set_msg_current_stage
index 773c43a..f2bf8ec 100644 (file)
@@ -48,11 +48,38 @@ pkgsys_pkgchksum_file ()
        echo CHECKSUM.MD5
 }
 
+# ============= Get the origin of the currently used pkg(8) =============
+pkgsys_portsmgmt_pkg ()
+{
+       local origin
+       if [ ! -e "${DBDIR}/PKG_ORIGIN" ]
+       then
+               origin=`pkgsys_sysvar PKG_ORIGIN` || :
+               [ -n "$origin" -a -d "${PORTSDIR}/$origin" ] || origin=ports-mgmt/pkg
+               echo "$origin" > ${DBDIR}/PKG_ORIGIN
+       fi
+       cat "${DBDIR}/PKG_ORIGIN"
+}
+
+# ============= Get the origin of the currently used dialog4ports(1) =============
+pkgsys_portsmgmt_dialog4ports ()
+{
+       echo "$origin"
+       local origin
+       if [ ! -e "${DBDIR}/DIALOGPORT" ]
+       then
+               origin=`pkgsys_sysvar DIALOGPORT` || :
+               [ -n "$origin" -a -d "${PORTSDIR}/$origin" ] || origin=ports-mgmt/dialog4ports
+               echo "$origin" > ${DBDIR}/DIALOGPORT
+       fi
+       cat "${DBDIR}/DIALOGPORT"
+}
+
 # ============= Check whether a port is indispensable for the standard function of the ports/packages system =============
 pkgsys_is_pkgtool ()
 {
        case $1 in
-       ports-mgmt/pkg|ports-mgmt/dialog4ports)
+       ports-mgmt/pkg|ports-mgmt/pkg-devel|ports-mgmt/dialog4ports|ports-mgmt/dialog4ports-static)
                ;;
        *)      return 1;;
        esac
@@ -61,7 +88,7 @@ pkgsys_is_pkgtool ()
 # ============= Check whether a port is indispensable for package operations =============
 pkgsys_is_necessary_pkgtool ()
 {
-       [ x"$WITH_PKGNG" = x'yes' -a "x$1" = x'ports-mgmt/pkg' ]
+       [ x"$WITH_PKGNG" = x'yes' -a \( x"$1" = x'ports-mgmt/pkg' -o x"$1" = x'ports-mgmt/pkg-devel' \) ]
 }
 
 # ============= Check whether the dialog for selecting port options is dialog4ports =============
@@ -511,7 +538,7 @@ pkgsys_def_pkgtools ()
                pkg_rescue_tools ()
                {
                        local packagepath checksumpath pkgname is_successful
-                       packagepath=`pkgsys_get_backup_pkg ports-mgmt/pkg` && \
+                       packagepath=`pkgsys_get_backup_pkg \`pkgsys_portsmgmt_pkg\`` && \
                                pkg_add_tools "$packagepath" && return
                        pkg_is_tool_available && return
                        message_echo "WARNING: WITH_PKGNG is set, but pkgng is still missing. It is installed now." >&2
@@ -528,10 +555,10 @@ pkgsys_def_pkgtools ()
                                unset WITH_PKGNG
                                unset WITHOUT_PKGNG
                                
-                               message_echo "INFO: Attempting deinstallation of ports-mgmt/pkg to make sure."
-                               env __MAKE_CONF="${TMPDIR}/make.conf" make -C "${PORTSDIR}/ports-mgmt/pkg" deinstall || :
-                               message_echo "INFO: Attempting (re)installation by ports-mgmt/pkg."
-                               env __MAKE_CONF="${TMPDIR}/make.conf" make -C "${PORTSDIR}/ports-mgmt/pkg" reinstall clean
+                               message_echo "INFO: Attempting deinstallation of pkg(8) to make sure."
+                               env __MAKE_CONF="${TMPDIR}/make.conf" make -C "${PORTSDIR}/`pkgsys_portsmgmt_pkg`" deinstall || :
+                               message_echo "INFO: Attempting (re)installation by pkg(8)."
+                               env __MAKE_CONF="${TMPDIR}/make.conf" make -C "${PORTSDIR}/`pkgsys_portsmgmt_pkg`" reinstall clean
                        ) && {
                                pkg2ng || :
                                pkg_is_tool_available
index c47fc9e..e1fb38e 100644 (file)
@@ -33,7 +33,7 @@ USAGE: ${APPNAME} [OPTIONS] [--] [command]
  -D : Suppress entire inspection of distinfo in the ports tree.
  -d : Do not clean up obsolete or unused distfiles.
  -G : Use prebuilt packages for ports with the default configurations.
- -g : Keep ports-mgmt/pkg untouched.
+ -g : Keep pkg(8) and dialog4ports(1) untouched.
  -I : Only interactive ports are (re)installed.
  -k : Keep ${APPNAME} itself untouched.
  -l : Use legacy packages when prebuilt pkgng packages are missing.
index 9aa73e1..d4c890f 100644 (file)
@@ -392,7 +392,7 @@ This problem can be resolved by configuring NOPKG_* section in ${LOCALBASE}/etc/
 .TP
 \fB\-\-suppress\-pkgtools\-upadte\fR
 Keep indispensable packages for the standard function of the ports/packages system untouched.
-Concretely, this option suppresses upgrade, de/re-installation of the currently installed ports-mgmt/pkg and ports-mgmt/dialog4ports.
+Concretely, this option suppresses upgrade, de/re-installation of the currently installed ports-mgmt/pkg(\-devel) and ports-mgmt/dialog4ports(\-static).
 .PD
 .IP \fB\-I\fR
 .PD 0
@@ -935,7 +935,9 @@ Configuration file of \fBportupgrade\fR(1).
 .RS
 [IMPROVED] The automatic resolution of installation conflict is improved to avoid stripping due to restore\-and\-delete of backup packages that possibly occurs when the default version changes.
 .PP
-[BUG FIX] Reinstallation of ports\-mgmt/pkg could encounter error termination.
+[IMPROVED] Support for cases that ports-mgmt/pkg-devel or ports-mgmt/dialog4ports-static is used are implemented.
+.PP
+[BUG FIX] Reinstallation of pkg(8) could encounter error termination.
 .RE
 .TP
 3.1.1 (17 December 2014)