OSDN Git Service

Version 3.0.4+toward_3.0.5_20131213231732
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Fri, 13 Dec 2013 14:21:44 +0000 (23:21 +0900)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Fri, 13 Dec 2013 14:21:44 +0000 (23:21 +0900)
[NEW] Command of rmconf is added.

[CHANGED] Specification changes are made so that (re)installation processes are skipped for ports any of whose requirements is missing. This results in improvement to avoid attempt of unsuccessful builds due to unsuccessful installation of requirements and a fix of the following bug regarding unintentional reinstallation of escaped packages.

[BUG FIX] Escaped packages by escape command were unintentionally reinstalled in (re)installation of their dependents.

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

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

index f79d897..e5ab98e 100755 (executable)
@@ -15,7 +15,7 @@ APPNAME=`basename "$0"`
 # MYVERSION=3.0.4
 # COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+)$'
 # Template for development versions
-MYVERSION=3.0.4+toward_3.0.5_20131213035122
+MYVERSION=3.0.4+toward_3.0.5_20131213231732
 COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.0\.[0-9]+)$'
 MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
 MYPREFIX=${MYPREFIX:-/usr/local}
index ab506d1..777fa71 100644 (file)
@@ -198,7 +198,7 @@ command_parse_args ()
        options)
                _command_parse_args__chk_no_arg $#
                ;;
-       reconf|forget|escape|restore)
+       reconf|rmconf|forget|escape|restore)
                misc_chk_privilege
                temp_warn_obsolete_temp_db
                _command_parse_args__chk_glob_args $#
@@ -440,7 +440,7 @@ command_forget ()
 # ============= Execute command operations which are irrespective of option settings =============
 command_exec_irrespective_of_saved_options ()
 {
-       local dbfile tmp_manually_done_diff evalated_globs dbdir_parent dbdir_node arcfile grandtitle title isfirst origin origin_regexp backup_pkg origin_orig origin_replace pkg_orig tmp_done_orig tmp_pkgsanity nlines iline pkg
+       local dbfile tmp_manually_done_diff evalated_globs dbdir_parent dbdir_node arcfile grandtitle title isfirst origin origin_regexp backup_pkg origin_orig origin_replace pkg_orig tmp_done_orig tmp_pkgsanity nlines iline pkg make_target
        case $COMMAND_MODE in
        ok)
                dbfile=${DBDIR}/manually_done.list
@@ -584,15 +584,25 @@ command_exec_irrespective_of_saved_options ()
                pkgsys_eval_ports_glob "$@"
                exit
                ;;
-       reconf)
+       reconf|rmconf)
                _command_exec_irrespective_of_saved_options__notify_ignored_options
-               message_echo "Temporary database sections for the following ports are reset for later rebuild:"
+               case $COMMAND_MODE in
+               reconf)
+                       message_echo "Reconfigure the specified port options."
+                       make_target=config
+                       ;;
+               rmconf)
+                       message_echo "The specified port options are reset to the default."
+                       make_target=rmconfig
+                       ;;
+               esac
+               message_echo "Affected parts of the temporary database are reset automatically."
                for origin in `pkgsys_eval_ports_glob "$@"`
                do
                        origin_regexp=`str_escape_regexp "$origin"`
                        if grep -q -E "^$origin_regexp$" "${DBDIR}/inspected_ports" 2> /dev/null
                        then
-                               database_build_make "$origin" config
+                               database_build_make "$origin" $make_target
                                database_build_patch_reconf "$origin"
                        else
                                message_echo "$origin (not inspected)"
index 65e4045..ebd6606 100644 (file)
@@ -147,12 +147,22 @@ pkgsys_fetch_legacy_remote ()
        [ -d "${PKGREPOSITORY}" ] || mkdir -p "${PKGREPOSITORY}"
        if [ -e "${PKGREPOSITORY}/$pkg.tbz" ]
        then
