| 47 | |
| 48 | === Convert myports.txt into an install script (EXPERIMENTAL) === #sed_script |
| 49 | |
| 50 | This sed script gets close to coverting myports.txt into an installation script. It will not arrange the order of the installation according to the dependency tree and it cannot check the most recent variants against those of the installed ports. It will strip away any variants with '+darwin*', '+macosx' or '+i386', as these variants should be determined automatically for a new installation. The {{{'&& \'}}} at the end of each command line will effectively create one long command line, with contingent installation of successive ports; should any one port install fail, no others will run (e.g., try {{{ls abc.txt && cat abc.txt}}} where no file abc.txt exists). Remove the {{{'&& \'}}} from the last line of the file. |
| 51 | |
| 52 | {{{ |
| 53 | $ cat myports.txt | /usr/bin/sed \ |
| 54 | -e 's/@[._0-9]*//' \ |
| 55 | -e 's/(active)//' \ |
| 56 | -e 's/+/ +/g' \ |
| 57 | -e 's/[+]darwin[_i0-9]*//g' \ |
| 58 | -e 's/+macosx//g' \ |
| 59 | -e 's/+i386//g' \ |
| 60 | -e 's/+gcc[0-9]*//' \ |
| 61 | -e 's/$/ \&\& \\/' \ |
| 62 | -e 's/^./sudo port install /' \ |
| 63 | -e 's/.*currently installed:.*/#!\/bin\/bash/' \ |
| 64 | > myports.bash |
| 65 | $ chmod +x myports.bash |
| 66 | $ # Remove the '&& \' from the last line of the file. |
| 67 | $ ./myports.bash |
| 68 | }}} |