Skip to content

Instantly share code, notes, and snippets.

@jepio
Last active August 29, 2015 14:02
Show Gist options
  • Save jepio/27c1d91f6430431cef6a to your computer and use it in GitHub Desktop.
Save jepio/27c1d91f6430431cef6a to your computer and use it in GitHub Desktop.
A function to discover why a package is masked in portage on gentoo. Source: http://blogs.gentoo.org/news/2014/06/02/gentoo-monthly-newsletter-may-2014/#Tip_of_the_month
#!/usr/bin/env bash
whymask() {
find /usr/portage/profiles/ -name '*.mask' -exec \
awk -vRS= "/${*/\//.}/ {
print \" \" FILENAME \":\", \"\n\" \"\n\" \$0 \"\n\"
}" {} + | less
}
whymask $1
@jepio
Copy link
Author

jepio commented Jun 19, 2014

Incase I forget, the correct way to define a bash inline function is:

function() { echo "Function"; }

The space after '{' is important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment