# ================================================
APPNAME=`basename "$0"`
-MYVERSION=1.1.0+toward_1.2.0_20120806060951
+MYVERSION=1.1.0+toward_1.2.0_20120807154627
PREFIX=${PREFIX:-/usr/local}
CONFFILE=${PREFIX}/etc/${APPNAME}.conf
# ============= Save arguments for updated restart =============
restart_command ()
{
- echo -n 'exec '`echo $0 | sed -E 's/ /\\ /g'`' '
+ echo -n "exec `echo "$0" | sed -E 's/(.)/\\\\\\1/g'`"
while [ $# -ge 1 ]
do
- echo -n `echo $1 | sed -E 's/ /\\ /g'`' '
+ echo -n " `echo "$1" | sed -E 's/(.)/\\\\\\1/g'`"
shift
done
}
cd "${PORTSDIR}/$origin"
target_dir=${DBDIR}/requires/$origin
[ -d "$target_dir/status" ] || mkdir -p "$target_dir/status"
+ [ $is_supressed = no ] || touch "$target_dir/SUPPRESSED"
if [ -d "${DBDIR}/requires_conflist/$origin" ]
then
cp -R "${DBDIR}/requires_conflist/$origin/"* "$target_dir/" > /dev/null 2> /dev/null || :
env ${MAKE_ENVS} make fetch-urlall-list ${MAKE_ARGS} | sed -E 's|.*/([^/]+)$|\1|' | sort | uniq >> ${DBDIR}/distfiles.list
fi
fi
- if [ $is_supressed = no ]
+ [ "$origin_orig" = "$origin" ] || echo "s|^`str_escape_regexp $origin_orig`$|$origin|" >> ${DBDIR}/REPLACE.complete_replace_pattern.tmp
+ add_a_line_if_new "$origin" "${DBDIR}/target.inspected.list"
+ rm_a_line "$origin" "${DBDIR}/target_ports.remain"
+ if [ -n "$origin_src" ]
then
- [ "$origin_orig" = "$origin" ] || echo "s|^`str_escape_regexp $origin_orig`$|$origin|" >> ${DBDIR}/REPLACE.complete_replace_pattern.tmp
- add_a_line_if_new "$origin" "${DBDIR}/target.inspected.list"
- rm_a_line "$origin" "${DBDIR}/target_ports.remain"
- if [ -n "$origin_src" ]
- then
- add_a_line_if_new "$origin_src" "${DBDIR}/target.inspected.list"
- rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
- fi
- else
- rm_a_line "$origin" "${DBDIR}/target_ports.remain"
- if [ -n "$origin_src" ]
- then
- rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
- fi
+ add_a_line_if_new "$origin_src" "${DBDIR}/target.inspected.list"
+ rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
fi
echo "${DEPTH_INDEX} ===> ok"
warn_update_ports ()
{
[ ${_STATUS_DB_OBSOLETE} = no ] && return
- echo "WARN: The Ports tree was updated after construction of the temporal database for ${APPNAME}." >&2
+ echo "WARNING: The Ports tree was updated after construction of the temporal database for ${APPNAME}." >&2
echo " You should consider executing " >&2
echo " ${APPNAME} clean" >&2
echo " to reset the temporal database unless you have special purposes." >&2
show_list_failure ()
{
+ [ -e "${DBDIR}"/failed.list ] || return 0
while read origin
do
note=`cat "${DBDIR}/requires/$origin/note_failtre"`
echo
# Check of conflicting option
-[ -n "$target_dependent_ports" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -t option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_required_ports" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -T option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_dependent_ports_form2" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -r option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_required_ports_form2" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -R option is specified but ignored because we are restarting the previous run." >&2
-[ "$load_pkgtoolsconf" != undef -a -d "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ] && echo "WARN: -p, -P or -Q option is specified but ignored by following the previous settings." >&2
+[ -z "$target_dependent_ports" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -t option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_required_ports" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -T option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_dependent_ports_form2" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -r option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_required_ports_form2" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -R option is specified but ignored because we are restarting the previous run." >&2
+[ "$load_pkgtoolsconf" = undef -o ! -e "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ] || echo "WARNING: -p, -P or -Q option is specified but ignored by following the previous settings." >&2
# Check whether the temporal database is newer than the ports tree
if [ "${PORTS_INDEX_DB}" -nt "${DBDIR}" ]
then
( cd "${PORTSDIR}/$self_origin" && make clean )
echo "INFO: Cleaning the temporal database by the new version..."
- echo
- "${APPNAME}" clean
+ rm -rf "${DBDIR}"
echo
echo "INFO: Restarting with the new version..."
echo
then
chk_if_target currentorigin "$origin"
[ -n "${currentorigin_is_relevant}" ] || continue
+ [ ! -e "${DBDIR}/requires/$origin/SUPPRESSED" ] || continue
fi
if [ -e "${DBDIR}/$pkgnamedb/$origin/pkgtag" ]
then
then
chk_if_target currentorigin "$origin"
[ -n "${currentorigin_is_relevant}" ] || continue
+ [ ! -e "${DBDIR}/requires/$origin/SUPPRESSED" ] || continue
fi
if [ -e "${DBDIR}/$pkgnamedb/$origin/pkgtag" ]
then
t_skip_unchanged=$skip_unchanged
t_keep_distfiles=$keep_distfiles
. "${DBDIR}"/saved_options.sh
- [ $t_avoid_vulner = no -o $t_avoid_vulner = $avoid_vulner ] || echo "WARN: -s option is specified but ignored by transferring the settings from the previous run." >&2
- [ $t_skip_unchanged = no -o $t_skip_unchanged = $skip_unchanged ] || echo "WARN: -q option is specified but ignored by transferring the settings from the previous run." >&2
- [ $t_keep_distfiles = no -o $t_keep_distfiles = $keep_distfiles ] || echo "WARN: -d option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_avoid_vulner = no -o $t_avoid_vulner = $avoid_vulner ] || echo "WARNING: -s option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_skip_unchanged = no -o $t_skip_unchanged = $skip_unchanged ] || echo "WARNING: -q option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_keep_distfiles = no -o $t_keep_distfiles = $keep_distfiles ] || echo "WARNING: -d option is specified but ignored by transferring the settings from the previous run." >&2
fi
echo "INFO: List of option values:"
echo "-----------------------------------------"
cat "${DBDIR}"/saved_options.sh
echo "-----------------------------------------"
+echo
if [ ! -e "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ]
then
fi
elif [ $load_pkgtoolsconf != undef -a `which portupgrade | wc -l` -eq 0 ]
then
- echo "WARN: pkgtools.conf is ignored because portupgrade is not installed" >&2
+ echo "WARNING: pkgtools.conf is ignored because portupgrade is not installed" >&2
load_pkgtoolsconf=no
fi
echo "-- Starting to parse pkgtools.conf at `timestamp` (by using installed portupgrade)"
portupgrade_pkg=`pkg_info -qO ports-mgmt/portupgrade`
[ -n "$portupgrade_pkg" ] || portupgrade_pkg=`pkg_info -qO ports-mgmt/portupgrade-devel`
- [ `expr "$portupgrade_pkg" : '^portupgrade-devel-'` -ne 0 ] && echo "WARN: Combination with portupgrade-devel-* has not tested."
+ [ `expr "$portupgrade_pkg" : '^portupgrade-devel-'` -ne 0 ] && echo "WARNING: Combination with portupgrade-devel-* has not tested."
istart=`grep -m 1 -n -e '^def init_global$' "${PORTUPGRADE}" | cut -d : -f 1` || :
[ -n "$istart" ] || { echo "ERROR: The current installed version of portupgrade is unsupported." >&2; }
sed 1,$(($istart-1))d "${PORTUPGRADE}" > ${TMPDIR}/portupgrade.0
fi
# ------- Configurations -------
-
-if [ ! -e "${DBDIR}/COMPLETE_INFO_TABOO_PORTS" ]
+if [ -n "$taboo_ports$taboo_ports_form2" ]
then
- if [ `cat "${DBDIR}"/taboo.list | wc -l` -gt 0 ]
- then
- echo "INFO: (Re-)installation of the following ports are avoided as taboo:"
- echo "----------------------------------------"
- cat "${DBDIR}"/taboo.list
- echo "----------------------------------------"
- echo
- fi
- touch "${DBDIR}/COMPLETE_INFO_TABOO_PORTS"
+ echo "INFO: (Re-)installation of the following ports are avoided as taboo:"
+ echo "----------------------------------------"
+ [ ! -e "${DBDIR}"/taboo.list ] || cat "${DBDIR}"/taboo.list
+ echo "----------------------------------------"
+ echo
fi
if [ ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ]
rm -f "${DBDIR}/target_dependent_ports.specified" "${DBDIR}/target_required_ports.specified"
register_globs_only_installed "$target_dependent_ports" "$target_dependent_ports_form2" > ${DBDIR}/target_dependent_ports.specified
register_globs_only_installed "$target_required_ports" "$target_required_ports_form2" > ${DBDIR}/target_required_ports.specified
- if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ]
+ touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS"
+fi
+if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ]
+then
+ echo "INFO: Operations will be applied only to the targets:"
+ if [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
then
- echo "INFO: Operations will be applied only to the targets:"
- if [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_dependent_ports.specified
- echo "----------------------------------------"
- echo "and their dependents;"
- echo "----------------------------------------"
- cat "${DBDIR}"/target_required_ports.specified
- echo "----------------------------------------"
- echo "and their requirements."
- echo
- elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_dependent_ports.specified
- echo "----------------------------------------"
- echo "and their dependents."
- echo
- elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_required_ports.specified
- echo "----------------------------------------"
- echo "and their requirements."
- echo
- else
- echo "ERROR: Target ports are specified but none of them is valid." >&2
- exit 1
- fi
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_dependent_ports.specified
+ echo "----------------------------------------"
+ echo "and their dependents;"
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_required_ports.specified
+ echo "----------------------------------------"
+ echo "and their requirements."
+ echo
+ elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ]
+ then
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_dependent_ports.specified
+ echo "----------------------------------------"
+ echo "and their dependents."
+ echo
+ elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
+ then
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_required_ports.specified
+ echo "----------------------------------------"
+ echo "and their requirements."
+ echo
+ else
+ echo "ERROR: Target ports are specified but none of them is valid." >&2
+ exit 1
fi
- touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS"
fi
# Parse configuration file
expand_glob_pattern_to_origins "$glob_pattern" yes > ${TMPDIR}/origins.2.tmp || :
if [ `cat "${TMPDIR}/origins.2.tmp" | wc -l` -eq 0 ]
then
- echo "WARN: Original package to be replaced [$glob_pattern] is obsolete." >&2
+ echo "WARNING: Original package to be replaced [$glob_pattern] is obsolete." >&2
echo " If still required, use a pattern for port origins instead." >&2
continue
fi
then
to=
else
- [ -d "${PORTSDIR}/$to" ] || echo "WARN: replacement port [$to] is obsolete" >&2
+ [ -d "${PORTSDIR}/$to" ] || echo "WARNING: replacement port [$to] is obsolete" >&2
fi
str_escape_regexp_filter < ${TMPDIR}/origins.2.tmp | sed "s|^|s:^|; s|$|$:$to:|" >> ${DBDIR}/REPLACE.replace_pattern.conflist
done
sort -u "${DBDIR}/target_dependent_ports.specified" "${DBDIR}/target_required_ports.specified" | add_lines_if_new "${DBDIR}"/target_ports.new
if [ `cat "${DBDIR}/target_ports" | wc -l` -ne `cat "${DBDIR}/target_ports.new" | wc -l` ]
then
- echo "WARN: The temporal database will be refreshed so as to reinstall the all failed ports and their dependents."
+ echo "WARNING: The temporal database will be refreshed so as to reinstall the all failed ports and their dependents."
rm -f "${DBDIR}/COMPLETE_COLLECED_ALL_DEPENDENCIES" \
"${DBDIR}/COMPLETE_DISTFILES_LIST" \
"${DBDIR}/COMPLETE_CONVERT_REQUIRES_LIST" \
rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
continue
fi
+ if [ -e "${DBDIR}/requires/$origin/SUPPRESSED" ]
+ then
+ echo "========== $counter (Skipping a suppressed port $position_msg as success at `timestamp`) =========="
+ cat ${TMPDIR}/msg_if_target
+ echo
+ rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+ continue
+ fi
if [ -e "${DBDIR}/requires/$origin/installed_version" ]
then
insttarget=reinstall
fi
if [ -e "${DBDIR}/requires/$origin/status/FAILED_FETCH" ]
then
- echo "WARN: Refetching distfiles for ${PORTSDIR}/$position_msg." >&2
+ echo "WARNING: Refetching distfiles for ${PORTSDIR}/$position_msg." >&2
# if [ ! -e "${DBDIR}/requires/$origin/status/COMPLETE.FAILED_FETCH.DISTCLEAN" ]
# then
# env ${MAKE_ENVS} make distclean NOCLEANDEPENDS=yes ${MAKE_ARGS} || \
pkg_create -b "$currentpkg" || \
{
rm -f "${DBDIR}/backup_failure/$currentpkg.tbz"
- echo "WARN: Failed to create the backup package, but ignored by hoping success." >&2
+ echo "WARNING: Failed to create the backup package, but ignored by hoping success." >&2
}
cd "${PORTSDIR}/$origin"
touch "${DBDIR}/requires/$origin/status/COMPLETE_PKG_BACKUP"
then
pkg_delete -f $currentpkg || \
{
- echo "WARN: Failed to deinstall $currentpkg by pkg_delete." >&2
+ echo "WARNING: Failed to deinstall $currentpkg by pkg_delete." >&2
}
echo "-- (Trying to deinstall by ports to make sure. This usually ends up with warnings.)"
env ${MAKE_ENVS} make deinstall ${MAKE_ARGS} || \
{
- echo "WARN: Failed to deinstall $currentpkg by make deinstall." >&2
+ echo "WARNING: Failed to deinstall $currentpkg by make deinstall." >&2
}
touch "${DBDIR}/requires/$origin/status/COMPLETE_DEINSTALL"
fi
echo "*** Restoring the backup..."
if [ -e "${DBDIR}/backup_failure/$currentpkg.tbz" ]
then
- echo "WARN: No backup exists, gave up." >&2
+ echo "WARNING: No backup exists, gave up." >&2
elif pkg_add -fF "${DBDIR}/backup_failure/$currentpkg.tbz"
then
:
else
- echo "WARN: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
+ echo "WARNING: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
fi
fi
touch "${DBDIR}/requires/$origin/status/COMPETE.FAILED_INSTALL.RECOVER"
then
env ${MAKE_ENVS} make clean ${MAKE_ARGS} || \
{
- echo "WARN: Failed to clean $position_msg." >&2
+ echo "WARNING: Failed to clean $position_msg." >&2
}
touch "${DBDIR}/requires/$origin/status/COMPLETE_CLEAN_AFTER_INSTALL"
fi
.SH HISTORY
\fBportsreinstall\fR has been developed as below.
.TP
-1.2.0 (5 August 2012)
+1.2.0 (7 August 2012)
[NEW] Options \fB\-X\fR, \fB\-r\fR and \fB\-R\fR are added so as to compensate a fact that \fB\-x\fR, \fB\-t\fR and \fB\-T\fR cannot specify package names with commas.
[NEW] Commands of \fBshow requirements\fR and \fBshow dependents\fR are added.
[NEW] A functionality of self-update is added so as to be carried out first if the port of portsreinstall is new.
+[NEW] Option \fB\-k\fR is added for cases that update of portsreinstall should be avoided.
+
+[IMPROVED] Messages are extended to output configuration parameter values.
+
[CHANGED] Functionalities of options \fB\-t\fR and \fB\-T\fR are changed so as to prevent deinstallation of irrelevant packages and detect obsolete installed dependencies.
[CHANGED] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished.
[BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add).
[BUG FIX] Values of BEFOREBUILD, BEFOREDEINSTALL and AFTERINSTALL were not correctly imported from pkgtools.conf(5).
-
-[NEW] Option \fB\-k\fR is added for cases that update of portsreinstall should be avoided.
-
-[IMPROVED] Messages are extended to output configuration parameter values.
.TP
1.1.0 (28 April 2012)
[NEW] Command of show deleted is newly added.
# ================================================
APPNAME=`basename "$0"`
-MYVERSION=1.1.0+toward_1.2.0_20120805232853
+MYVERSION=1.1.0+toward_1.2.0_20120807052151
PREFIX=${PREFIX:-/usr/local}
CONFFILE=${PREFIX}/etc/${APPNAME}.conf
# ============= Save arguments for updated restart =============
restart_command ()
{
- echo -n 'exec '`echo $0 | sed -E 's/ /\\ /g'`' '
+ echo -n "exec `echo "$0" | sed -E 's/(.)/\\\\\\1/g'`"
while [ $# -ge 1 ]
do
- echo -n `echo $1 | sed -E 's/ /\\ /g'`' '
+ echo -n " `echo "$1" | sed -E 's/(.)/\\\\\\1/g'`"
shift
done
}
cd "${PORTSDIR}/$origin"
target_dir=${DBDIR}/requires/$origin
[ -d "$target_dir/status" ] || mkdir -p "$target_dir/status"
+ [ $is_supressed = no ] || touch "$target_dir/SUPPRESSED"
if [ -d "${DBDIR}/requires_conflist/$origin" ]
then
cp -R "${DBDIR}/requires_conflist/$origin/"* "$target_dir/" > /dev/null 2> /dev/null || :
env ${MAKE_ENVS} make fetch-urlall-list ${MAKE_ARGS} | sed -E 's|.*/([^/]+)$|\1|' | sort | uniq >> ${DBDIR}/distfiles.list
fi
fi
- if [ $is_supressed = no ]
+ [ "$origin_orig" = "$origin" ] || echo "s|^`str_escape_regexp $origin_orig`$|$origin|" >> ${DBDIR}/REPLACE.complete_replace_pattern.tmp
+ add_a_line_if_new "$origin" "${DBDIR}/target.inspected.list"
+ rm_a_line "$origin" "${DBDIR}/target_ports.remain"
+ if [ -n "$origin_src" ]
then
- [ "$origin_orig" = "$origin" ] || echo "s|^`str_escape_regexp $origin_orig`$|$origin|" >> ${DBDIR}/REPLACE.complete_replace_pattern.tmp
- add_a_line_if_new "$origin" "${DBDIR}/target.inspected.list"
- rm_a_line "$origin" "${DBDIR}/target_ports.remain"
- if [ -n "$origin_src" ]
- then
- add_a_line_if_new "$origin_src" "${DBDIR}/target.inspected.list"
- rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
- fi
- else
- rm_a_line "$origin" "${DBDIR}/target_ports.remain"
- if [ -n "$origin_src" ]
- then
- rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
- fi
+ add_a_line_if_new "$origin_src" "${DBDIR}/target.inspected.list"
+ rm_a_line "$origin_src" "${DBDIR}/target_ports.remain"
fi
echo "${DEPTH_INDEX} ===> ok"
warn_update_ports ()
{
[ ${_STATUS_DB_OBSOLETE} = no ] && return
- echo "WARN: The Ports tree was updated after construction of the temporal database for ${APPNAME}." >&2
+ echo "WARNING: The Ports tree was updated after construction of the temporal database for ${APPNAME}." >&2
echo " You should consider executing " >&2
echo " ${APPNAME} clean" >&2
echo " to reset the temporal database unless you have special purposes." >&2
show_list_failure ()
{
+ [ -e "${DBDIR}"/failed.list ] || return 0
while read origin
do
note=`cat "${DBDIR}/requires/$origin/note_failtre"`
echo
# Check of conflicting option
-[ -n "$target_dependent_ports" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -t option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_required_ports" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -T option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_dependent_ports_form2" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -r option is specified but ignored because we are restarting the previous run." >&2
-[ -n "$target_required_ports_form2" -a -d "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] && echo "WARN: -R option is specified but ignored because we are restarting the previous run." >&2
-[ "$load_pkgtoolsconf" != undef -a -d "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ] && echo "WARN: -p, -P or -Q option is specified but ignored by following the previous settings." >&2
+[ -z "$target_dependent_ports" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -t option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_required_ports" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -T option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_dependent_ports_form2" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -r option is specified but ignored because we are restarting the previous run." >&2
+[ -z "$target_required_ports_form2" -o ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ] || echo "WARNING: -R option is specified but ignored because we are restarting the previous run." >&2
+[ "$load_pkgtoolsconf" = undef -o ! -e "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ] || echo "WARNING: -p, -P or -Q option is specified but ignored by following the previous settings." >&2
# Check whether the temporal database is newer than the ports tree
if [ "${PORTS_INDEX_DB}" -nt "${DBDIR}" ]
then
( cd "${PORTSDIR}/$self_origin" && make clean )
echo "INFO: Cleaning the temporal database by the new version..."
- echo
- "${APPNAME}" clean
+ rm -rf "${DBDIR}"
echo
echo "INFO: Restarting with the new version..."
echo
then
chk_if_target currentorigin "$origin"
[ -n "${currentorigin_is_relevant}" ] || continue
+ [ ! -e "${DBDIR}/requires/$origin/SUPPRESSED" ] || continue
fi
if [ -e "${DBDIR}/$pkgnamedb/$origin/pkgtag" ]
then
then
chk_if_target currentorigin "$origin"
[ -n "${currentorigin_is_relevant}" ] || continue
+ [ ! -e "${DBDIR}/requires/$origin/SUPPRESSED" ] || continue
fi
if [ -e "${DBDIR}/$pkgnamedb/$origin/pkgtag" ]
then
t_skip_unchanged=$skip_unchanged
t_keep_distfiles=$keep_distfiles
. "${DBDIR}"/saved_options.sh
- [ $t_avoid_vulner = no -o $t_avoid_vulner = $avoid_vulner ] || echo "WARN: -s option is specified but ignored by transferring the settings from the previous run." >&2
- [ $t_skip_unchanged = no -o $t_skip_unchanged = $skip_unchanged ] || echo "WARN: -q option is specified but ignored by transferring the settings from the previous run." >&2
- [ $t_keep_distfiles = no -o $t_keep_distfiles = $keep_distfiles ] || echo "WARN: -d option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_avoid_vulner = no -o $t_avoid_vulner = $avoid_vulner ] || echo "WARNING: -s option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_skip_unchanged = no -o $t_skip_unchanged = $skip_unchanged ] || echo "WARNING: -q option is specified but ignored by transferring the settings from the previous run." >&2
+ [ $t_keep_distfiles = no -o $t_keep_distfiles = $keep_distfiles ] || echo "WARNING: -d option is specified but ignored by transferring the settings from the previous run." >&2
fi
echo "INFO: List of option values:"
echo "-----------------------------------------"
cat "${DBDIR}"/saved_options.sh
echo "-----------------------------------------"
+echo
if [ ! -e "${DBDIR}/COMPLETE_IMPORT_PKGTOOLS_CONF" ]
then
fi
elif [ $load_pkgtoolsconf != undef -a `which portupgrade | wc -l` -eq 0 ]
then
- echo "WARN: pkgtools.conf is ignored because portupgrade is not installed" >&2
+ echo "WARNING: pkgtools.conf is ignored because portupgrade is not installed" >&2
load_pkgtoolsconf=no
fi
echo "-- Starting to parse pkgtools.conf at `timestamp` (by using installed portupgrade)"
portupgrade_pkg=`pkg_info -qO ports-mgmt/portupgrade`
[ -n "$portupgrade_pkg" ] || portupgrade_pkg=`pkg_info -qO ports-mgmt/portupgrade-devel`
- [ `expr "$portupgrade_pkg" : '^portupgrade-devel-'` -ne 0 ] && echo "WARN: Combination with portupgrade-devel-* has not tested."
+ [ `expr "$portupgrade_pkg" : '^portupgrade-devel-'` -ne 0 ] && echo "WARNING: Combination with portupgrade-devel-* has not tested."
istart=`grep -m 1 -n -e '^def init_global$' "${PORTUPGRADE}" | cut -d : -f 1` || :
[ -n "$istart" ] || { echo "ERROR: The current installed version of portupgrade is unsupported." >&2; }
sed 1,$(($istart-1))d "${PORTUPGRADE}" > ${TMPDIR}/portupgrade.0
fi
# ------- Configurations -------
-
-if [ ! -e "${DBDIR}/COMPLETE_INFO_TABOO_PORTS" ]
+if [ -n "$taboo_ports$taboo_ports_form2" ]
then
- if [ `cat "${DBDIR}"/taboo.list | wc -l` -gt 0 ]
- then
- echo "INFO: (Re-)installation of the following ports are avoided as taboo:"
- echo "----------------------------------------"
- cat "${DBDIR}"/taboo.list
- echo "----------------------------------------"
- echo
- fi
- touch "${DBDIR}/COMPLETE_INFO_TABOO_PORTS"
+ echo "INFO: (Re-)installation of the following ports are avoided as taboo:"
+ echo "----------------------------------------"
+ [ ! -e "${DBDIR}"/taboo.list ] || cat "${DBDIR}"/taboo.list
+ echo "----------------------------------------"
+ echo
fi
if [ ! -e "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" ]
rm -f "${DBDIR}/target_dependent_ports.specified" "${DBDIR}/target_required_ports.specified"
register_globs_only_installed "$target_dependent_ports" "$target_dependent_ports_form2" > ${DBDIR}/target_dependent_ports.specified
register_globs_only_installed "$target_required_ports" "$target_required_ports_form2" > ${DBDIR}/target_required_ports.specified
- if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ]
+ touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS"
+fi
+if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ]
+then
+ echo "INFO: Operations will be applied only to the targets:"
+ if [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
then
- echo "INFO: Operations will be applied only to the targets:"
- if [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_dependent_ports.specified
- echo "----------------------------------------"
- echo "and their dependents;"
- echo "----------------------------------------"
- cat "${DBDIR}"/target_required_ports.specified
- echo "----------------------------------------"
- echo "and their requirements."
- echo
- elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_dependent_ports.specified
- echo "----------------------------------------"
- echo "and their dependents."
- echo
- elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
- then
- echo "----------------------------------------"
- cat "${DBDIR}"/target_required_ports.specified
- echo "----------------------------------------"
- echo "and their requirements."
- echo
- else
- echo "ERROR: Target ports are specified but none of them is valid." >&2
- exit 1
- fi
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_dependent_ports.specified
+ echo "----------------------------------------"
+ echo "and their dependents;"
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_required_ports.specified
+ echo "----------------------------------------"
+ echo "and their requirements."
+ echo
+ elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ]
+ then
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_dependent_ports.specified
+ echo "----------------------------------------"
+ echo "and their dependents."
+ echo
+ elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ]
+ then
+ echo "----------------------------------------"
+ cat "${DBDIR}"/target_required_ports.specified
+ echo "----------------------------------------"
+ echo "and their requirements."
+ echo
+ else
+ echo "ERROR: Target ports are specified but none of them is valid." >&2
+ exit 1
fi
- touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS"
fi
# Parse configuration file
expand_glob_pattern_to_origins "$glob_pattern" yes > ${TMPDIR}/origins.2.tmp || :
if [ `cat "${TMPDIR}/origins.2.tmp" | wc -l` -eq 0 ]
then
- echo "WARN: Original package to be replaced [$glob_pattern] is obsolete." >&2
+ echo "WARNING: Original package to be replaced [$glob_pattern] is obsolete." >&2
echo " If still required, use a pattern for port origins instead." >&2
continue
fi
then
to=
else
- [ -d "${PORTSDIR}/$to" ] || echo "WARN: replacement port [$to] is obsolete" >&2
+ [ -d "${PORTSDIR}/$to" ] || echo "WARNING: replacement port [$to] is obsolete" >&2
fi
str_escape_regexp_filter < ${TMPDIR}/origins.2.tmp | sed "s|^|s:^|; s|$|$:$to:|" >> ${DBDIR}/REPLACE.replace_pattern.conflist
done
sort -u "${DBDIR}/target_dependent_ports.specified" "${DBDIR}/target_required_ports.specified" | add_lines_if_new "${DBDIR}"/target_ports.new
if [ `cat "${DBDIR}/target_ports" | wc -l` -ne `cat "${DBDIR}/target_ports.new" | wc -l` ]
then
- echo "WARN: The temporal database will be refreshed so as to reinstall the all failed ports and their dependents."
+ echo "WARNING: The temporal database will be refreshed so as to reinstall the all failed ports and their dependents."
rm -f "${DBDIR}/COMPLETE_COLLECED_ALL_DEPENDENCIES" \
"${DBDIR}/COMPLETE_DISTFILES_LIST" \
"${DBDIR}/COMPLETE_CONVERT_REQUIRES_LIST" \
rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
continue
fi
+ if [ -e "${DBDIR}/requires/$origin/SUPPRESSED" ]
+ then
+ echo "========== $counter (Skipping a suppressed port $position_msg as success at `timestamp`) =========="
+ cat ${TMPDIR}/msg_if_target
+ echo
+ rm_a_line "$origin" "${DBDIR}/reinst_todo.list"
+ continue
+ fi
if [ -e "${DBDIR}/requires/$origin/installed_version" ]
then
insttarget=reinstall
fi
if [ -e "${DBDIR}/requires/$origin/status/FAILED_FETCH" ]
then
- echo "WARN: Refetching distfiles for ${PORTSDIR}/$position_msg." >&2
+ echo "WARNING: Refetching distfiles for ${PORTSDIR}/$position_msg." >&2
# if [ ! -e "${DBDIR}/requires/$origin/status/COMPLETE.FAILED_FETCH.DISTCLEAN" ]
# then
# env ${MAKE_ENVS} make distclean NOCLEANDEPENDS=yes ${MAKE_ARGS} || \
pkg_create -b "$currentpkg" || \
{
rm -f "${DBDIR}/backup_failure/$currentpkg.tbz"
- echo "WARN: Failed to create the backup package, but ignored by hoping success." >&2
+ echo "WARNING: Failed to create the backup package, but ignored by hoping success." >&2
}
cd "${PORTSDIR}/$origin"
touch "${DBDIR}/requires/$origin/status/COMPLETE_PKG_BACKUP"
then
pkg_delete -f $currentpkg || \
{
- echo "WARN: Failed to deinstall $currentpkg by pkg_delete." >&2
+ echo "WARNING: Failed to deinstall $currentpkg by pkg_delete." >&2
}
echo "-- (Trying to deinstall by ports to make sure. This usually ends up with warnings.)"
env ${MAKE_ENVS} make deinstall ${MAKE_ARGS} || \
{
- echo "WARN: Failed to deinstall $currentpkg by make deinstall." >&2
+ echo "WARNING: Failed to deinstall $currentpkg by make deinstall." >&2
}
touch "${DBDIR}/requires/$origin/status/COMPLETE_DEINSTALL"
fi
echo "*** Restoring the backup..."
if [ -e "${DBDIR}/backup_failure/$currentpkg.tbz" ]
then
- echo "WARN: No backup exists, gave up." >&2
+ echo "WARNING: No backup exists, gave up." >&2
elif pkg_add -fF "${DBDIR}/backup_failure/$currentpkg.tbz"
then
:
else
- echo "WARN: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
+ echo "WARNING: Failed to restore $currentpkg. Note that your system may experience troubles by this error." >&2
fi
fi
touch "${DBDIR}/requires/$origin/status/COMPETE.FAILED_INSTALL.RECOVER"
then
env ${MAKE_ENVS} make clean ${MAKE_ARGS} || \
{
- echo "WARN: Failed to clean $position_msg." >&2
+ echo "WARNING: Failed to clean $position_msg." >&2
}
touch "${DBDIR}/requires/$origin/status/COMPLETE_CLEAN_AFTER_INSTALL"
fi