Created
July 1, 2017 03:13
-
-
Save therealromster/e859fac834a14df49cc843b30e7948bc to your computer and use it in GitHub Desktop.
Build packages that depend on package and work though the tree while reducing the need to remove every package for each build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /usr/ports/contrib | |
for a in $(for b in $(for b in $(for d in *; do | |
prt-get quickdep $d | |
done \ | |
| sort | uniq | awk '{print NF" "$0}' | sort -gr | cut -d' ' -f2- | awk '{print $(NF-1)"/"$NF}' | sort); do | |
echo $b; done \ | |
| sed -e 's|^/.*||g' -e '/^\s*$/d'); do | |
echo $b; done \ | |
| sed 's|/|&\t|g' | sort -k1 -k2 | tr -d '\t'); do | |
/usr/sbin/pkg-clean -r --keep "$(echo $a |cut -d/ -f1)" | |
prt-get depinst "$(echo $a |cut -d/ -f2)" | |
echo 'Running revdep.' | |
prt-get update -fr $(revdep) | |
prt-get depinst "$(echo $a |cut -d/ -f1)" | |
unset name version release | |
. "$(echo $a |cut -d/ -f2)/Pkgfile" | |
rsync -av "/var/ports/packages/$name#$version-$release.pkg.tar.xz" /var/ports/packages/keep/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment