<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Jan 4, 2007, at 3:12 PM, Ralf Graf wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I'm in the process of moving my stuff from my good old G4-Powerbook to an all shiny new MacBook Pro. I wonder wether it's possible to take over my installed ports from the Powerbook to the MacBook Pro. Simply copying /opt/local shouldn't work, because the installed ones are all PPC-Binaries.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Is there a way of rebuilding the same list of ports without the need to hack every port that "port installed" listed on the old machine into a terminal on the new machine?</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I may sound confusing, to make clear what I'm searching for, something like:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Old machine: ports installed > list_of_ports.txt</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">New machine: ports install < list_of_ports.txt</FONT></P> </BLOCKQUOTE><BR></DIV><DIV>Unfortunately, no.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You can, however, write a fairly simple script to get a list of all ports and variants in a form that you can send to port. There are a few caveats, however - ports that are outdated, you'll end up installing the latest. Inactive ports will cause a problem, because I know of no way to install a port without activating it. Also, ports which have dependencies may also be a problem, because if you have the dependencies installed with specific variants, it's non-trivial to detect this and ensure those dependencies are installed with those variants before the dependent port.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>That said, this should work to simply install all ports and their variants on the new machine:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>## old machine</DIV><DIV># this line will skip inactive ports</DIV><DIV>port installed | sed -nE -e '/^ .*\(active\)$/{s/^ //;s/@[-a-zA-Z0-9_.]+//;s/ \(active\)$//;p;}' > ports.txt</DIV><DIV># use this one instead if you want to install all ports, even inactive ones</DIV><DIV>#port installed | sed -nE -e '/^ $/{s///;s/@[-a-zA-Z0-9_.]+//;s/ \(active\)$//;p;}' > ports.txt</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>## you may want to peruse the ports.txt list to ensure dependencies with custom variants</DIV><DIV>## are listed above any dependent ports</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>## new machine</DIV><DIV>cat ports.txt | xargs -L 1 port install</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>HTH,</DIV><DIV>Kevin Ballard</DIV><BR> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:kevin@sb.org">kevin@sb.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> <BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:eridius@macports.org">eridius@macports.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>