Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Raf Czlonka
Updated diff below.

cvs server: Diffing databases/lbdb
Index: databases/lbdb/Makefile
===
RCS file: /cvs/ports/databases/lbdb/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- databases/lbdb/Makefile 29 Apr 2016 11:03:43 -  1.19
+++ databases/lbdb/Makefile 12 Jul 2018 03:11:14 -
@@ -4,6 +4,7 @@ COMMENT-main =  "little brother's databa
 COMMENT-ldap = LDAP support for lbdb
 
 VERSION =  0.40
+REVISION-main =0
 
 DISTNAME = lbdb_${VERSION}
 PKGNAME-main = lbdb-${VERSION}
@@ -11,32 +12,34 @@ PKGNAME-ldap =  lbdb-ldap-${VERSION}
 
 CATEGORIES =   databases mail
 
-HOMEPAGE = http://www.spinnaker.de/lbdb/
+HOMEPAGE = https://www.spinnaker.de/lbdb/
 
 MULTI_PACKAGES =   -main -ldap
 
 # GPLv2+
 PERMIT_PACKAGE_CDROM = Yes
 
+WANTLIB-main = c iconv
+
+MASTER_SITES = https://www.spinnaker.de/lbdb/download/
+
+BUILD_DEPENDS =${RUN_DEPENDS-main}
+LIB_DEPENDS-main = converters/libiconv
+RUN_DEPENDS-main = mail/abook
 RUN_DEPENDS-ldap = databases/p5-ldap \
databases/lbdb
 
-LIB_DEPENDS-main = converters/libiconv
-WANTLIB-main = c iconv
 LIB_DEPENDS-ldap =
 WANTLIB-ldap =
 
-MASTER_SITES = http://www.spinnaker.de/debian/
-
 MAKE_ENV = install_prefix=${WRKINST}
 
 NO_TEST =  Yes
 USE_GMAKE =Yes
 CONFIGURE_STYLE =  gnu
 
-CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
+CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
--with-libiconv-prefix=${LOCALBASE} \
-   --without-abook \
--without-addr-email \
--without-niscat \
--without-gpg \
cvs server: Diffing databases/lbdb/patches
Index: databases/lbdb/patches/patch-m_abook_sh_in
===
RCS file: databases/lbdb/patches/patch-m_abook_sh_in
diff -N databases/lbdb/patches/patch-m_abook_sh_in
--- /dev/null   1 Jan 1970 00:00:00 -
+++ databases/lbdb/patches/patch-m_abook_sh_in  12 Jul 2018 03:11:14 -
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: m_abook.sh.in
+--- m_abook.sh.in.orig
 m_abook.sh.in
+@@ -33,7 +33,7 @@ m_abook_query()
+   if [ -f "$book" ]
+   then
+   $ABOOK --datafile $book --mutt-query "$@" \
+-  | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
++  | sed -e '1d;s/\([^ ]*  [^  ]*\).*/\1   abook/'
+   fi
+   done
+ fi
cvs server: Diffing databases/lbdb/pkg
Index: databases/lbdb/pkg/PLIST-main
===
RCS file: /cvs/ports/databases/lbdb/pkg/PLIST-main,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST-main
--- databases/lbdb/pkg/PLIST-main   15 Jun 2008 07:22:57 -  1.1.1.1
+++ databases/lbdb/pkg/PLIST-main   12 Jul 2018 03:11:14 -
@@ -8,6 +8,7 @@ lib/lbdb/
 lib/lbdb/lbdb-munge
 lib/lbdb/lbdb_bbdb_query.el
 lib/lbdb/lbdb_lib
