Skip to content

Instantly share code, notes, and snippets.

@therealromster
Created July 1, 2017 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealromster/e859fac834a14df49cc843b30e7948bc to your computer and use it in GitHub Desktop.
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
#!/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