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

next in thread | previous in thread | raw e-mail | index | archive | help
* Bryan Drewery (bdrewery@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.

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

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

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

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru      http://amdmi3.ru



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