+lib/lbdb/m_abook
 lib/lbdb/m_bbdb
 lib/lbdb/m_fido
 lib/lbdb/m_finger



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Raf Czlonka
On Wed, Jul 11, 2018 at 12:15:39PM BST, Stuart Henderson wrote:
> On 2018/07/11 12:11, Raf Czlonka wrote:
> > On Wed, Jul 11, 2018 at 10:26:42AM BST, Stuart Henderson wrote:
> > > On 2018/07/11 10:15, Raf Czlonka wrote:
> > > > On Wed, Jul 11, 2018 at 09:24:56AM BST, Stuart Henderson wrote:
> > > > > On 2018/07/07 23:00, Raf Czlonka wrote:
> > > > > > On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > > > > > > [...]
> > > > > > > +BUILD_DEPENDS =  ${RUN_DEPENDS-main}
> > > > > > > +LIB_DEPENDS-main =   converters/libiconv
> > > > > > > +RUN_DEPENDS-main =   mail/abook
> > > > > > 
> > > > > > There's not need for abook to be a run dependency - m_abook module
> > > > > > is only usable if it is both specified in METHODS *and* abook
> > > > > > executable present, ignored otherwise.
> > > > > 
> > > > > It's a really small dependency though, and the only extra thing it 
> > > > > pulls
> > > > > in is gettext which mutt users will have anyway, so I don't see a lot 
> > > > > of point
> > > > > in /not/ including it, it does make things more consistent.
> > > > 
> > > > Sure - however, I was thinking ahead.
> > > > 
> > > > I.e., the latest version of lbdb has goobook[0] and khard[1] modules.
> > > > Personally, I don't think each and every program which *enhances*
> > > > lbdb, should be a hard dependency.  Even in Debian all of these are
> > > > only *suggested* packages[2].  Personally, I don't even think that
> > > > the -ldap flavor is necessary - a pkg-readme with all the optional
> > > > packages, i.e.:
> > > > 
> > > > - Net::LDAP
> > > > - abook
> > > > - goobook
> > > > - khard, which would pull vdirsyncer
> > > > - ...
> > > > 
> > > > would suffice, IMO.
> > > > 
> > > > This would:
> > > > 
> > > > - remove the need for hard dependencies so no extra software, which
> > > >   otherwise would potentially not have been used, needs to be
> > > >   installed
> > > > 
> > > > - if LDAP support is "merged" to the main flavor, there's one less
> > > >   flavor to maintain
> > > > 
> > > > - any additional *enhancement* are added to the readme
> > > > 
> > > > It somehow feels simpler and easier.
> > > > 
> > > > Otherwise we'll end up with two packages, where they pull 3-4
> > > > additional programs and the only difference is that one pull an an
> > > > extra Perl module.
> > > > 
> > > > Don't some ports already do just that?
> > > > 
> > > > Or we go the other way and each and we add each and every of these as
> > > > hard dependencies but the chain grows...
> > > > 
> > > > Anyway, food for thought :^)
> > > 
> > > -ldap is a multi package rather than a flavour, it contains only the
> > > additional files produced when ldap is enabled rather than being an
> > > "either/or" thing.
> > > 
> > > The usual procedure with "modular" ports using multi packages is to
> > > include things with lightweight/no extra dependencies directly in the
> > > main package, and place things with heavier dependencies in a subpackage.
> > > 
> > > > [0] https://pypi.org/project/goobook/
> > > > [1] https://github.com/scheibler/khard
> > > > [2] https://packages.debian.org/sid/lbdb
> > > 
> > > I think these would be good candidates for additional multi packages.
> > > While we *could* merge them into the main package and add a README telling
> > > people how to actually use them, it's a lot more convenient for the user
> > > to just run pkg_add once.
> > > 
> > > It's a pain to have a proliferation of flavours as they have to be tested
> > > separately. Multi packages are simple in this respect, there's only a 
> > > single
> > > build run, it produces the same resulting set of packages every time, and
> > > if you're working from ports and want to install the whole lot you can 
> > > just
> > > do "make install-all".
> > 
> > Right - confusion between flavor and multi-package on my part. Sorry
> > for the noise.
> > 
> > In that case, would the extra subpackages be -abook, -goobook,
> > -khard, i.e. so that an individual using one or two of these, doesn't
> > have to pull dependencies for all of them?
> > 
> > R.
> 
> -abook is such a lightweight dependency I don't think it's worth making
> it a separate package.
> 
> If adding -goobook and -khard they are a bit heavier, so splitting them
> would make sense to me.

It's the one I use so fine by me :^)

