[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
# 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}
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='--'
}
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 \
_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
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 ] \
_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
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
# ============= 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 =============
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
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
-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.
.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
.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)