Ticket #2421 (new enhancement)
RFE: Prefetch mode of operation
| Reported by: | n8gray@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts Future |
| Component: | base | Version: | |
| Keywords: | Cc: | raimue@…, ryandesign@…, lagrave+bugs+macosforge.org@…, egall@… | |
| Port: |
Description (last modified by ryandesign@…) (diff)
As a laptop user I have intermittant network connectivity. It would be very useful if I could fetch all the sources needed for building a port and its uninstalled dependencies *before* building anything. One way to do this would be with a 'recursive' flag to 'port fetch'. Another (better, IMHO) option would be to allow 'fetch-first' as a permanent mode of operation. I would prefer to work this way all the time anyway.
Attachments
Change History
comment:2 Changed 9 years ago by pguyot@…
I personally would rather have something that fetches binaries while dependencies are being compiled. This requires some heavy work on the dependency engine, though.
comment:3 Changed 8 years ago by mww@…
Paul, this is easy, too #--- port_install() {
port install $* & for i in port deps $1 | tr -d "\r" | grep -v ^${1}; do
port fetch $i & fetch_deps $i;
done
} #---
Changed 6 years ago by francisga@…
- Attachment port.tcl.diff added
Make -R work with 'port fetch'. Applied against version 1.320.
Changed 6 years ago by francisga@…
- Attachment port.1.diff added
Updates the man page for the -R switch.
comment:4 Changed 6 years ago by francisga@…
I have attached a 20-line patch to port.tcl against MacPorts 1.320 that that makes the -R switch work with the fetch stage.
port -R fetch somepackage
will fetch everything needed to build and run somepackage, so that a later port install somepackage will work even if offline.
I originally posted the patch to Ticket #11446, without realizing it was a dup of this ticket.
comment:5 Changed 6 years ago by nox@…
- Priority changed from Expected to Normal
- Summary changed from Prefetch mode of operation to RFE: Prefetch mode of operation
- Version 1.0 deleted
- Milestone set to MacPorts base enhancements
comment:6 Changed 5 years ago by raimue@…
- Cc raimue@… added
Don't use the -R switch, as it is already used for following dependents (not dependencies; some fun with english).
I propose to use -r, which could also be used on other actions. -r follow dependencies (e.g. on fetch) -R follow dependents (e.g. on upgrade)
Whereas -n is the opposite of -r.
This would be much more consistent than using -R for this.
comment:7 Changed 5 years ago by raimue@…
To be consistent with other commands, we should use port fetch --follow-deps for this.
comment:8 Changed 4 years ago by mroman@…
In general prefetching should be started in one thread and the another one should start building as soon as fetching of any source is completed. Just like it is implemented in portage for instance. It would be nice to see it in 1.8 release.
comment:9 Changed 3 years ago by ryandesign@…
- Cc ryandesign@… added
- Description modified (diff)
As of MacPorts 1.9, it's now easy to fetch all of a port foo's dependencies recursively:
sudo port fetch rdepof:foo
comment:10 Changed 21 months ago by ryandesign@…
- Cc lagrave+bugs+macosforge.org@… added
Has duplicate #31272.


adding this to your .bashrc will provide this feature right away (wether or not this feature will make it to port(1))
#--- fetch_deps() {
} #---