R.



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Stuart Henderson
On 2018/07/11 12:11, Raf Czlonka wrote:
> On Wed, Jul 11, 2018 at 10:26:42AM BST, Stuart Henderson wrote:
> > On 2018/07/11 10:15, Raf Czlonka wrote:
> > > On Wed, Jul 11, 2018 at 09:24:56AM BST, Stuart Henderson wrote:
> > > > On 2018/07/07 23:00, Raf Czlonka wrote:
> > > > > On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > > > > > [...]
> > > > > > +BUILD_DEPENDS =${RUN_DEPENDS-main}
> > > > > > +LIB_DEPENDS-main = converters/libiconv
> > > > > > +RUN_DEPENDS-main = mail/abook
> > > > > 
> > > > > There's not need for abook to be a run dependency - m_abook module
> > > > > is only usable if it is both specified in METHODS *and* abook
> > > > > executable present, ignored otherwise.
> > > > 
> > > > It's a really small dependency though, and the only extra thing it pulls
> > > > in is gettext which mutt users will have anyway, so I don't see a lot 
> > > > of point
> > > > in /not/ including it, it does make things more consistent.
> > > 
> > > Sure - however, I was thinking ahead.
> > > 
> > > I.e., the latest version of lbdb has goobook[0] and khard[1] modules.
> > > Personally, I don't think each and every program which *enhances*
> > > lbdb, should be a hard dependency.  Even in Debian all of these are
> > > only *suggested* packages[2].  Personally, I don't even think that
> > > the -ldap flavor is necessary - a pkg-readme with all the optional
> > > packages, i.e.:
> > > 
> > > - Net::LDAP
> > > - abook
> > > - goobook
> > > - khard, which would pull vdirsyncer
> > > - ...
> > > 
> > > would suffice, IMO.
> > > 
> > > This would:
> > > 
> > > - remove the need for hard dependencies so no extra software, which
> > >   otherwise would potentially not have been used, needs to be
> > >   installed
> > > 
> > > - if LDAP support is "merged" to the main flavor, there's one less
> > >   flavor to maintain
> > > 
> > > - any additional *enhancement* are added to the readme
> > > 
> > > It somehow feels simpler and easier.
> > > 
> > > Otherwise we'll end up with two packages, where they pull 3-4
> > > additional programs and the only difference is that one pull an an
> > > extra Perl module.
> > > 
> > > Don't some ports already do just that?
> > > 
> > > Or we go the other way and each and we add each and every of these as
> > > hard dependencies but the chain grows...
> > > 
> > > Anyway, food for thought :^)
> > 
> > -ldap is a multi package rather than a flavour, it contains only the
> > additional files produced when ldap is enabled rather than being an
> > "either/or" thing.
> > 
> > The usual procedure with "modular" ports using multi packages is to
> > include things with lightweight/no extra dependencies directly in the
> > main package, and place things with heavier dependencies in a subpackage.
> > 
> > > [0] https://pypi.org/project/goobook/
> > > [1] https://github.com/scheibler/khard
> > > [2] https://packages.debian.org/sid/lbdb
> > 
> > I think these would be good candidates for additional multi packages.
> > While we *could* merge them into the main package and add a README telling
> > people how to actually use them, it's a lot more convenient for the user
> > to just run pkg_add once.
> > 
> > It's a pain to have a proliferation of flavours as they have to be tested
> > separately. Multi packages are simple in this respect, there's only a single
> > build run, it produces the same resulting set of packages every time, and
> > if you're working from ports and want to install the whole lot you can just
> > do "make install-all".
> 
> Right - confusion between flavor and multi-package on my part. Sorry
> for the noise.
> 
> In that case, would the extra subpackages be -abook, -goobook,
> -khard, i.e. so that an individual using one or two of these, doesn't
> have to pull dependencies for all of them?
> 
> R.

-abook is such a lightweight dependency I don't think it's worth making
it a separate package.

If adding -goobook and -khard they are a bit heavier, so splitting them
would make sense to me.



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Raf Czlonka
On Wed, Jul 11, 2018 at 10:26:42AM BST, Stuart Henderson wrote:
> On 2018/07/11 10:15, Raf Czlonka wrote:
> > On Wed, Jul 11, 2018 at 09:24:56AM BST, Stuart Henderson wrote:
> > > On 2018/07/07 23:00, Raf Czlonka wrote:
> > > > On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > > > > [...]
> > > > > +BUILD_DEPENDS =  ${RUN_DEPENDS-main}
> > > > > +LIB_DEPENDS-main =   converters/libiconv
> > > > > +RUN_DEPENDS-main =   mail/abook
> > > > 
> > > > There's not need for abook to be a run dependency - m_abook module
> > > > is only usable if it is both specified in METHODS *and* abook
> > > > executable present, ignored otherwise.
> > > 
> > > It's a really small dependency though, and the only extra thing it pulls
> > > in is gettext which mutt users will have anyway, so I don't see a lot of 
> > > point
> > > in /not/ including it, it does make things more consistent.
> > 
> > Sure - however, I was thinking ahead.
> > 
> > I.e., the latest version of lbdb has goobook[0] and khard[1] modules.
> > Personally, I don't think each and every program which *enhances*
> > lbdb, should be a hard dependency.  Even in Debian all of these are
> > only *suggested* packages[2].  Personally, I don't even think that
> > the -ldap flavor is necessary - a pkg-readme with all the optional
> > packages, i.e.:
> > 
> > - Net::LDAP
> > - abook
> > - goobook
> > - khard, which would pull vdirsyncer
> > - ...
> > 
> > would suffice, IMO.
> > 
> > This would:
> > 
> > - remove the need for hard dependencies so no extra software, which
> >   otherwise would potentially not have been used, needs to be
> >   installed
> > 
> > - if LDAP support is "merged" to the main flavor, there's one less
> >   flavor to maintain
> > 
> > - any additional *enhancement* are added to the readme
> > 
> > It somehow feels simpler and easier.
> > 
> > Otherwise we'll end up with two packages, where they pull 3-4
> > additional programs and the only difference is that one pull an an
> > extra Perl module.
> > 
> > Don't some ports already do just that?
> > 
> > Or we go the other way and each and we add each and every of these as
> > hard dependencies but the chain grows...
> > 
> > Anyway, food for thought :^)
> 
> -ldap is a multi package rather than a flavour, it contains only the
> additional files produced when ldap is enabled rather than being an
> "either/or" thing.
> 
> The usual procedure with "modular" ports using multi packages is to
> include things with lightweight/no extra dependencies directly in the
> main package, and place things with heavier dependencies in a subpackage.
> 
> > [0] https://pypi.org/project/goobook/
> > [1] https://github.com/scheibler/khard
> > [2] https://packages.debian.org/sid/lbdb
> 
> I think these would be good candidates for additional multi packages.
> While we *could* merge them into the main package and add a README telling
> people how to actually use them, it's a lot more convenient for the user
> to just run pkg_add once.
> 
> It's a pain to have a proliferation of flavours as they have to be tested
> separately. Multi packages are simple in this respect, there's only a single
> build run, it produces the same resulting set of packages every time, and
> if you're working from ports and want to install the whole lot you can just
> do "make install-all".

