rewrite a GNU-ism for sed -E and get rid of gsed dependency; ok sthen@

This commit is contained in:
naddy 2009-08-07 19:43:36 +00:00
parent d90651532f
commit 2c816d096b
2 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2009/06/25 22:45:56 sthen Exp $
# $OpenBSD: Makefile,v 1.7 2009/08/07 19:43:36 naddy Exp $
COMMENT-main = little brother's database, email address query tools
COMMENT-ldap = LDAP support for little brother's database
@ -7,8 +7,8 @@ VERSION = 0.36
DISTNAME = lbdb_${VERSION}
# bump all subpackages together
PKGNAME-main = lbdb-${VERSION}p2
PKGNAME-ldap = lbdb-ldap-${VERSION}p2
PKGNAME-main = lbdb-${VERSION}p3
PKGNAME-ldap = lbdb-ldap-${VERSION}p3
CATEGORIES = databases mail
@ -22,7 +22,6 @@ PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
RUN_DEPENDS-main = ::textproc/gsed
RUN_DEPENDS-ldap = ::databases/p5-ldap \
:${FULLPKGNAME-main}:databases/lbdb

View File

@ -1,14 +1,18 @@
$OpenBSD: patch-m_muttalias_sh_in,v 1.2 2009/06/25 22:45:56 sthen Exp $
--- m_muttalias.sh.in.orig Thu Jun 25 22:00:49 2009
+++ m_muttalias.sh.in Thu Jun 25 22:05:14 2009
@@ -34,8 +34,8 @@ m_muttalias_query()
$OpenBSD: patch-m_muttalias_sh_in,v 1.3 2009/08/07 19:43:36 naddy Exp $
--- m_muttalias.sh.in.orig Sun May 27 10:42:22 2007
+++ m_muttalias.sh.in Fri Aug 7 16:12:17 2009
@@ -34,10 +34,10 @@ m_muttalias_query()
if [ -f "$file" ]
then
grep -ia "$@" $file \
- | grep -a '^alias[ ][ ]*[^,][^,]*[ ][ ]*\([^,]\|\\\".*\\\"\)*$' \
- | sed -e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*<\([^ >][^ >]*\)>[ ][ ]*(\([^<>()]*\))[^()<>]*$/\2 \3 alias \1/' \
- -e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*\(\\\".*\\\"[^<>()]*\|[^<>()]*\)<\([^<>()]*\)>[^<>]*$/\3 \2 alias \1/' \
- -e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*\([^<>()]*\)(\(\\\".*\\\"[^<>()]*\|[^<>()]*\))[^()<>]*$/\2 \3 alias \1/' \
+ | grep -Ea '^alias[ ][ ]*[^,][^,]*[ ][ ]*([^,]|\\\".*\\\")*$' \
+ | gsed -e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*<\([^ >][^ >]*\)>[ ][ ]*(\([^<>()]*\))[^()<>]*$/\2 \3 alias \1/' \
-e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*\(\\\".*\\\"[^<>()]*\|[^<>()]*\)<\([^<>()]*\)>[^<>]*$/\3 \2 alias \1/' \
-e 's/^alias[ ][ ]*\([^ ][^ ]*\)[ ][ ]*\([^<>()]*\)(\(\\\".*\\\"[^<>()]*\|[^<>()]*\))[^()<>]*$/\2 \3 alias \1/' \
+ | sed -E -e 's/^alias[ ][ ]*([^ ][^ ]*)[ ][ ]*<([^ >][^ >]*)>[ ][ ]*\(([^<>()]*)\)[^()<>]*$/\2 \3 alias \1/' \
+ -e 's/^alias[ ][ ]*([^ ][^ ]*)[ ][ ]*(\\\".*\\\"[^<>()]*|[^<>()]*)<([^<>()]*)>[^<>]*$/\3 \2 alias \1/' \
+ -e 's/^alias[ ][ ]*([^ ][^ ]*)[ ][ ]*([^<>()]*)\((\\\".*\\\"[^<>()]*|[^<>()]*)\)[^()<>]*$/\2 \3 alias \1/' \
-e 's/\\\"//g' \
| grep -va '^alias[ ][ ]*[^,][^,]*[ ][ ]*[^,]*$'
fi