Opened 20 years ago

Last modified 10 years ago

#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 (Rainer Müller), ryandesign (Ryan Carsten Schmidt), lagrave+bugs+macosforge.org@…, cooljeanius (Eric Gallager)
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.

Attachments (2)

port.tcl.diff (1.2 KB) - added by francisga@… 18 years ago.
Make -R work with 'port fetch'. Applied against version 1.320.
port.1.diff (494 bytes) - added by francisga@… 18 years ago.
Updates the man page for the -R switch.

Download all attachments as: .zip

Change History (18)

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

comment:10 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: lagrave+bugs+macosforge.org@… added

Has duplicate #31272.

comment:11 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:12 Changed 10 years ago by cooljeanius (Eric Gallager)

The port-fetch-all.sh script provided by the macportsscripts port also works for this purpose.

comment:13 Changed 10 years ago by lagrave+bugs+macosforge.org@…

Where do I find port-fetch-all.sh ? Google just pointed at this page.

comment:14 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

comment:15 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Or, as Eric said previously, by installing the macportsscripts port.

comment:16 in reply to:  14 Changed 10 years ago by cooljeanius (Eric Gallager)

Replying to ryandesign@…:

Apparently here: https://github.com/derphilipp/macportsscripts

That was phw's original location for it; the macportsscripts port actually now pulls from my fork of it: https://github.com/cooljeanius/macportsscripts

Note: See TracTickets for help on using tickets.