Bug 63314 - fix shells/bash-completion hard coded paths for postfix completion
Summary: fix shells/bash-completion hard coded paths for postfix completion
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-24 19:00 UTC by Toni Viemerö
Modified: 2004-06-05 15:55 UTC (History)
0 users

See Also:


Attachments
file.diff (1.70 KB, patch)
2004-02-24 19:00 UTC, Toni Viemerö
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Viemerö 2004-02-24 19:00:31 UTC
	bash-completion has hard coded lines for Postfix completion which
	assumes Postfix is installed PREFIX=/usr
	Fix paths for FreeBSD PREFIX=/usr/local

Fix: Add files/patch-ab
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2004-02-25 08:18:00 UTC
State Changed
From-To: open->feedback

To which port does this apply?  shells/bash2?
Comment 2 Toni Viemerö 2004-02-25 08:22:45 UTC
shells/bash-completion

-- 
Toni Viemerö
http://selfdestruct.net/
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2004-02-25 08:32:35 UTC
State Changed
From-To: feedback->open

Feedback received, synopsis updated.
Comment 4 Kirill Ponomarev freebsd_committer freebsd_triage 2004-02-28 21:24:07 UTC
Hi,

On Tue, Feb 24, 2004 at 08:52:12PM +0200, Toni Viemero wrote:
> 
> >Number:         63314
> >Category:       ports
> >Synopsis:       fix bash-completion hard coded paths for postfix completion
> >Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    freebsd-ports-bugs
> >State:          open


Could you please review this PR ?

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/63314

-Kirill
Comment 5 Kirill Ponomarev freebsd_committer freebsd_triage 2004-02-28 21:24:19 UTC
State Changed
From-To: open->feedback

Asked for maintainer's feedback.
Comment 6 Kirk Strauser 2004-02-29 02:46:23 UTC
At 2004-02-28T21:24:07Z, Kirill Ponomarew <krion@FreeBSD.org> writes:

> Hi,
>
> On Tue, Feb 24, 2004 at 08:52:12PM +0200, Toni Viemero wrote:
>> 
>> >Number:         63314
>> >Category:       ports
>> >Synopsis:       fix bash-completion hard coded paths for postfix completion
>> >Confidential:   no
>> >Severity:       serious
>> >Priority:       medium
>> >Responsible:    freebsd-ports-bugs
>> >State:          open
>
> Could you please review this PR ?
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/63314
>
> -Kirill


The patch assumes (not unreasonably) that the user has installed the
mail/postfix port with $PREFIX==/usr/local .  While it would correct the
hardcoded paths for the majority of users, it would break the config for
installations directly into /usr.

Also, it adds new hardcoded paths to /usr/local/bin/mailq.  I use Sendmail
From the base installation, so I don't have experience with
/usr/sbin/mailwrapper, but wasn't it designed to avoid having to call each
mailer's binaries directly?
-- 
Kirk Strauser
Comment 7 Toni Viemerö 2004-03-06 23:29:16 UTC
Here's the updated files/patch-aa with hard coded paths removed, since
bash_completion uses $PATH nicely. User needs to have /whatever/sbin 
in his/her $PATH, but usually sysadmins do, as the Postfix completions
used by bash-completion are (usually) admin-only.

Also mailq is indeed link to mailwrapper, which uses Postfix mailq when
Postfix is configured as default MTA in /etc/mail/mailer.conf.

--- bash_completion.org	Sun Feb 15 05:45:21 2004
+++ bash_completion	Sun Mar  7 01:13:59 2004
@@ -31,14 +31,14 @@
 if [ -n "${FUNCNAME:-}" ]; then
 	# we're being sourced from within a function, so we can't use
 	# 'declare', as this will create local variables within a function
-	BASH_COMPLETION=${BASH_COMPLETION:-/etc/bash_completion} 2>/dev/null
-	BASH_COMPLETION_DIR=${BASH_COMPLETION_DIR:=/etc/bash_completion.d} \
+	BASH_COMPLETION=${BASH_COMPLETION:-/usr/local/etc/bash_completion} 2>/dev/null
+	BASH_COMPLETION_DIR=${BASH_COMPLETION_DIR:=/usr/local/etc/bash_completion.d} \
 	  2>/dev/null
 else
-	declare -r BASH_COMPLETION=${BASH_COMPLETION:-/etc/bash_completion} \
+	declare -r BASH_COMPLETION=${BASH_COMPLETION:-/usr/local/etc/bash_completion} \
 	  2>/dev/null
 	declare -r \
-	  BASH_COMPLETION_DIR=${BASH_COMPLETION_DIR:=/etc/bash_completion.d} \
+	  BASH_COMPLETION_DIR=${BASH_COMPLETION_DIR:=/usr/local/etc/bash_completion.d} \
 	  2>/dev/null
 fi
 
@@ -1050,7 +1050,7 @@
 	else
 		len=${#cur}
 		idx=0
-		for pval in $( /usr/sbin/postconf -m ); do
+		for pval in $( postconf -m ); do
 			if [[ "$cur" == "${pval:0:$len}" ]]; then
 				COMPREPLY[$idx]="$pval:"
 				idx=$(($idx+1))
@@ -1126,7 +1126,7 @@
 	fi
 	len=${#cur}
 	idx=0
-	for pval in $( /usr/sbin/postconf | cut -d ' ' -f 1 ); do
+	for pval in $( postconf | cut -d ' ' -f 1 ); do
 		if [[ "$cur" == "${pval:0:$len}" ]]; then
 			COMPREPLY[$idx]="$pval$eqext"
 			idx=$(($idx+1))
Comment 8 Pav Lucistnik freebsd_committer freebsd_triage 2004-05-02 18:53:16 UTC
Kirk, do you agree with the updated patch-aa as seen at
http://www.freebsd.org/cgi/query-pr.cgi?q=63314
dated Sun 7 Mar 2004 01:29:16 ?

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Cats happen.
Comment 9 Pav Lucistnik freebsd_committer freebsd_triage 2004-06-05 15:55:47 UTC
State Changed
From-To: feedback->closed

Committed, thanks!