Right - confusion between flavor and multi-package on my part. Sorry
for the noise.

In that case, would the extra subpackages be -abook, -goobook,
-khard, i.e. so that an individual using one or two of these, doesn't
have to pull dependencies for all of them?

R.



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Stuart Henderson
On 2018/07/11 10:15, Raf Czlonka wrote:
> On Wed, Jul 11, 2018 at 09:24:56AM BST, Stuart Henderson wrote:
> > On 2018/07/07 23:00, Raf Czlonka wrote:
> > > On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > > > [...]
> > > >
> > > > +MASTER_SITES = http://www.spinnaker.de/debian/
> > 
> > Oh this is a redirect to https now, might as well change that and avoid
> > the extra roundtrip.
> 
> Shouldn't we change it to https://www.spinnaker.de/lbdb/download/ ?
> 
> debian -> lbdb feels more "intuitive", for a lack of a better word.

yep.

> > > > +BUILD_DEPENDS =${RUN_DEPENDS-main}
> > > > +LIB_DEPENDS-main = converters/libiconv
> > > > +RUN_DEPENDS-main = mail/abook
> > > 
> > > There's not need for abook to be a run dependency - m_abook module
> > > is only usable if it is both specified in METHODS *and* abook
> > > executable present, ignored otherwise.
> > 
> > It's a really small dependency though, and the only extra thing it pulls
> > in is gettext which mutt users will have anyway, so I don't see a lot of 
> > point
> > in /not/ including it, it does make things more consistent.
> 
> Sure - however, I was thinking ahead.
> 
> I.e., the latest version of lbdb has goobook[0] and khard[1] modules.
> Personally, I don't think each and every program which *enhances*
> lbdb, should be a hard dependency.  Even in Debian all of these are
> only *suggested* packages[2].  Personally, I don't even think that
> the -ldap flavor is necessary - a pkg-readme with all the optional
> packages, i.e.:
> 
> - Net::LDAP
> - abook
> - goobook
> - khard, which would pull vdirsyncer
> - ...
> 
> would suffice, IMO.
> 
> This would:
> 
> - remove the need for hard dependencies so no extra software, which
>   otherwise would potentially not have been used, needs to be
>   installed
> 
> - if LDAP support is "merged" to the main flavor, there's one less
>   flavor to maintain
> 
> - any additional *enhancement* are added to the readme
> 
> It somehow feels simpler and easier.
> 
> Otherwise we'll end up with two packages, where they pull 3-4
> additional programs and the only difference is that one pull an an
> extra Perl module.
> 
> Don't some ports already do just that?
> 
> Or we go the other way and each and we add each and every of these as
> hard dependencies but the chain grows...
> 
> Anyway, food for thought :^)

-ldap is a multi package rather than a flavour, it contains only the
additional files produced when ldap is enabled rather than being an
"either/or" thing.

The usual procedure with "modular" ports using multi packages is to
include things with lightweight/no extra dependencies directly in the
main package, and place things with heavier dependencies in a subpackage.

> [0] https://pypi.org/project/goobook/
> [1] https://github.com/scheibler/khard
> [2] https://packages.debian.org/sid/lbdb

I think these would be good candidates for additional multi packages.
While we *could* merge them into the main package and add a README telling
people how to actually use them, it's a lot more convenient for the user
to just run pkg_add once.

It's a pain to have a proliferation of flavours as they have to be tested
separately. Multi packages are simple in this respect, there's only a single
build run, it produces the same resulting set of packages every time, and
if you're working from ports and want to install the whole lot you can just
do "make install-all".

