Skip to content

Repository: add a function to purge stale ports#343

Merged
jmairboeck merged 1 commit intohaikuports:masterfrom
jmairboeck:purge-stale-ports
Aug 30, 2025
Merged

Repository: add a function to purge stale ports#343
jmairboeck merged 1 commit intohaikuports:masterfrom
jmairboeck:purge-stale-ports

Conversation

@jmairboeck
Copy link
Copy Markdown
Member

i.e. remove the work directories and downloads of old port (versions) which have been removed. A new command line option "--purge-stale-ports" is introduced for this.

To get the sources of ports (and thus which downloads to keep) it must parse all recipes.

Note that this may be a bit destructive if you are switching git branches while working on something!

@jmairboeck jmairboeck requested a review from OscarL August 25, 2025 15:35
@waddlesplash
Copy link
Copy Markdown
Member

Doesn't the buildmaster do this? So there must be some mechanism for it somewhere already?

@OscarL
Copy link
Copy Markdown
Contributor

OscarL commented Aug 26, 2025

Doesn't the buildmaster do this? So there must be some mechanism for it somewhere already?

I think builders only call RemoteBuilderSSH._purgePort() from RemoteBuilderSSH.runBuild(). That ultimately calls Port.purge(), but that works for only the given port, not for the whole tree, and not just for stale ports, as in this PR, AFAICS.

Comment thread HaikuPorter/Repository.py Outdated
@jmairboeck
Copy link
Copy Markdown
Member Author

Doesn't the buildmaster do this? So there must be some mechanism for it somewhere already?

I think builders only call RemoteBuilderSSH._purgePort() from RemoteBuilderSSH.runBuild(). That ultimately calls Port.purge(), but that works for only the given port, not for the whole tree, and not just for stale ports, as in this PR, AFAICS.

Yes, there is Port.purge(), but that only works for existing ports. This does the same for ports which don't exist any more.

i.e. remove the work directories and downloads of old port (versions)
which have been removed. A new command line option "--purge-stale-ports"
is introduced for this.

To get the sources of ports (and thus which downloads to keep) it must
parse all recipes.

Note that this may be a bit destructive if you are switching git branches
while working on something!
@jmairboeck jmairboeck merged commit 4901685 into haikuports:master Aug 30, 2025
3 checks passed
@jmairboeck jmairboeck deleted the purge-stale-ports branch August 30, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants