Subject: Re: make: RE substitution error: Invalid preceding regular expression
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 11/13/2003 11:15:44
More information, since I got to same responses off-list ...

> ===> Required package py23-xml-*: NOT found
> ===> Verifying reinstall for ../../textproc/pyxml
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression
> bmake: RE substitution error: Invalid preceding regular expression

I also did the same build under a standard NetBSD 1.6.1_STABLE system. It
did not have the "RE substitution error" messages above. But it did have
the same errors below:

> bmake:
> "../../lang/python/../../lang/python/../../lang/python/../../lang/python/pyversion.mk"
> line 174: Unassociated shell command "error: no valid Python version"
> bmake:
> "../../lang/python/../../lang/python/../../lang/python/../../lang/python/pyversion.mk"
> line 181: Could not find /buildlink2.mk
> bmake: Fatal errors encountered -- cannot continue
>
> bmake: stopped in /usr/pkgsrc/textproc/pyxml

I also got same errors above when trying instead:

.include "../../x11/py-gtk2/buildlink2.mk"


Also, I tried with and without:

PYTHON_VERSIONS_ACCEPTED=       22 22pth 23 23pth
(and others).

When using py-gnome2, I did have it set, but it was not used. Because it
was also set by another of the dependency packages:

  $ bmake show-var VARNAME=PYTHON_VERSIONS_ACCEPTED
  23pth 22pth

I now see that time/gdeskcal won't build for me either with same errors on
a NetBSD box. But then I updated lang/python* and it worked on that box.

But I am still having problems (same error messages) on my other system
(even after making sure mk and python* files were updated).

Is there anyway to debug where the "RE substitution error: Invalid
preceding regular expression" error is coming from?

I was able to work-around this my modifying pyversion.mk to set
_PYTHON_VERSION (even though "make show-var VARNAME=_PYTHON_VERSION"
already said the same).

 #
+_PYTHON_VERSION= 23pth
 .if ${_PYTHON_VERSION} == "23"
 PYPKGSRCDIR=   ../../lang/python23


$ bmake show-var VARNAME=_PYTHON_VERSION_23pth_INSTALLED
yes

$ bmake show-var VARNAME=_PYTHON_VERSION_23pth_OK
yes

My mk.conf has:
PYTHON_VERSION_DEFAULT=23pth
(But even commenting that out didn't fix anything.)

I also tried setting that _PYTHON_VERSION in my Makefile, but that didn't
work.

I don't know why the start of pyversion.mk makes an empty _PYTHON_VERSION.

_PYTHON_VERSION_FIRSTACCEPTED is also not defined.

So then I found that that if I added
_PYTHON_VERSION= 23pth before the following endif, then it works:

.if defined(PYTHON_VERSION_REQD)
_PYTHON_VERSION=        ${PYTHON_VERSION_REQD}
.endif

I also tried putting it before that and it didn't work and I tried setting
it later in other ".if ! defined(_PYTHON_VERSION)" sections" but that
didn't work too (since it was already defined to some empty value above).

$ bmake show-var VARNAME=PYTHON_VERSION_REQD

$

Setting PYTHON_VERSION_REQD in the Makefile doesn't fix this either.

It also worked to just do
.undef PYTHON_VERSION_REQD
before that was checked.

So I wonder what was setting PYTHON_VERSION_REQD (to nothing).

I look at all 36 dependencies of my package and none defined
PYTHON_VERSION_REQD.

I don't know what the problem is, but at least I can continue to work on
my new gramps package with:

 # if a version is explicitely required, take it
+.undef PYTHON_VERSION_REQD
 .if defined(PYTHON_VERSION_REQD)

   Jeremy C. Reed
   http://bsd.reedmedia.net/