> 
> > > Now, the main issue. The m_abook module doesn't work properly due
> > > to tab escape sequences (\t) being used in sed regexes - something
> > > sed(1) in base does not cope well with.
> > > 
> > > All that module does is running the below command:
> > > 
> > >   abook --datafile $HOME/.abook/addressbook --mutt-query "$@" \
> > >   | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
> > > 
> > > but, due to the above, based sed(1) cuts the result short on 2nd
> > > 't' in the string, i.e.:
> > > 
> > >   firstname.surn...@example.org   Firstabook
> > > 
> > > or, if the string contains only one 't' or none at all:
> > > 
> > >   first.n...@example.org  My Name tabook
> > > 
> > > It works fine with gsed, which was obviously used when that module
> > > was written/tested, but then gsed would need to become a run
> > > dependency - something I am not keen on.
> > > 
> > > The "easiest" thing to do, would be to patch /usr/local/lib/lbdb/m_abook
> > > and use literal tabs:
> > > 
> > > - | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
> > > + | sed -e '1d;s/\([^ ]*  [^  ]*\).*/\1   abook/'
> > > 
> > > After the above change, it all seems to be working fine.
> > > 
> > > Thanks for looking into it.
> > > 
> > > Raf
> > 
> > Given the existing mess in m_muttalias.sh.in I think that would be ok :)
> 
> That's what I thought :^)
> 
> Thanks,
> 
> Raf
> 



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Raf Czlonka
On Wed, Jul 11, 2018 at 09:24:56AM BST, Stuart Henderson wrote:
> On 2018/07/07 23:00, Raf Czlonka wrote:
> > On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > > [...]
> > >
> > > +MASTER_SITES =   http://www.spinnaker.de/debian/
> 
> Oh this is a redirect to https now, might as well change that and avoid
> the extra roundtrip.

Shouldn't we change it to https://www.spinnaker.de/lbdb/download/ ?

debian -> lbdb feels more "intuitive", for a lack of a better word.

> > > +BUILD_DEPENDS =  ${RUN_DEPENDS-main}
> > > +LIB_DEPENDS-main =   converters/libiconv
> > > +RUN_DEPENDS-main =   mail/abook
> > 
> > There's not need for abook to be a run dependency - m_abook module
> > is only usable if it is both specified in METHODS *and* abook
> > executable present, ignored otherwise.
> 
> It's a really small dependency though, and the only extra thing it pulls
> in is gettext which mutt users will have anyway, so I don't see a lot of point
> in /not/ including it, it does make things more consistent.

Sure - however, I was thinking ahead.

I.e., the latest version of lbdb has goobook[0] and khard[1] modules.
Personally, I don't think each and every program which *enhances*
lbdb, should be a hard dependency.  Even in Debian all of these are
only *suggested* packages[2].  Personally, I don't even think that
the -ldap flavor is necessary - a pkg-readme with all the optional
packages, i.e.:

- Net::LDAP
- abook
- goobook
- khard, which would pull vdirsyncer
- ...

would suffice, IMO.

This would:

- remove the need for hard dependencies so no extra software, which
  otherwise would potentially not have been used, needs to be
  installed

- if LDAP support is "merged" to the main flavor, there's one less
  flavor to maintain

- any additional *enhancement* are added to the readme

It somehow feels simpler and easier.

Otherwise we'll end up with two packages, where they pull 3-4
additional programs and the only difference is that one pull an an
extra Perl module.

Don't some ports already do just that?

Or we go the other way and each and we add each and every of these as
hard dependencies but the chain grows...

Anyway, food for thought :^)

[0] https://pypi.org/project/goobook/
[1] https://github.com/scheibler/khard
[2] https://packages.debian.org/sid/lbdb

> > Now, the main issue. The m_abook module doesn't work properly due
> > to tab escape sequences (\t) being used in sed regexes - something
> > sed(1) in base does not cope well with.
> > 
> > All that module does is running the below command:
> > 
> > abook --datafile $HOME/.abook/addressbook --mutt-query "$@" \
> > | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
> > 
> > but, due to the above, based sed(1) cuts the result short on 2nd
> > 't' in the string, i.e.:
> > 
> > firstname.surn...@example.org   Firstabook
> > 
> > or, if the string contains only one 't' or none at all:
> > 
> > first.n...@example.org  My Name tabook
> > 
> > It works fine with gsed, which was obviously used when that module
> > was written/tested, but then gsed would need to become a run
> > dependency - something I am not keen on.
> > 
> > The "easiest" thing to do, would be to patch /usr/local/lib/lbdb/m_abook
> > and use literal tabs:
> > 
> > -   | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
> > +   | sed -e '1d;s/\([^ ]*  [^  ]*\).*/\1   abook/'
> > 
> > After the above change, it all seems to be working fine.
> > 
> > Thanks for looking into it.
> > 
> > Raf
> 
> Given the existing mess in m_muttalias.sh.in I think that would be ok :)

That's what I thought :^)

Thanks,

Raf



Re: [PATCH] databases/lbdb - enable abook support

