| 30 | |
| 31 | === Automatically reinstall ports === #autoinstall |
| 32 | |
| 33 | If you want to do the whole procedure automatically instead, including handling dependencies, you can run the following commands to build a Makefile for running the reinstalls in the right order. (Not needed If you already ran the steps in the previous section.) |
| 34 | {{{ |
| 35 | port installed |grep -v '^The following' | awk '{print $1}' > myports.txt |
| 36 | }}} |
| 37 | {{{ |
| 38 | echo "all: $(cat myports.txt|tr '\n' ' ')" > Makefile.portsupgrade |
| 39 | }}} |
| 40 | {{{ |
| 41 | for port in $(cat myports.txt); do |
| 42 | echo "$port: $(port deps $port|grep Dependencies:|sed -e 's/.*Dependencies: *//;s/,//g'|tr '\n' ' ')" |
| 43 | printf "\tport -f uninstall $port\n\tport install $port\n" |
| 44 | done | tee -a Makefile.portsupgrade |
| 45 | }}} |
| 46 | {{{ |
| 47 | make -f Makefile.portsupgrade |
| 48 | }}} |