From 317225ba9d6a892a332b47602abe2b6f2ef74657 Mon Sep 17 00:00:00 2001 From: Mamoru Sakaue / MwGhennndo Date: Wed, 1 Aug 2012 07:02:12 +0900 Subject: [PATCH] Messages for target-only operations are revised. modified: portsreinstall modified: portsreinstall.8 modified: portsreinstall.8~ modified: portsreinstall~ --- portsreinstall | 61 +++++++++++++++++++++++++++++-------------------------- portsreinstall.8 | 4 ++-- portsreinstall.8~ | 4 ++-- portsreinstall~ | 61 +++++++++++++++++++++++++++++-------------------------- 4 files changed, 68 insertions(+), 62 deletions(-) diff --git a/portsreinstall b/portsreinstall index b787b0f..b427ed0 100755 --- a/portsreinstall +++ b/portsreinstall @@ -10,7 +10,7 @@ # ================================================ APPNAME=`basename $0` -MYVERSION=1.1.0+toward_1.2.0_20120731060658 +MYVERSION=1.1.0+toward_1.2.0_20120801065617 PREFIX=${PREFIX:-/usr/local} CONFFILE=${PREFIX}/etc/${APPNAME}.conf @@ -1358,35 +1358,38 @@ then 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 [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ] + if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ] then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_dependent_ports.specified - echo "----------------------------------------" - echo "nor their dependents, and irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_required_ports.specified - echo "----------------------------------------" - echo "nor their requirements are skipped." - elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ] - then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_dependent_ports.specified - echo "----------------------------------------" - echo "nor their dependents are skipped." - elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ] - then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_required_ports.specified - echo "----------------------------------------" - echo "nor their requirements are skipped." - elif [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ] - then - echo "ERROR: Target ports are specified but none of them is valid." >&2 - exit 1 + 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 fi touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" fi diff --git a/portsreinstall.8 b/portsreinstall.8 index a72b00f..169b5e8 100644 --- a/portsreinstall.8 +++ b/portsreinstall.8 @@ -263,7 +263,7 @@ Configuration file of portupgrade(1). .SH HISTORY \fBportsreinstall\fR has been developed as below. .TP -1.2.0 (31 July 2012) +1.2.0 (1 August 2012) [BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add). [CHANGE] 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. @@ -272,7 +272,7 @@ Configuration file of portupgrade(1). [CHANGE] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished. -[CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled. +[CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled. [NEW] Commands of \fBshow requirements\fR and \fBshow dependents\fR are added. .TP diff --git a/portsreinstall.8~ b/portsreinstall.8~ index a1a54c5..c5b6361 100644 --- a/portsreinstall.8~ +++ b/portsreinstall.8~ @@ -263,7 +263,7 @@ Configuration file of portupgrade(1). .SH HISTORY \fBportsreinstall\fR has been developed as below. .TP -1.2.0 (29 July 2012) +1.2.0 (31 July 2012) [BUG FIX] Termination message is corrected (portsreinstall ok => portsreinstall ok add). [CHANGE] 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. @@ -272,7 +272,7 @@ Configuration file of portupgrade(1). [CHANGE] Use of commas as delimiters in \fBok\fR and \fBtaboo\fR commands is abolished. -[CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled. +[CHANGE] The specification of \fBshow\fR command is changed to exclude irrelevant packages/ports and output messages about the matching targets when options \fB\-r\fR, \fB\-R\fR, \fB\-t\fR and \fB\-T\fR are enabled. [NEW] Commands of \fBshow requirements\fR and \fBshow dependents\fR are added. .TP diff --git a/portsreinstall~ b/portsreinstall~ index 3b2397a..846058c 100755 --- a/portsreinstall~ +++ b/portsreinstall~ @@ -10,7 +10,7 @@ # ================================================ APPNAME=`basename $0` -MYVERSION=1.1.0+toward_1.2.0_20120731055210 +MYVERSION=1.1.0+toward_1.2.0_20120801061104 PREFIX=${PREFIX:-/usr/local} CONFFILE=${PREFIX}/etc/${APPNAME}.conf @@ -1358,35 +1358,38 @@ then 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 [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 -a `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ] + if [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ] then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_dependent_ports.specified - echo "----------------------------------------" - echo "nor their dependents, and irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_required_ports.specified - echo "----------------------------------------" - echo "nor their requirements are skipped." - elif [ `cat "${DBDIR}"/target_dependent_ports.specified | wc -l` -gt 0 ] - then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_dependent_ports.specified - echo "----------------------------------------" - echo "nor their dependents are skipped." - elif [ `cat "${DBDIR}"/target_required_ports.specified | wc -l` -gt 0 ] - then - echo "INFO: Ports/packages irrelevant to" - echo "----------------------------------------" - cat "${DBDIR}"/target_required_ports.specified - echo "----------------------------------------" - echo "nor their requirements are skipped." - elif [ -n "$target_dependent_ports$target_dependent_ports_form2$target_required_ports$target_required_ports_form2" ] - then - echo "ERROR: Target ports are specified but none of them is valid." >&2 - exit 1 + 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 fi touch "${DBDIR}/COMPLETE_PARSE_OPTION_TARGET_PORTS" fi -- 2.11.0