[IMPROVED] Diagnosis of looped dependencies is implemented at the phase of "Completion of *-time requirement lists" in the preparation stage.
The manual page was modified in the part of options and history.
The target version is increased.
The copyright years are updated.
Changes to be committed:
modified: README
modified: bin/portsreinstall
modified: lib/libcommand.sh
modified: lib/libconf.sh
modified: lib/libdatabase_build.sh
modified: lib/libdatabase_query.sh
modified: lib/libdatabase_record.sh
modified: lib/libdeinstall.sh
modified: lib/libfileedit.sh
modified: lib/libmessage.sh
modified: lib/libmisc.sh
modified: lib/liboptions.sh
modified: lib/libpkgsys.sh
modified: lib/libprogram.sh
modified: lib/libreinstall.sh
modified: lib/libstr.sh
modified: lib/libtemp.sh
modified: lib/libusage.sh
modified: man/portsreinstall.8
================================================================================
portsreinstall - ports upgrading utility for massive forced reinstallation
- Version 3.2.2, June 28, 2015
+ Version 3.3.0, June 28, 2015
Copyright (C) 2010-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
================================================================================
# ============ Set up of environment =============
APPNAME=`basename "$0"`
-MYVERSION=3.2.2
-COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+)$'
+MYVERSION=3.3.0
+COMPATIBLE_VERSIONS='^(3\.[1-3]\.[0-9]+)$'
# Template for development versions
-MYVERSION=3.2.1+toward_3.2.2_20160628223135
-COMPATIBLE_VERSIONS='^(3\.[1-2]\.[0-9]+\+toward_3\.[1-2]\.[0-9]+_[0-9]+|3\.[1-2]\.[0-9]+)$'
+MYVERSION=3.2.1+toward_3.3.0_20160629003312
+COMPATIBLE_VERSIONS='^(3\.[1-3]\.[0-9]+\+toward_3\.[1-3]\.[0-9]+_[0-9]+|3\.[1-3]\.[0-9]+)$'
MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
MYPREFIX=${MYPREFIX:-/usr/local}
LIBDIR=${MYPREFIX}/lib/${APPNAME}
# ==============================================================================
# portsreinstall library script
# - Operations of commands as well as check of command line arguments -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Parsing of configuration files -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Operations for building the temporary database -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ============= Build and get a list of the complete recursive dependencies of a port =============
database_build_get_complete_recursive_dependency ()
{
- local table origin dbpath tmppath suffix dstfile dstfile_tmp
+ local table origin suffix tmpdb_parents dbpath srcfile dstfile loophead origin_esc tmppath dstfile_tmp
table=$1
origin=$2
suffix=$3
+ tmpdb_parents=${TMPDIR}/database_build_get_complete_recursive_dependency.parents
dbpath=${DBDIR}/requires/$origin
- [ -e "$dbpath/$table.direct$suffix" ] || return 0
+ srcfile=$dbpath/$table.direct$suffix
+ [ -e "$srcfile" ] || return 0
dstfile=$dbpath/$table.full$suffix
if [ ! -e "$dstfile" ]
then
- tmppath=${TMPDIR}/requires/$origin
- dstfile_tmp=$tmppath/$table.full$suffix
- [ -d "$tmppath" ] || mkdir -p "$tmppath"
- while read origin_requirement
- do
- echo "$origin_requirement"
- database_build_get_complete_recursive_dependency "$table" "$origin_requirement" "$suffix"
- done < $dbpath/$table.direct$suffix > $dstfile_tmp
- sort -u "$dstfile_tmp" > $dstfile
- rm "$dstfile_tmp"
+ origin_esc=`str_escape_regexp "$origin"`
+ touch "$tmpdb_parents"
+ num_parents=`wc -l < $tmpdb_parents`
+ if grep -Eq "^$origin_esc$" "$tmpdb_parents"
+ then
+ loophead=`grep -En "^$origin_esc$" "$tmpdb_parents" | tail -n 1 | cut -d : -f 1`
+ message_echo 'WARNING: The following loop was found, ignored forcibly:' >&2
+ message_echo " $origin" >&2
+ sed -n $(($loophead+1)),\$p "$tmpdb_parents" | sed 's/^/ -->/' | message_cat >&2
+ message_echo " -->$origin" >&2
+exit 255
+ else
+ echo "$origin" >> $tmpdb_parents
+ tmppath=${TMPDIR}/requires/$origin
+ dstfile_tmp=$tmppath/$table.full$suffix
+ [ -d "$tmppath" ] || mkdir -p "$tmppath"
+ while read origin_requirement
+ do
+ echo "$origin_requirement"
+ database_build_get_complete_recursive_dependency "$table" "$origin_requirement" "$suffix"
+ done < $srcfile > $dstfile_tmp
+ sort -u "$dstfile_tmp" > $dstfile
+ rm "$dstfile_tmp"
+ head -n ${num_parents}p "$tmpdb_parents" > $tmpdb_parents.tmp
+ mv "$tmpdb_parents.tmp" "$tmpdb_parents"
+ fi
fi
cat "$dstfile"
}
# ==============================================================================
# portsreinstall library script
# - Operations for queries to the temporary database -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Operations for recording operation results to the temporary database -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Deinstallation processes -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Editing operations on files -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Messages -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Miscellaneous functions -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Command line options -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
M reset-minor-options opt_reset_minor_options no yes
L reload-conf opt_reload_conf no yes
i allow-new-targets opt_allow_new_targets no yes
+f force-continuation-for-looped-dependency opt_force_continuation_for_looped_dependency no yes
eof
}
# ==============================================================================
# portsreinstall library script
# - Wrappers for hiding version differences in the Ports/Packages system -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Program control -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Reinstallation processes -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - String processing -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Temporary directory and signal trapping -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
# ==============================================================================
# portsreinstall library script
# - Help messages -
-# Copyright (C) 2013-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
+# Copyright (C) 2013-2016 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
# This software is distributed under the 2-Clause BSD License.
# ==============================================================================
-V : Show the current version.
<Group 2: Effective anytime>
-a : Suppress messages to be batch-friendly.
+ -f : Force continuation for looped dependency
-i : Include new targets to the "needed" list.
-M : Reset group 4 option settings.
<Group 3: Effective only with redo command>
.\" ports reinstall installation guide
.\" Copyright (C) 2010-2015 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
.\" ==================================================================================
-.TH PORTSREINSTALL 8 "28 June 2016" "FreeBSD" "FreeBSD System Manager's Manual"
+.TH PORTSREINSTALL 8 "29 June 2016" "FreeBSD" "FreeBSD System Manager's Manual"
.SH NAME
portsreinstall \- ports upgrading utility for massive forced reinstallation
.SH SYNOPSIS
The output formats for \fBoptions\fR and \fBshow\fR commands and \fB\-V\fR option are arranged to be more batch\-friendly.
It is noted that log output in build/installation processes are not suppressed.
.PD
+.IP \fB\-f\fR
+.PD 0
+.TP
+\fB\-\-force\-continuation\-for\-looped\-dependency\fR
+Continue forcibly even if looped dependencies are found.
+The diagnosis of dependencies is carried out at the phase of "Completion of *-time requirement lists" of the preparation stage.
+.PD
.IP \fB\-i\fR
.PD 0
.TP
.SH HISTORY
\fBportsreinstall\fR has been developed as below.
.TP
-3.2.2 (21 June 2016)
+3.3.0 (29 June 2016)
.RS
-[CHANGED] The "Completion of recursive requirement lists" phase was very heavy without -q option when pkg(8) was updated; this problem is resolved by ignoring the build-time dependence on pkg(8).
+[NEW] Option \-f is added.
+.PP
+[IMPROVED] Diagnosis of looped dependencies is implemented at the phase of "Completion of *-time requirement lists" in the preparation stage.
+.PP
+[CHANGED] Dependencies on pkg(8) is changed to be ignored.
.PP
[BUG FIX] The rescue process for cases missing pkg(8) was not working well.
.RE