2018-07-11 Thread Stuart Henderson
On 2018/07/07 23:00, Raf Czlonka wrote:
> On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> > On 2018/07/06 12:22, Raf Czlonka wrote:
> > > Hi all,
> > > 
> > > Given that abook is in ports, could we have support for it enabled
> > > in lbdb, please?
> > > 
> > > Regards,
> > > 
> > > Raf
> > > 
> > > Index: databases/lbdb/Makefile
> > > ===
> > > RCS file: /cvs/ports/databases/lbdb/Makefile,v
> > > retrieving revision 1.19
> > > diff -u -p -r1.19 Makefile
> > > --- databases/lbdb/Makefile   29 Apr 2016 11:03:43 -  1.19
> > > +++ databases/lbdb/Makefile   6 Jul 2018 11:19:35 -
> > > @@ -36,7 +36,6 @@ CONFIGURE_STYLE =   gnu
> > >  
> > >  CONFIGURE_ARGS +=--libdir=${PREFIX}/lib/lbdb \
> > >   --with-libiconv-prefix=${LOCALBASE} \
> > > - --without-abook \
> > >   --without-addr-email \
> > >   --without-niscat \
> > >   --without-gpg \
> > > 
> > 
> > A bit more than that is needed, but it seems reasonable to add
> > it, the extra dependency isn't too heavy.
> 
> Well, abook actually is not a dependency - it's only extra
> functionality. If it isn't installed no harm done.
> 
> > Slight Makefile reordering while there. Does this work for you?
> 
> Yes and no - comments inline :^)
> 
> > Index: Makefile
> > ===
> > RCS file: /cvs/ports/databases/lbdb/Makefile,v
> > retrieving revision 1.19
> > diff -u -p -r1.19 Makefile
> > --- Makefile29 Apr 2016 11:03:43 -  1.19
> > +++ Makefile6 Jul 2018 23:39:51 -
> > @@ -4,6 +4,7 @@ COMMENT-main =  "little brother's databa
> >  COMMENT-ldap = LDAP support for lbdb
> >  
> >  VERSION =  0.40
> > +REVISION-main =0
> 
> D'oh! ;^)
> 
> >  DISTNAME = lbdb_${VERSION}
> >  PKGNAME-main = lbdb-${VERSION}
> > @@ -18,25 +19,27 @@ MULTI_PACKAGES =-main -ldap
> >  # GPLv2+
> >  PERMIT_PACKAGE_CDROM = Yes
> >  
> > +WANTLIB-main = c iconv
> > +
> > +MASTER_SITES = http://www.spinnaker.de/debian/

Oh this is a redirect to https now, might as well change that and avoid
the extra roundtrip.

> > +BUILD_DEPENDS =${RUN_DEPENDS-main}
> > +LIB_DEPENDS-main = converters/libiconv
> > +RUN_DEPENDS-main = mail/abook
> 
> There's not need for abook to be a run dependency - m_abook module
> is only usable if it is both specified in METHODS *and* abook
> executable present, ignored otherwise.

It's a really small dependency though, and the only extra thing it pulls
in is gettext which mutt users will have anyway, so I don't see a lot of point
in /not/ including it, it does make things more consistent.


> >  RUN_DEPENDS-ldap = databases/p5-ldap \
> > databases/lbdb
> >  
> > -LIB_DEPENDS-main = converters/libiconv
> > -WANTLIB-main = c iconv
> >  LIB_DEPENDS-ldap =
> >  WANTLIB-ldap =
> >  
> > -MASTER_SITES = http://www.spinnaker.de/debian/
> > -
> >  MAKE_ENV = install_prefix=${WRKINST}
> >  
> >  NO_TEST =  Yes
> >  USE_GMAKE =Yes
> >  CONFIGURE_STYLE =  gnu
> >  
> > -CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
> > +CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
> > --with-libiconv-prefix=${LOCALBASE} \
> > -   --without-abook \
> > --without-addr-email \
> > --without-niscat \
> > --without-gpg \
> > Index: pkg/PLIST-main
> > ===
> > RCS file: /cvs/ports/databases/lbdb/pkg/PLIST-main,v
> > retrieving revision 1.1.1.1
> > diff -u -p -r1.1.1.1 PLIST-main
> > --- pkg/PLIST-main  15 Jun 2008 07:22:57 -  1.1.1.1
> > +++ pkg/PLIST-main  6 Jul 2018 23:39:51 -
> > @@ -8,6 +8,7 @@ lib/lbdb/
> >  lib/lbdb/lbdb-munge
> >  lib/lbdb/lbdb_bbdb_query.el
> >  lib/lbdb/lbdb_lib
> > +lib/lbdb/m_abook
> 
> Double-d'oh! :^P
> 
> >  lib/lbdb/m_bbdb
> >  lib/lbdb/m_fido
> >  lib/lbdb/m_finger
> 
> Now, the main issue. The m_abook module doesn't work properly due
> to tab escape sequences (\t) being used in sed regexes - something
> sed(1) in base does not cope well with.
> 
> All that module does is running the below command:
> 
>   abook --datafile $HOME/.abook/addressbook --mutt-query "$@" \
>   | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
> 
> but, due to the above, based sed(1) cuts the result short on 2nd
> 't' in the string, i.e.:
> 
>   firstname.surn...@example.org   Firstabook
> 
> or, if the string contains only one 't' or none at all:
> 
>   first.n...@example.org  My Name tabook
> 
> It works fine with gsed, which was obviously used when that module
> was written/tested, but then gsed would need to become a run
> dependency - 

