[BUG FIX] Restarted runs failed if paths set to option values or their parent paths are symbolic links.
[BUG FIX] The mount command of portsreinstall-chroot(8) failed to detect mounted and unmounted file systems on mount points under symbolic links.
[BUG FIX] Command reselect ended up with "missing argument" error.
+[BUG FIX] Packages of the same origin with different flavors were not processed correctly.
4.1.0 (22 September 2018)
[NEW] Options -j and -x are added.
[NEW] Option -J is added to the all utilities.
[BUG FIX] Failure in unmounting of file systems by portsreinstall-chroot(8) left the privilege lock.
[BUG FIX] Conflict was not correctly escaped in package installation.
[BUG FIX] Evaluation of globs was incorrect for the regular expression form.
-[BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of default packages for flavord ports with the default configuration.
+[BUG FIX] Flavored requirements were incorrectly inspected. This also caused disability of the use of default packages for flavored ports with the default configuration.
[BUG FIX] The message about the evaluated dependency level in show command was wrong.
[BUG FIX] Unselected leaf ports were skipped in (re)installtion.
[BUG FIX] Some upgrading operations by portsreinstall-upgrade(8) were imperfect.
{
local tmp_ls
program_chk_stage_complete INSPECT_DEPENDENTS || return
- pkgsys_exists_saved_port_oprions_timestamps || return
+ pkgsys_exists_saved_port_options_timestamps || return
message_section_title "Inspecting changes of port options"
tmp_ls=${TMPDIR}/command_do_reset_changed_portdb
rm -f "$tmp_ls.updated"
then
message_echo "WARNING: ${PORT_DBDIR} is missing. All port options are recognized as default."
fi
- pkgsys_get_saved_port_oprions_timestamps_all > $tmp_ls.db
- pkgsys_get_current_port_oprions_timestamp > $tmp_ls.log
- pkgsys_get_changed_port_oprions "$tmp_ls.db" "$tmp_ls.log" > $tmp_ls.diff
+ pkgsys_get_saved_port_options_timestamps_all > $tmp_ls.db
+ pkgsys_get_current_port_options_timestamp > $tmp_ls.log
+ pkgsys_get_changed_port_options "$tmp_ls.db" "$tmp_ls.log" > $tmp_ls.diff
if ! [ `wc -l < $tmp_ls.diff` -gt 0 ]
then
message_echo
fi
done
message_echo "INFO: Recording for not inspected ports..."
- pkgsys_conv_portorigin_to_port_oprion_timestamp_logname < $tmp_ls.uninspected.origin > $tmp_ls.uninspected.logname
+ pkgsys_conv_portorigin_to_port_option_timestamp_logname < $tmp_ls.uninspected.origin > $tmp_ls.uninspected.logname
str_escape_regexp_filter < $tmp_ls.uninspected.dbfile | sed 's/^/^/;s/$/[[:space:]]/' > $tmp_ls.uninspected.dbfile_ptn
paste "$tmp_ls.uninspected.dbfile_ptn" "$tmp_ls.uninspected.logname" | while read -r dbfile_ptn logname
do
do
pkg=`sed -n ${iline}p "$tmp_list.pkgs"`
iline=$((${iline}+1))
- origin=`pkg_info_flavored_origin "$pkg"`
- [ -n "$origin" ] || continue
- env LANG=C grep -q -Fx "$origin" "${DBDIR}/damaged_package" 2>/dev/null && continue
- pkgsys_sanitychk_pkgcontents "$pkg" is_reinstall_encouraged && continue
- port_path=`pkgsys_get_portpath_from_origin "$origin"`
- if [ ! -d "$port_path" ]
- then
- message_echo "WARNING: $pkg ($origin) is obsolete." >&2
- message_echo >&2
- continue
- fi
- if [ $is_reinstall_encouraged = no ]
- then
- if [ $opt_batch_mode = no ]
+ for origin in `pkg_info_flavored_origins "$pkg"`
+ do
+ [ -n "$origin" ] || continue
+ env LANG=C grep -q -Fx "$origin" "${DBDIR}/damaged_package" 2>/dev/null && continue
+ pkgsys_sanitychk_pkgcontents "$pkg" is_reinstall_encouraged && continue
+ port_path=`pkgsys_get_portpath_from_origin "$origin"`
+ if [ ! -d "$port_path" ]
then
- message_echo "Do you want to reinstall it? (y/[n])"
- message_query_yn_default_no || continue
+ message_echo "WARNING: $pkg ($origin) is obsolete." >&2
+ message_echo >&2
+ continue
fi
- else
- if [ $opt_batch_mode = no ]
+ if [ $is_reinstall_encouraged = no ]
then
- message_echo "Do you want to reinstall it? ([y]/n)"
- message_query_yn_default_yes || continue
+ if [ $opt_batch_mode = no ]
+ then
+ message_echo "Do you want to reinstall it? (y/[n])"
+ message_query_yn_default_no || continue
+ fi
+ else
+ if [ $opt_batch_mode = no ]
+ then
+ message_echo "Do you want to reinstall it? ([y]/n)"
+ message_query_yn_default_yes || continue
+ fi
+ database_record_reconf_recover_sanity "$origin"
fi
- database_record_reconf_recover_sanity "$origin"
- fi
+ done
done
}
else
cp /dev/null "$dbpath/ports_options.current"
fi
- pkgsys_save_port_oprion_timestamp "$origin"
+ pkgsys_save_port_option_timestamp "$origin"
# Get the lists of requirements in the flavored form
database_build_create_pkgtag "$origin"
for variable in PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS FETCH_DEPENDS BUILD_DEPENDS LIB_DEPENDS
# Return the total storage space occupied by the installed files in bytes
pkg info -qs "$@" 2> /dev/null | sed 's/KiB$/*1024/;s/MiB$/*1024^2/;s/GiB$/*1024^3/;s/B$//' | tr '\n' + | sed 's/+$//' | bc -l
}
- pkg_info_flavor ()
+ pkg_info_flavors ()
+ # For an unflavored pattern, all matching flavors are returned.
{
local glob_unflavored
glob_unflavored=$1
pkg query -g '%At\t%Av' "$glob_unflavored" 2> /dev/null | env LANG=C grep -E '^flavor[[:space:]]' | cut -f 2
}
- pkg_info_flavored_origin ()
+ pkg_info_flavored_origins ()
+ # For an unflavored pattern, all matching flavors are returned.
{
local glob_unflavored origin_unflavored
glob_unflavored=$1
origin_unflavored=`pkg_info_qo "$glob_unflavored" 2> /dev/null || :`
- flavor=`pkg_info_flavor "$glob_unflavored" 2> /dev/null || :`
- [ -z "$flavor" ] || flavor=@$flavor
- echo "$origin_unflavored$flavor"
+ flavors=`pkg_info_flavors "$glob_unflavored" 2> /dev/null || :`
+ if [ -z "$flavors" ]
+ then
+ echo "$origin_unflavored"
+ else
+ for flavor in $flavors
+ do
+ echo "$origin_unflavored@$flavor"
+ done
+ fi
}
pkg_info_all_flavored_origins ()
{
# Return the total storage space occupied by the installed files in bytes
pkg_info -qs "$@" 2> /dev/null | sed 's/[^0-9]*/*1024/' | tr '\n' + | sed 's/+$//' | bc -l
}
- pkg_info_flavor ()
+ pkg_info_flavors ()
{
pkg_info -qe "$@" 2> /dev/null && echo
:
origin=$1
origin_unflavored=`pkgsys_get_unflavored_origin "$origin"`
flavor_origin=`pkgsys_get_flavor_from_origin "$origin"`
- pkg_info_qO "$origin_unflavored" 2> /dev/null | while read pkgname
- do
- flavor_pkg=`pkg_info_flavor "$pkgname"`
- if [ "x$flavor_origin" = "x$flavor_pkg" ]
- then
- echo "$pkgname"
- break
- fi
- done
+ if [ -n "$flavor_origin" ]
+ then
+ for pkgname in `pkg_info_qO "$origin_unflavored" 2> /dev/null`
+ do
+ for flavor_pkg in `pkg_info_flavors "$pkgname"`
+ do
+ if [ "x$flavor_origin" = "x$flavor_pkg" ]
+ then
+ echo "$pkgname"
+ return
+ fi
+ done
+ done
+ else
+ pkg_info_qO "$origin_unflavored" 2> /dev/null
+ fi
:
}
origin_unflavored=`pkgsys_get_unflavored_origin "$origin"`
pkg_info_eO "$origin_unflavored" 2> /dev/null || return
flavor_origin=`pkgsys_get_flavor_from_origin "$origin"`
- flavor_pkg=`pkg_info_flavor "$origin_unflavored"`
- [ "x$flavor_origin" = "x$flavor_pkg" ]
+ for flavor_pkg in `pkg_info_flavors "$origin_unflavored"`
+ do
+ [ "x$flavor_origin" = "x$flavor_pkg" ] && return
+ done
+ false
}
# ============= Generate the package names vs origins table at the initial state =============
else
origin_unflavored=`pkgsys_get_unflavored_origin "$origin"`
flavor_origin=`pkgsys_get_flavor_from_origin "$origin"`
- pkg_info_qO "$origin_unflavored" 2> /dev/null | while read pkgname
+ for pkgname in `pkg_info_qO "$origin_unflavored" 2> /dev/null`
do
- flavor_pkg=`pkg_info_flavor "$pkgname"`
- if [ "x$flavor_origin" = "x$flavor_pkg" ]
- then
- echo "$pkgname"
- break
- fi
+ for flavor_pkg in `pkg_info_flavors "$pkgname"`
+ do
+ if [ "x$flavor_origin" = "x$flavor_pkg" ]
+ then
+ echo "$pkgname"
+ return
+ fi
+ done
done
fi
:
}
# ============= Check whether the port options database is once saved =============
-pkgsys_exists_saved_port_oprions_timestamps ()
+pkgsys_exists_saved_port_options_timestamps ()
{
[ -d "${DBDIR}/ls_dbdir" ]
}
# ============= Get the current all timestamp information of port options =============
-pkgsys_get_current_port_oprions_timestamp ()
+pkgsys_get_current_port_options_timestamp ()
{
local portdb_needle_regexp
portdb_needle_regexp=`str_escape_regexp "$1"`
}
# ============= Get the saved all timestamp information of port options =============
-pkgsys_get_saved_port_oprions_timestamps_all ()
+pkgsys_get_saved_port_options_timestamps_all ()
{
mkdir -p "${DBDIR}/ls_dbdir"
cat "${DBDIR}/ls_dbdir/"*.log 2> /dev/null || :
}
# ============= Convert a list of port origins to port options timestamp log names =============
-pkgsys_conv_portorigin_to_port_oprion_timestamp_logname ()
+pkgsys_conv_portorigin_to_port_option_timestamp_logname ()
{
sed 's|/|_|'
}
# ============= Get the file name of the port options database of a port =============
-pkgsys_get_port_oprion_database ()
+pkgsys_get_port_option_database ()
{
local origin
origin=$1
}
# ============= Save the timestamp information of port options of a port =============
-pkgsys_save_port_oprion_timestamp ()
+pkgsys_save_port_option_timestamp ()
{
local origin portoptlog portoptdb
origin=$1
- portoptlog=`echo "$origin" | pkgsys_conv_portorigin_to_port_oprion_timestamp_logname`
- portoptdb=`pkgsys_get_port_oprion_database "$origin"`
+ portoptlog=`echo "$origin" | pkgsys_conv_portorigin_to_port_option_timestamp_logname`
+ portoptdb=`pkgsys_get_port_option_database "$origin"`
mkdir -p "${DBDIR}/ls_dbdir"
- pkgsys_get_current_port_oprions_timestamp "$portoptdb" > ${DBDIR}/ls_dbdir/$portoptlog.log 2> /dev/null || :
+ pkgsys_get_current_port_options_timestamp "$portoptdb" > ${DBDIR}/ls_dbdir/$portoptlog.log 2> /dev/null || :
}
# ============= Get changed port options from the saved point =============
-pkgsys_get_changed_port_oprions ()
+pkgsys_get_changed_port_options ()
{
local saved_log current_log tmp_log
saved_log=$1
current_log=$2
- tmp_log=${TMPDIR}/pkgsys_get_changed_port_oprions.log
+ tmp_log=${TMPDIR}/pkgsys_get_changed_port_options.log
{
env LANG=C grep -vxF -f "$current_log" "$saved_log" || :
env LANG=C grep -vxF -f "$saved_log" "$current_log" || :
message_echo "INFO: Deinstalling conflicting packages for $REINSTALL_ORIGPKGTAG."
while read pkg
do
- origin=`pkg_info_flavored_origin "$pkg"`
- origin_equiv=`database_query_get_equivalent_orgin "$origin"`
- message_echo "INFO: Backing up and deleting a conflict, $origin ($pkg)."
- origin_regexp_esc=`str_escape_regexp "$origin"`
- origin_equiv_regexp_esc=`str_escape_regexp "$origin_equiv"`
- if [ -d "${DBDIR}/requires/$origin" ]
- then
- backup_pkgdir=${DBDIR}/backup_packages
- else
- backup_pkgdir=${PKGREPOSITORY}
- fi
- mkdir -p "$backup_pkgdir"
- if backup_pkg=`pkgsys_get_backup_pkg "$origin"` || backup_pkg=`pkgsys_get_backup_pkg "$origin_equiv"`
- then
- message_echo "INFO: backup package already exists as $backup_pkg"
- elif ! backup_pkg=`pkgsys_create_backup_pkg "$pkg" "$backup_pkgdir"`
- then
- message_echo "WARNING: Failed to create the backup package, the conflict is kept installed." >&2
- continue
- fi
- env LANG=C grep -v -E "^${origin_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts" \
- > ${DBDIR}/deleted_conflicts.tmp 2> /dev/null || :
- if [ -n "$origin_equiv_regexp_esc" ]
- then
- env LANG=C grep -v -E "^${origin_equiv_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts.tmp" \
- > ${DBDIR}/deleted_conflicts.tmp2 2> /dev/null || :
- mv "${DBDIR}/deleted_conflicts.tmp2" "${DBDIR}/deleted_conflicts.tmp"
- fi
- printf '%s\t%s\n' "$origin" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp
- [ -n "$origin_equiv" ] && printf '%s\t%s\n' "$origin_equiv" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp
- mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts"
- pkg_delete_f "$pkg" || \
- {
- message_echo "WARNING: Failed to deinstall $pkg by $PKGSYS_CMD_PKG_DELETE." >&2
- }
+ for origin in `pkg_info_flavored_origins "$pkg"`
+ do
+ origin_equiv=`database_query_get_equivalent_orgin "$origin"`
+ message_echo "INFO: Backing up and deleting a conflict, $origin ($pkg)."
+ origin_regexp_esc=`str_escape_regexp "$origin"`
+ origin_equiv_regexp_esc=`str_escape_regexp "$origin_equiv"`
+ if [ -d "${DBDIR}/requires/$origin" ]
+ then
+ backup_pkgdir=${DBDIR}/backup_packages
+ else
+ backup_pkgdir=${PKGREPOSITORY}
+ fi
+ mkdir -p "$backup_pkgdir"
+ if backup_pkg=`pkgsys_get_backup_pkg "$origin"` || backup_pkg=`pkgsys_get_backup_pkg "$origin_equiv"`
+ then
+ message_echo "INFO: backup package already exists as $backup_pkg"
+ elif ! backup_pkg=`pkgsys_create_backup_pkg "$pkg" "$backup_pkgdir"`
+ then
+ message_echo "WARNING: Failed to create the backup package, the conflict is kept installed." >&2
+ continue
+ fi
+ env LANG=C grep -v -E "^${origin_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts" \
+ > ${DBDIR}/deleted_conflicts.tmp 2> /dev/null || :
+ if [ -n "$origin_equiv_regexp_esc" ]
+ then
+ env LANG=C grep -v -E "^${origin_equiv_regexp_esc}[[:space:]]" "${DBDIR}/deleted_conflicts.tmp" \
+ > ${DBDIR}/deleted_conflicts.tmp2 2> /dev/null || :
+ mv "${DBDIR}/deleted_conflicts.tmp2" "${DBDIR}/deleted_conflicts.tmp"
+ fi
+ printf '%s\t%s\n' "$origin" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp
+ [ -n "$origin_equiv" ] && printf '%s\t%s\n' "$origin_equiv" "$pkg" >> ${DBDIR}/deleted_conflicts.tmp
+ mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts"
+ pkg_delete_f "$pkg" || \
+ {
+ message_echo "WARNING: Failed to deinstall $pkg by $PKGSYS_CMD_PKG_DELETE." >&2
+ }
+ done
done
cat "${DBDIR}/deleted_conflicts" 2> /dev/null | sort -u > ${DBDIR}/deleted_conflicts.tmp
mv "${DBDIR}/deleted_conflicts.tmp" "${DBDIR}/deleted_conflicts"
pkg=`pkg_which "$filepath" || :`
[ -z "$pkg" ] && continue
env LANG=C grep -qFx "$pkg" "$tmp_conflicts.pkgs" && continue
- origin=`pkg_info_flavored_origin "$pkg"`
- [ x"$origin" = x"$REINSTALL_ORIGIN" ] && continue
- [ x"$origin" = x"$REINSTALL_ORIGIN_equiv" ] && continue
- origin_equiv=`database_query_get_equivalent_orgin "$origin"`
- [ x"$origin_equiv" = x"$REINSTALL_ORIGIN" ] && continue
- printf '%s\t%s\n' "$pkg" "$filepath" >> $db_conflict.tmp
+ for origin in `pkg_info_flavored_origins "$pkg"`
+ do
+ [ x"$origin" = x"$REINSTALL_ORIGIN" ] && continue
+ [ x"$origin" = x"$REINSTALL_ORIGIN_equiv" ] && continue
+ origin_equiv=`database_query_get_equivalent_orgin "$origin"`
+ [ x"$origin_equiv" = x"$REINSTALL_ORIGIN" ] && continue
+ printf '%s\t%s\n' "$pkg" "$filepath" >> $db_conflict.tmp
+ done
done
if [ -e "$db_conflict.tmp" ]
then
}
# ============= Deinstallation of the currently installed package =============
+# For a flavored package, its unflavored one is also deinstalled if existing.
+# For an unflavored package, its all flavored ones are also deinstalled if existing.
reinstall_deinstall ()
{
- local tmp_installedpkg REINSTALL_ORIGIN_equiv installed_pkgs dev_out dev_err
+ local tmp_installedpkg REINSTALL_ORIGIN_equiv installed_pkgs dev_out dev_err flavor
dev_out=/dev/stdout
dev_err=/dev/stderr
if [ $opt_batch_mode = yes ]
message_echo "WARNING: Failed to deinstall." >&2
}
else
+ flavor=`pkgsys_get_flavor_from_origin "$REINSTALL_ORIGIN"`
+ if [ -n "$flavor" ]
+ then
+ pkgsys_get_unflavored_origin "$REINSTALL_ORIGIN" >> $tmp_installedpkg
+ else
+ fi
while read pkg
do
message_echo "INFO: Deinstalling $pkg by $PKGSYS_CMD_PKG_DELETE." >&2