Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Apr 2015 10:15:17 -0500
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Dmitry Marakasov <amdmi3@amdmi3.ru>
Cc:        svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org
Subject:   Re: svn commit: r383191 - head/Mk
Message-ID:  <55269785.7030307@FreeBSD.org>
In-Reply-To: <20150409110221.GB45809@hades.panopticon>
References:  <201504040535.t345ZJ9M028396@svn.freebsd.org> <20150408194202.GA45809@hades.panopticon> <5525A9C1.5010003@FreeBSD.org> <20150408232144.GX21982@hades.panopticon> <5525D48E.5090305@FreeBSD.org> <20150409110221.GB45809@hades.panopticon>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--XAUkVhKcXL52Wwm1hh4BDmqFuQrQsux8A
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 4/9/2015 6:02 AM, Dmitry Marakasov wrote:
> * Bryan Drewery (bdrewery@FreeBSD.org) wrote:
>=20
>>>>>>   Re-enable and rework check added in r370464 to validate the firs=
t CATEGORY
>>>>>>   is set properly.  The problem causing the revert in r370475 was =
fixed in
>>>>>>   r383190.
>>>>>>  =20
>>>>>>   With hat:	portmgr
>>>>>
>>>>> This breaks countless usecases when port is build which does not be=
long
>>>>> to the ports tree.
>>>>
>>>> Please name even 1 case.
>>>
>>> I have a lot of WIP ports in flat directory. Tons of custom port
>>> repositories on github with flat structure.
>>
>> Short of more details, that does not sound like a supported setup.
>>
>> I can't read your mind. Please give me a specific case or I can't help=
=2E
>=20
> What in this case is not specific enough? Port. Outside. Portstree.

This is open to interpretation. What is "Portstree"? Is it the official
ports tree? I have my own ports trees that work just fine.

I am assuming now that you mean a port Makefile out in some random place
that has its PORTSDIR set to a different place. I've never done or seen
this. Please give actual example code next time.

>=20
> It was perfectly supported until that check was introduced.
>=20
>>>> Building a port with the wrong first CATEGORY results in a broken
>>>> package as the origin is wrong.
>>>
>>> I'm not talking about wrong categories, I'm talking about ports outsi=
de
>>> of the ports tree. These should build perfectly fine.
>>>
>>>>> Afaik, we have that information in ports - based on
>>>>> that PORTSDIR is chosen. The same mechanism should be used here to
>>>>> conditionally enable the check.
>>>>
>>>> That made no sense.
>>>
>>> Explain.
>>>
>>
>> I do not understand what you are trying to say. It makes no sense.
>=20
> I'll elaborate. PORTSDIR is set up cleverly: though it defaults to
> /usr/ports, when I work with portstree located elsewhere, PORTSDIR
> catches that:
>=20
> % make -C /usr/local/poudriere/ports/default/ports-mgmt/pkg -V PORTSDIR=

> /usr/local/poudriere/ports/default

It does respect PORTSDIR from env too.

~/git/poudriere # make -C /poudriere/ports/default/ports-mgmt/pkg -V
PORTSDIR
/root/svn/ports


>=20
> and it's clever enough to not set bogus PORTSDIR when I work with a
> separate port:
>=20
> % cp -R /usr/ports/ports-mgmt/pkg /tmp && make -C /tmp/pkg -V PORTSDIR
> /usr/ports
>=20
> this seems to be base system (current, likely) feature, as the code
> which processes that resides in /usr/share/mk/bsd.port.mk:
>=20
> # Autodetect if the command is being run in a ports tree that's not roo=
ted
> # in the default /usr/ports.  The ../../.. case is in case ports ever g=
rows
> # a third level.
> .for RELPATH in . .. ../.. ../../..
> .if !defined(_PORTSDIR) && exists(${.CURDIR}/${RELPATH}/Mk/bsd.port.mk)=

> _PORTSDIR=3D      ${.CURDIR}/${RELPATH}
> .endif
> .endfor
> _PORTSDIR?=3D     /usr/ports
> PORTSDIR!=3D      realpath ${_PORTSDIR}
> .endif
>=20

Yes that is very new.

> To conditionally disable that bogus category check, either the same
> logic may be used, or this may be used indirectly (e.g. if ${.CURDIR}
> does not reside in ${PORTSDIR}, disable the check, as we are working
> outside the portstree).
>=20

*That* made sense. Frankly I think all dev warnings should be disabled
in that case though. Setting up ports like this may work but it is not a
good way to test a port before committing or submitting it. Many ports
and their framework files reference "CURDIR/../..". In r327743 I
modified www/linux-seamonkey to use PORTSDIR here and I believe I broke
the workflow for the maintainers testing. The ports tree really needs to
be tested as a whole. This is why portshaker exists, so you can bring in
your partial tree into a full tree. Unionfs in theory is for this too.


--=20
Regards,
Bryan Drewery


--XAUkVhKcXL52Wwm1hh4BDmqFuQrQsux8A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJVJpeFAAoJEDXXcbtuRpfPaqQH/iEhQ8Fbm8INLXWhnR/bFa3k
QQ+tJtx9c+WSdC+sY8eDwurbaSaQKk2tT89hnmtpfetIemeYTKJv0+f9P/W9WGzp
noOJkCnjZQXBEbyxw6B7jIG653Wo0pKB2adKLtmnM5NqloBpDZoGVxOm6RdAZYhu
2FvVX4I7yv4jizlMb9kVs86dsLS0riSLj2SwnmtA3qLd1OhnefhEJ2WwJaLTYbGB
BIDV6tH9sc2j8i92M2VWP9hWHJcZfqju6qUPslR+FzB1pRiLgTjQCfag0JXY6EoQ
jPt6mi+f8T9tv9qbSy1GmZTF0Usxxl3Z9wfHc/uU1HiGZtBcO4BdCaZ7HzDJ6Fw=
=Mto2
-----END PGP SIGNATURE-----

--XAUkVhKcXL52Wwm1hh4BDmqFuQrQsux8A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55269785.7030307>