-               fetchedMD5=`md5 "${PKGREPOSITORY}/$pkg.tbz" | sed -E "s/^[^=]*=[[:space:]]*(.*)/\1/"`
-               if [ "x$fetchedMD5" = "x$validMD5" ]
+               if [ -e "${PKGREPOSITORY}/$pkg.md5=$validMD5.tbz" ]
                then
-                       needs_fetch=no
+                       fetchedMD5=`md5 "${PKGREPOSITORY}/$pkg.md5=$validMD5.tbz" | sed -E "s/^[^=]*=[[:space:]]*(.*)/\1/"`
+                       [ "x$fetchedMD5" = "x$validMD5" ] || rm "${PKGREPOSITORY}/$pkg.md5=$fetchedMD5.tbz"
+               fi
+               if [ -e "${PKGREPOSITORY}/$pkg.md5=$validMD5.tbz" ]
+               then
+                       ln -f "${PKGREPOSITORY}/$pkg.md5=$fetchedMD5.tbz" "${PKGREPOSITORY}/$pkg.tbz"
                else
-                       mv "${PKGREPOSITORY}/$pkg.tbz" "${PKGREPOSITORY}/$pkg.md5=$fetchedMD5.tbz"
+                       fetchedMD5=`md5 "${PKGREPOSITORY}/$pkg.tbz" | sed -E "s/^[^=]*=[[:space:]]*(.*)/\1/"`
+                       if [ "x$fetchedMD5" = "x$validMD5" ]
+                       then
+                               needs_fetch=no
+                       else
+                               mv "${PKGREPOSITORY}/$pkg.tbz" "${PKGREPOSITORY}/$pkg.md5=$fetchedMD5.tbz"
+                       fi
                fi
        fi
        if [ $needs_fetch = yes ]
index a2faab5..d848fb8 100644 (file)
@@ -299,6 +299,16 @@ reinstall_restore_conflicts ()
        done < $tmpsrc
 }
 
