Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 2020 21:23:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 246196] Mk/bsd.port.mk: github groups conflict with WRKSRC_SUBDIR
Message-ID:  <bug-246196-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246196

            Bug ID: 246196
           Summary: Mk/bsd.port.mk: github groups conflict with
                    WRKSRC_SUBDIR
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: svysh.fbsd@gmail.com

Created attachment 214127
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D214127&action=
=3Dedit
patch to fix bsd.port.mk

Problem: Using github groups=20
(see 5.4.3.1. "Fetching Multiple Files from GitHub" of Porter's Handbook)
along with non-empty WRKSRC_SUBDIR
leads to garbage in WRKSRC variable.

Consider hypotetical port from Example 5.15 of Porter's Handbook,
with addition of non-empty WRKSRC_SUBDIR.

security/foo/Makefile:
--------------------------
PORTNAME=3D       foo
DISTVERSION=3D    1.0.2
CATEGORIES=3D     security

USE_GITHUB=3D     yes
GH_ACCOUNT=3D     bar:icons,contrib
GH_PROJECT=3D     foo-icons:icons foo-contrib:contrib
GH_TAGNAME=3D     1.0:icons fa579bc:contrib

WRKSRC_SUBDIR=3D  core/server/

.include <bsd.port.mk>
--------------------------

Experiment 1. With original file Mk/bsd.port.mk.orig:
$ cd /usr/ports/security/foo
$ make -V WRKSRC
/usr/ports/security/foo/work/foo-icons:icons
foo-contrib:contrib-1.0.2/core/server/

which definitely puts garbage into WRKSRC variable.

Experiment 2. With patched file Mk/bsd.port.mk:
$ cd /usr/ports/security/foo
$ make -V WRKSRC
/usr/ports/security/foo/work/foo-1.0.2/core/server/

which works as intended.

The reason of failure with original file Mk/bsd.port.mk.orig is in its lines
1725-1727:

.if defined(WRKSRC_SUBDIR)
WRKSRC:=3D                ${WRKSRC}/${WRKSRC_SUBDIR}
.endif

which come earlier, than line 2245:
.include "${PORTSDIR}/Mk/bsd.sites.mk"

Hence value of GH_PROJECT in line 1705:
WRKSRC?=3D                ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}
contains a list of data:=20
GH_PROJECT=3D=3D foo-icons:icons foo-contrib:contrib
instead of needed value:
GH_PROJECT=3D=3D foo

Proposed change to line 1705, that is substitute
GH_PROJECT ---> GH_PROJECT_DEFAULT
solves the problem, because GH_PROJECT_DEFAULT=3D=3Dfoo=20
during all stages of "make" operation.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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