Re: [PATCH] databases/lbdb - enable abook support

2018-07-07 Thread Raf Czlonka
On Sat, Jul 07, 2018 at 12:40:47AM BST, Stuart Henderson wrote:
> On 2018/07/06 12:22, Raf Czlonka wrote:
> > Hi all,
> > 
> > Given that abook is in ports, could we have support for it enabled
> > in lbdb, please?
> > 
> > Regards,
> > 
> > Raf
> > 
> > Index: databases/lbdb/Makefile
> > ===
> > RCS file: /cvs/ports/databases/lbdb/Makefile,v
> > retrieving revision 1.19
> > diff -u -p -r1.19 Makefile
> > --- databases/lbdb/Makefile 29 Apr 2016 11:03:43 -  1.19
> > +++ databases/lbdb/Makefile 6 Jul 2018 11:19:35 -
> > @@ -36,7 +36,6 @@ CONFIGURE_STYLE = gnu
> >  
> >  CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
> > --with-libiconv-prefix=${LOCALBASE} \
> > -   --without-abook \
> > --without-addr-email \
> > --without-niscat \
> > --without-gpg \
> > 
> 
> A bit more than that is needed, but it seems reasonable to add
> it, the extra dependency isn't too heavy.

Well, abook actually is not a dependency - it's only extra
functionality. If it isn't installed no harm done.

> Slight Makefile reordering while there. Does this work for you?

Yes and no - comments inline :^)

> Index: Makefile
> ===
> RCS file: /cvs/ports/databases/lbdb/Makefile,v
> retrieving revision 1.19
> diff -u -p -r1.19 Makefile
> --- Makefile  29 Apr 2016 11:03:43 -  1.19
> +++ Makefile  6 Jul 2018 23:39:51 -
> @@ -4,6 +4,7 @@ COMMENT-main ="little brother's databa
>  COMMENT-ldap =   LDAP support for lbdb
>  
>  VERSION =0.40
> +REVISION-main =  0

D'oh! ;^)

>  DISTNAME =   lbdb_${VERSION}
>  PKGNAME-main =   lbdb-${VERSION}
> @@ -18,25 +19,27 @@ MULTI_PACKAGES =  -main -ldap
>  # GPLv2+
>  PERMIT_PACKAGE_CDROM =   Yes
>  
> +WANTLIB-main =   c iconv
> +
> +MASTER_SITES =   http://www.spinnaker.de/debian/
> +
> +BUILD_DEPENDS =  ${RUN_DEPENDS-main}
> +LIB_DEPENDS-main =   converters/libiconv
> +RUN_DEPENDS-main =   mail/abook

There's not need for abook to be a run dependency - m_abook module
is only usable if it is both specified in METHODS *and* abook
executable present, ignored otherwise.

>  RUN_DEPENDS-ldap =   databases/p5-ldap \
>   databases/lbdb
>  
> -LIB_DEPENDS-main =   converters/libiconv
> -WANTLIB-main =   c iconv
>  LIB_DEPENDS-ldap =
>  WANTLIB-ldap =
>  
> -MASTER_SITES =   http://www.spinnaker.de/debian/
> -
>  MAKE_ENV =   install_prefix=${WRKINST}
>  
>  NO_TEST =Yes
>  USE_GMAKE =  Yes
>  CONFIGURE_STYLE =gnu
>  
> -CONFIGURE_ARGS +=--libdir=${PREFIX}/lib/lbdb \
> +CONFIGURE_ARGS +=--libdir=${PREFIX}/lib/lbdb \
>   --with-libiconv-prefix=${LOCALBASE} \
> - --without-abook \
>   --without-addr-email \
>   --without-niscat \
>   --without-gpg \
> Index: pkg/PLIST-main
> ===
> RCS file: /cvs/ports/databases/lbdb/pkg/PLIST-main,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 PLIST-main
> --- pkg/PLIST-main15 Jun 2008 07:22:57 -  1.1.1.1
> +++ pkg/PLIST-main6 Jul 2018 23:39:51 -
> @@ -8,6 +8,7 @@ lib/lbdb/
>  lib/lbdb/lbdb-munge
>  lib/lbdb/lbdb_bbdb_query.el
>  lib/lbdb/lbdb_lib
> +lib/lbdb/m_abook

