Opened 20 years ago

Last modified 10 years ago

#2421 new enhancement

RFE: Prefetch mode of operation — at Version 9

Reported by: n8gray@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts Future
Component: base Version:
Keywords: Cc: raimue@…, ryandesign@…
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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.

Change History (11)

comment:1 Changed 20 years ago by mww@…

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

#--- fetch_deps() {

for i in port deps $1 | tr -d "\r" | grep -v ^${1}; do

port fetch $i & fetch_deps $i;

done

} #---

comment:2 Changed 20 years ago by pguyot (Paul Guyot)

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 20 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 18 years ago by francisga@…

Attachment: port.tcl.diff added

Make -R work with 'port fetch'. Applied against version 1.320.

Changed 18 years ago by francisga@…

Attachment: port.1.diff added

Updates the man page for the -R switch.

comment:4 Changed 18 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 17 years ago by nox@…

Milestone: MacPorts base enhancements
Priority: ExpectedNormal
Summary: Prefetch mode of operationRFE: Prefetch mode of operation
Version: 1.0

comment:6 Changed 17 years ago by raimue (Rainer Müller)

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 16 years ago by raimue (Rainer Müller)

To be consistent with other commands, we should use port fetch --follow-deps for this.

comment:8 Changed 16 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 14 years ago by ryandesign (Ryan Carsten Schmidt)

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
Note: See TracTickets for help on using tickets.