Skip to content

Instantly share code, notes, and snippets.

@hoefling
hoefling / filter-python2-deps
Last active April 16, 2019 08:57
filter installed packages having 2.7 as only python target and activate python2_7 use flag
#!/usr/bin/env bash
$(which eix) --compact --installed --use python_targets_python2_7 \
--not --use python_targets_python3_5 --not --use python_targets_python3_4 \
--not --use python_targets_python3_3 --not --use python_targets_python3_2 \
| sed -n 's/^\[I\] \(.*\/.*\) ([[:digit:]].*$/\1/p' \
| awk '{print $1" python_targets_python2_7"}' \
> /etc/portage/package.use/python2_7