+# ============= Check whether the all requirements are installed =============
+reinstall_are_requirements_ready ()
+{
+       [ -e "$REINSTALL_DBNODE_DIR/requirements.all.direct" ] || return 0
+       while read origin
+       do
+               pkg_info_eO "$origin" || return 1
+       done < $REINSTALL_DBNODE_DIR/requirements.all.direct
+}
+
 # ============= Get the all requirements ready for a port by restarting them if deinstalled =============
 reinstall_chk_and_restore_requirements ()
 {
@@ -311,14 +321,29 @@ reinstall_chk_and_restore_requirements ()
                | while read origin
        do
                pkg_info_eO "$origin" && continue
+               origin_regexp=`str_escape_regexp "$origin"`
+               if grep -q -E "^$origin_regexp$" "${DBDIR}/taboo.all.list" 2> /dev/null
+               then
+                       message_echo "INFO: Restoration of a requirement [$origin] is avoided because it is set taboo."
+                       touch "$tmp_isfailed"
+                       break
+               fi
                origin_orig=`echo "$origin" \
                        | sed -E -f "${DBDIR}/REVERSE_REPLACE.complete_sed_pattern"`
-               [ "x$origin_orig" != "x$origin" ] \
-                       && pkg_info_eO "$origin_orig" && continue
+               if [ "x$origin_orig" != "x$origin" ]
+               then
+                       pkg_info_eO "$origin_orig" && continue
+                       origin_orig_regexp=`str_escape_regexp "$origin_orig"`
+                       if grep -q -E "^$origin_orig_regexp$" "${DBDIR}/taboo.all.list" 2> /dev/null
+                       then
+                               message_echo "INFO: Restoration of a requirement [$origin_orig] is avoided because it is set taboo."
+                               touch "$tmp_isfailed"
+                               break
+                       fi
+               fi
                if ! pkgarc=`pkgsys_get_backup_pkg "$origin"` && \
                        ! pkgarc=`pkgsys_get_backup_pkg "$origin_orig"`
                then
-                       origin_regexp=`str_escape_regexp "$origin"`
                        if grep -q -E "^$origin_regexp$" "${DBDIR}/failed.list" 2> /dev/null
                        then
                                touch "$tmp_isfailed"
@@ -334,10 +359,10 @@ reinstall_chk_and_restore_requirements ()
                pkg_regexp_esc=`str_escape_regexp "$pkg"`
                if reinstall_chk_forbidden_conflicts "$pkg"
                then
-                       message_echo "INFO: Restoration of a conflict, $origin ($pkg), is avoided because it conflicts with installed packages."
+                       message_echo "INFO: Restoration of a requirement [$origin ($pkg)] is avoided because it conflicts with installed packages."
                        continue
                fi
-               message_echo "INFO: Restoring a backed-up requirement, $origin ($pkg)."
+               message_echo "INFO: Restoring a backed-up requirement [$origin ($pkg)]."
                if pkg_add_fF "$pkgarc"
                then
                        grep -v -E "[[:space:]]$pkg_regexp_esc$" "${DBDIR}/deleted_conflicts" \
@@ -570,7 +595,7 @@ reinstall_exec ()
                return
        fi
        reinstall_skip_if_in_a_list 'Ignored because being taboo' taboo.all.list && return
-       if ! reinstall_chk_and_restore_requirements
+       if ! reinstall_are_requirements_ready && ! reinstall_chk_and_restore_requirements
        then
                reinstall_restore_if_temporarily_deinstalled
                for tag in all run build none
index 6e225d3..acf3aed 100644 (file)
@@ -63,7 +63,7 @@ USAGE: ${APPNAME} [OPTIONS] [--] [command]
           | noneed add globs... | noneed del globs...
           | reselect leaves | reselect obsolete
           | save [dir] | load path | glob globs... | options
-          | reconf globs... | forget globs...
+          | rmconf globs... | reconf globs... | forget globs...
           | escape globs... | restore globs...
           | pkgsanity [globs...]
           | show todo | show done | show resolved | show failure | show redo
index 7ea95a4..fdf20cb 100644 (file)
@@ -142,8 +142,11 @@ Evaluate port globs and show matched origins both for installed and uninstalled
 Show saved option settings and expected effects of option-resetting options \fB\-L\fR, \fB\-M\fR and \fB\-N\fR.
 With \fB\-a\fR option, the first, second and third columns denote the option-resetting options, reset options and remaining options, respectively.
 .TP
+\fBrmconf\fR \fIglob\fR [\fIglob2\fR ...]
+Reset port options for the specified ports to the default and reset affected parts in the temporary database.
+.TP
 \fBreconf\fR \fIglob\fR [\fIglob2\fR ...]
-Reconfigure port options for the specified ports and reset their information in the temporary database.
+Reconfigure port options for the specified ports and reset affected parts in the temporary database.
 .TP
 \fBforget\fR \fIglob\fR [\fIglob2\fR ...]
 Try to let the temporary database forget about the specified ports as much as possible.
@@ -911,9 +914,15 @@ Configuration file of \fBportupgrade\fR(1).
 .TP
 3.0.5 (? December 2013)
 .RS
+[NEW] Command of \fBrmconf\fR is added.
+.PP
 [IMPROVED] Automatic resolution of duplicated registrations of multiple packages for the same port origin is implemented in \fBpkgsanity\fR command.
 .PP
+[CHANGED] Specification changes are made so that (re)installation processes are skipped for ports any of whose requirements is missing. This results in improvement to avoid attempt of unsuccessful builds due to unsuccessful installation of requirements and a fix of the following bug regarding unintentional reinstallation of escaped packages.
+.PP
 [BUG FIX] Execution of \fBreconf\fR command confused the work of \fB\-G\fR option.
+.PP
+[BUG FIX] Escaped packages by \fBescape\fR command were unintentionally reinstalled in (re)installation of their dependents.
 .RE
 .TP
 3.0.4 (16 November 2013)