Bug 227387 - Mk/bsd.port.mk: Try to fix make clean for non-flavored dependency
Summary: Mk/bsd.port.mk: Try to fix make clean for non-flavored dependency
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-04-09 10:12 UTC by Fukang Chen
Modified: 2022-09-07 15:22 UTC (History)
7 users (show)

See Also:
bugzilla: maintainer-feedback? (portmgr)


Attachments
patch maybe (624 bytes, patch)
2018-04-09 10:12 UTC, Fukang Chen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fukang Chen freebsd_committer freebsd_triage 2018-04-09 10:12:30 UTC
Created attachment 192357 [details]
patch maybe

# cd /usr/ports/ftp/py-pycurl
# make -C /usr/ports/ftp/curl BATCH=1 extract
===>  License MIT accepted by the user
===>   curl-7.59.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by curl-7.59.0 for building
===>  Extracting for curl-7.59.0
=> SHA256 Checksum OK for curl-7.59.0.tar.xz.
# make clean
===>  Cleaning for curl-7.59.0           <== pre-clean WRKDIR=work-py27
===>  Cleaning for curl-7.59.0           <== pre-clean-py27 WRKDIR=work-py27
===>  Cleaning for py27-pycurl-7.43.0.1
===>  Cleaning for curl-7.59.0
===>  Cleaning for curl-7.59.0
===>  Cleaning for py36-pycurl-7.43.0.1
# echo /usr/ports/ftp/curl/w*
/usr/ports/ftp/curl/work
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-04-09 10:24:05 UTC
Mk/bsd.port.mk is maintained by portmgr, re-classify/re-assign accordingly.

@Fukang Thank you for the report and patch. Could you clarify the pre and post patch behaviour separately, as in:

Current behaviour:

Expected behaviour (with patch):
Comment 2 Fukang Chen freebsd_committer freebsd_triage 2018-04-09 11:40:07 UTC
Sure. Thanks koobs@.

FLAVOR=py27 is passed to the dependency ftp/curl through env:
https://svnweb.freebsd.org/ports/head/Mk/bsd.port.mk?revision=466532&view=markup#l3814
3813  limited-clean-depends-${_f}:
3814          @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} limited-clean-depends
3815  .endif

then ${WRKDIR} turns to be /usr/ports/ftp/curl/work-py27 when it reaches here:
https://svnweb.freebsd.org/ports/head/Mk/bsd.port.mk?revision=466532&view=markup#l1663
1663    .if empty(FLAVOR)
1664    _WRKDIR=        work
1665    .else
1666    _WRKDIR=        work-${FLAVOR}
1667    .endif
1668    
1669    WRKDIR?=                ${WRKDIRPREFIX}${.CURDIR}/${_WRKDIR}

The first "===>  Cleaning for curl-7.59.0" is executed by the pre-clean-noflavor: target:
https://svnweb.freebsd.org/ports/head/Mk/bsd.port.mk?revision=466532&view=markup#l3789
3789    pre-clean-noflavor:
3790            @cd ${.CURDIR} && ${SETENV} ${MAKE} pre-clean
3791    .endif

The Second "===>  Cleaning for curl-7.59.0" is excuted by the pre-clean-py27: target:
https://svnweb.freebsd.org/ports/head/Mk/bsd.port.mk?revision=466532&view=markup#l3818
3818    pre-clean-${_f}:
3819            @cd ${.CURDIR} && ${SETENV} FLAVOR=${_f} ${MAKE} pre-clean
3820    .endif



Current behaviour:
# cd /usr/ports/ftp/py-pycurl
# make -C /usr/ports/ftp/curl BATCH=1 extract
===>  License MIT accepted by the user
===>   curl-7.59.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by curl-7.59.0 for building
===>  Extracting for curl-7.59.0
=> SHA256 Checksum OK for curl-7.59.0.tar.xz.
# make clean
===>  Cleaning for curl-7.59.0
===>  Cleaning for curl-7.59.0
===>  Cleaning for py27-pycurl-7.43.0.1
===>  Cleaning for curl-7.59.0
===>  Cleaning for curl-7.59.0
===>  Cleaning for py36-pycurl-7.43.0.1
# test -d /usr/ports/ftp/curl/work ; echo $?
0

Expected behaviour (with patch):
# cd /usr/ports/ftp/py-pycurl
# make -C /usr/ports/ftp/curl BATCH=1 extract
===>  License MIT accepted by the user
===>   curl-7.59.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by curl-7.59.0 for building
===>  Extracting for curl-7.59.0
=> SHA256 Checksum OK for curl-7.59.0.tar.xz.
# make clean
===>  Cleaning for curl-7.59.0
===>  Cleaning for py27-pycurl-7.43.0.1
===>  Cleaning for py36-pycurl-7.43.0.1
# test -d /usr/ports/ftp/curl/work ; echo $?
1
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2022-09-07 15:22:48 UTC
Moin moin 

Closing this, due to old age. Please re-open the issue, if it is still relevant.


mfg Tobias