svn commit: r383191 - head/Mk

Bryan Drewery bdrewery at FreeBSD.org
Thu Apr 9 15:15:16 UTC 2015


On 4/9/2015 6:02 AM, Dmitry Marakasov wrote:
> * Bryan Drewery (bdrewery at FreeBSD.org) wrote:
> 
>>>>>>   Re-enable and rework check added in r370464 to validate the first CATEGORY
>>>>>>   is set properly.  The problem causing the revert in r370475 was fixed in
>>>>>>   r383190.
>>>>>>   
>>>>>>   With hat:	portmgr
>>>>>
>>>>> This breaks countless usecases when port is build which does not belong
>>>>> 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.
> 
> 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.

> 
> It was perfectly supported until that check was introduced.
> 
>>>> 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 outside
>>> 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.
> 
> I'll elaborate. PORTSDIR is set up cleverly: though it defaults to
> /usr/ports, when I work with portstree located elsewhere, PORTSDIR
> catches that:
> 
> % 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


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

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).
> 

*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.


-- 
Regards,
Bryan Drewery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-ports-all/attachments/20150409/d978e548/attachment.sig>


More information about the svn-ports-all mailing list