Page MenuHomeFreeBSD

Use native make(1) mechanism to create the package repository directory
ClosedPublic

Authored by bapt on Feb 7 2017, 12:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 19 2024, 5:52 PM
Unknown Object (File)
Jan 7 2024, 12:55 PM
Unknown Object (File)
Dec 20 2023, 2:29 AM
Unknown Object (File)
Dec 3 2023, 11:05 PM
Unknown Object (File)
Dec 1 2023, 2:48 PM
Unknown Object (File)
Nov 16 2023, 6:27 PM
Unknown Object (File)
Nov 6 2023, 10:03 AM
Unknown Object (File)
Oct 5 2023, 11:31 AM
Subscribers

Details

Summary

In order to have subpackages we need in the end do-package to depend on
a target per package that would be created per subpackages

For this we need to decouple the content of do-package so it becomes
a target that only creates the packages.

As a first step use natural make(1) mechanism for a target: if checks first
for the existence of a file and it it does not exists that execute the content
of the target, in that case it creates the PKGREPOSITORY
Bonus it simplifies a bit the code.

While here to avoid testing multiple time for the PACKAGES directory set a
variable after we tested it the first time

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bapt retitled this revision from to Use native make(1) mechanism to create the package repository directory.
bapt updated this object.
bapt edited the test plan for this revision. (Show Details)
bapt added a reviewer: portmgr.
Mk/bsd.port.mk
3347–3348 ↗(On Diff #24817)

There already is a target for creating directories around line 2947, maybe you could add PKGREPOSITORY to it (keep the _EXTRA_PACKAGE_TARGET_DEP here, or move it to where you set _JAVE_PACKAGES earlier, maybe)

bapt edited edge metadata.

Factorize mkdir

Mk/bsd.port.mk
3354–3355 ↗(On Diff #24824)

I'm not sure why we need two lines, it should work just fine with:

do-package: create-manifest ${_EXTRA_PACKAGE_TARGET_DEP} ${TMPPLIST}
bapt marked an inline comment as done.Feb 7 2017, 10:37 AM

It doesn't seem to work

<phase: extract >

> License BSD2CLAUSE accepted by the user

> Fetching all distfiles required by pkg-1.10.0_1 for building

> Extracting for pkg-1.10.0_1

> License BSD2CLAUSE accepted by the user

> Fetching all distfiles required by pkg-1.10.0_1 for building

> SHA256 Checksum OK for pkg-1.10.0.tar.xz.

cd: /wrkdirs/usr/ports/ports-mgmt/pkg/work: No such file or directory

  • Error code 1

Fix order new target is define

Only use oneline to define the do-package dependencies

bapt marked an inline comment as done and an inline comment as not done.Mar 31 2017, 11:06 PM

Everything should be addressed

Mk/bsd.port.mk
3347–3348 ↗(On Diff #24817)

I plan more cleanup in a second patch

bapt marked an inline comment as not done.

Create the prefix in stage directory using the new target

bapt marked an inline comment as done.
Mk/bsd.port.mk
3094 ↗(On Diff #26902)

This should not be needed, the directory is in the _EXTRACT_SEQ pipeline.

3347 ↗(On Diff #26902)

Wondering if all those dependencies could not go in the _PACKAGE_SEQ pipeline.

4531 ↗(On Diff #26902)

same here in _STAGE_SEQ

The advantage of not going in the SEQ is to be allow parallelisation.

the SEQ is mainly for things that cannot be run in parallel and where the dependencies are hard to express aka the public or main big ones or the one added via USES because we never know.

that said if you have a strong feeling about only having targets in SEQ we can do it.

I do like explicit dependencies when it is easy to express, has when hacking on a given target you exactly know what you depend on :)

In D9466#211552, @bapt wrote:

The advantage of not going in the SEQ is to be allow parallelisation.

the SEQ is mainly for things that cannot be run in parallel and where the dependencies are hard to express aka the public or main big ones or the one added via USES because we never know.

that said if you have a strong feeling about only having targets in SEQ we can do it.

I'm not sure it is a good idea to have most targets in _SEQ and have a handful of targets outside of it. I don't really see a point of being able to parallelize a MKDIR :-)

What I mean is, if some day, it is rewritten and the _SEQ things go away, fine, but right now, it is the way the targets in b.p.m work, so it could be a good idea to stick with it.

The failures antoine show was due to the dependencies only being in the SEQ because the variable was expanded to early. with the explicit dependency added we are sure it never fails again.
actually all directories/files dependencies should imho in anycase be removed from the SEQ. I can work on that after if you want.

Define the mkdir target prior to the SEQ definition so it always exists

This revision is now accepted and ready to land.Apr 8 2017, 6:14 PM
This revision was automatically updated to reflect the committed changes.