Double-d'oh! :^P

>  lib/lbdb/m_bbdb
>  lib/lbdb/m_fido
>  lib/lbdb/m_finger

Now, the main issue. The m_abook module doesn't work properly due
to tab escape sequences (\t) being used in sed regexes - something
sed(1) in base does not cope well with.

All that module does is running the below command:

abook --datafile $HOME/.abook/addressbook --mutt-query "$@" \
| sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'

but, due to the above, based sed(1) cuts the result short on 2nd
't' in the string, i.e.:

firstname.surn...@example.org   Firstabook

or, if the string contains only one 't' or none at all:

first.n...@example.org  My Name tabook

It works fine with gsed, which was obviously used when that module
was written/tested, but then gsed would need to become a run
dependency - something I am not keen on.

The "easiest" thing to do, would be to patch /usr/local/lib/lbdb/m_abook
and use literal tabs:

-   | sed -e '1d;s/\([^\t]*\t[^\t]*\).*/\1\tabook/'
+   | sed -e '1d;s/\([^ ]*  [^  ]*\).*/\1   abook/'

After the above change, it all seems to be working fine.

Thanks for looking into it.

Raf



Re: [PATCH] databases/lbdb - enable abook support

2018-07-06 Thread Stuart Henderson
On 2018/07/06 12:22, Raf Czlonka wrote:
> Hi all,
> 
> Given that abook is in ports, could we have support for it enabled
> in lbdb, please?
> 
> Regards,
> 
> Raf
> 
> Index: databases/lbdb/Makefile
> ===
> RCS file: /cvs/ports/databases/lbdb/Makefile,v
> retrieving revision 1.19
> diff -u -p -r1.19 Makefile
> --- databases/lbdb/Makefile   29 Apr 2016 11:03:43 -  1.19
> +++ databases/lbdb/Makefile   6 Jul 2018 11:19:35 -
> @@ -36,7 +36,6 @@ CONFIGURE_STYLE =   gnu
>  
>  CONFIGURE_ARGS +=--libdir=${PREFIX}/lib/lbdb \
>   --with-libiconv-prefix=${LOCALBASE} \
> - --without-abook \
>   --without-addr-email \
>   --without-niscat \
>   --without-gpg \
> 

A bit more than that is needed, but it seems reasonable to add
it, the extra dependency isn't too heavy.

Slight Makefile reordering while there. Does this work for you?

Index: Makefile
===
RCS file: /cvs/ports/databases/lbdb/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- Makefile29 Apr 2016 11:03:43 -  1.19
+++ Makefile6 Jul 2018 23:39:51 -
@@ -4,6 +4,7 @@ COMMENT-main =  "little brother's databa
 COMMENT-ldap = LDAP support for lbdb
 
 VERSION =  0.40
+REVISION-main =0
 
 DISTNAME = lbdb_${VERSION}
 PKGNAME-main = lbdb-${VERSION}
@@ -18,25 +19,27 @@ MULTI_PACKAGES =-main -ldap
 # GPLv2+
 PERMIT_PACKAGE_CDROM = Yes
 
+WANTLIB-main = c iconv
+
+MASTER_SITES = http://www.spinnaker.de/debian/
+
+BUILD_DEPENDS =${RUN_DEPENDS-main}
+LIB_DEPENDS-main = converters/libiconv
+RUN_DEPENDS-main = mail/abook
 RUN_DEPENDS-ldap = databases/p5-ldap \
databases/lbdb
 
-LIB_DEPENDS-main = converters/libiconv
-WANTLIB-main = c iconv
 LIB_DEPENDS-ldap =
 WANTLIB-ldap =
 
-MASTER_SITES = http://www.spinnaker.de/debian/
-
 MAKE_ENV = install_prefix=${WRKINST}
 
 NO_TEST =  Yes
 USE_GMAKE =Yes
 CONFIGURE_STYLE =  gnu
 
-CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
+CONFIGURE_ARGS +=  --libdir=${PREFIX}/lib/lbdb \
--with-libiconv-prefix=${LOCALBASE} \
-   --without-abook \
--without-addr-email \
--without-niscat \
--without-gpg \
Index: pkg/PLIST-main
===
RCS file: /cvs/ports/databases/lbdb/pkg/PLIST-main,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST-main
--- pkg/PLIST-main  15 Jun 2008 07:22:57 -  1.1.1.1
+++ pkg/PLIST-main  6 Jul 2018 23:39:51 -
@@ -8,6 +8,7 @@ lib/lbdb/
 lib/lbdb/lbdb-munge
 lib/lbdb/lbdb_bbdb_query.el
 lib/lbdb/lbdb_lib
+lib/lbdb/m_abook
 lib/lbdb/m_bbdb
 lib/lbdb/m_fido
 lib/lbdb/m_finger