From 1f005b1a9dea970b45ab54fde217d093b067dfe9 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Mon, 4 Aug 2014 14:47:17 +0900 Subject: [PATCH] Version 3.0.5+toward_3.1.0_20140804144650 [IMPROVED] Revisions are made so that packages whose ports are replaced or moved are deinstalled before installation of the alternative ports. modified: bin/portsreinstall modified: lib/libdatabase_build.sh modified: lib/libreinstall.sh modified: man/portsreinstall.8 --- bin/portsreinstall | 2 +- lib/libdatabase_build.sh | 22 ++++++++++++++-------- lib/libreinstall.sh | 2 +- man/portsreinstall.8 | 2 ++ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bin/portsreinstall b/bin/portsreinstall index 9008aa4..f845824 100755 --- a/bin/portsreinstall +++ b/bin/portsreinstall @@ -15,7 +15,7 @@ APPNAME=`basename "$0"` # MYVERSION=3.1.0 # COMPATIBLE_VERSIONS='^(3\.1\.[0-9]+)$' # Template for development versions -MYVERSION=3.0.5+toward_3.1.0_20140804112402 +MYVERSION=3.0.5+toward_3.1.0_20140804144650 COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.1\.[0-9]+_[0-9]+|3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.1\.[0-9]+)$' MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'` MYPREFIX=${MYPREFIX:-/usr/local} diff --git a/lib/libdatabase_build.sh b/lib/libdatabase_build.sh index 74f8391..7a02493 100644 --- a/lib/libdatabase_build.sh +++ b/lib/libdatabase_build.sh @@ -339,16 +339,21 @@ database_build_is_port_already_inspected_in_required_level () # ============= Update the current package name of a port ============= database_build_update_pkgname () { - local origin pkg savefile + local origin pkg savefile origin_orig origin=$1 savefile=${DBDIR}/requires/$origin/current_version - pkg=`pkg_info_qO "$origin" || :` - if [ -z "$pkg" -a -e "${DBDIR}/requires/$origin/initial_orig" ] - then - origin_orig=`cat "${DBDIR}/requires/$origin/initial_orig"` - pkg=`pkg_info_qO "$origin_orig" || :` - fi - echo -n "$pkg" > $savefile + origin_orig=`echo "$origin" \ + | sed -E -f "${DBDIR}/REVERSE_REPLACE.complete_sed_pattern"` || : + echo "$origin_orig" "$origin" | tr ' ' '\n' | grep -v '^$' | while read orig + do + pkg=`pkg_info_qO "$orig" || :` + if [ -z "$pkg" -a -e "${DBDIR}/requires/$orig/initial_orig" ] + then + orig_init=`cat "${DBDIR}/requires/$orig/initial_orig"` + pkg=`pkg_info_qO "$orig_init" || :` + fi + echo -n "$pkg" + done > $savefile cat "$savefile" } @@ -936,6 +941,7 @@ database_build_post_inspect_dependencies () origin_regexp=`str_escape_regexp "$origin"` origin_esc=`str_escape_replaceval "$origin"` echo "s/^$origin_orig_regexp$/$origin_esc/" >> ${DBDIR}/REPLACE.complete_sed_pattern.tmp + [ -z "$origin_regexp" ] && continue echo "s/^$origin_regexp$/$origin_orig_esc/" >> ${DBDIR}/REVERSE_REPLACE.complete_sed_pattern.tmp done mv "${DBDIR}/REPLACE.complete_sed_pattern.tmp" "${DBDIR}/REPLACE.complete_sed_pattern" diff --git a/lib/libreinstall.sh b/lib/libreinstall.sh index c3336b0..629e81f 100644 --- a/lib/libreinstall.sh +++ b/lib/libreinstall.sh @@ -222,7 +222,7 @@ reinstall_backup_and_delete_conflicts () printf '%s\t%s\n' "$origin" "$pkg" >> ${DBDIR}/deleted_conflicts pkg_delete_f "$pkg" || \ { - message_echo "WARNING: Failed to deinstall $REINSTALL_CURRENTPKG by $PKGSYS_CMD_PKG_DELETE." >&2 + message_echo "WARNING: Failed to deinstall $pkg by $PKGSYS_CMD_PKG_DELETE." >&2 } done cat "${DBDIR}/deleted_conflicts" 2> /dev/null | sort -u > ${DBDIR}/deleted_conflicts.tmp diff --git a/man/portsreinstall.8 b/man/portsreinstall.8 index 290e457..ddaa443 100644 --- a/man/portsreinstall.8 +++ b/man/portsreinstall.8 @@ -938,6 +938,8 @@ The manual page is updated by adding "Workaround for failed ports: update of por .PP [IMPROVED] A countermeasure operation is implemented for a bug of pkg-1.3.4 that \fBpkg delete -q\fR does not work. .PP +[IMPROVED] Revisions are made so that packages whose ports are replaced or moved are deinstalled before installation of the alternative ports. +.PP [BUG FIX] Command \fBprepare\fR was possibly aborted at a port any of whose requirements or dependents is obsolete. .PP [BUG FIX] It silently failed to launch if the ports tree is missing or broken. -- 2.11.0