Skip to content

Instantly share code, notes, and snippets.

@calbrecht
Created December 12, 2015 17:57
Show Gist options
  • Save calbrecht/7d76d4b75e48057f0e26 to your computer and use it in GitHub Desktop.
Save calbrecht/7d76d4b75e48057f0e26 to your computer and use it in GitHub Desktop.
helper script metadata for fixing nixos nix pkgs metadata
#!/usr/bin/env bash
test -d nixpkgs && test -f nixpkgs/default.nix || {
echo Must run this script in parent of $nixpkgs_dir git root
exit 1
}
test -d gentoo || {
git clone https://anongit.gentoo.org/git/repo/gentoo.git
}
test -f nixpkgs-lint.txt || {
echo nixpkgs-lint -f nixpkgs > nixpkgs-lint.txt
nixpkgs-lint -f nixpkgs > nixpkgs-lint.txt
}
while read line; do
if [[ $line =~ ^([-a-zA-Z]+)\.?([-a-zA-Z]*):\ Lacks\ a\ ([a-z]+) ]] ; then
name=${BASH_REMATCH[1]}
sub=${BASH_REMATCH[2]}
lacks=${BASH_REMATCH[3]}
echo
echo ${name}${sub:+.}${sub} ${lacks}
for gpath in $(find gentoo -type d -iname ${name}) ; do
for ebuild in $(ls -x ${gpath}/*.ebuild) ; do
case ${lacks} in
description|license|platform)
grep -i ${lacks}= ${ebuild}
;;
maintainer)
echo maintainer = [];
;;
esac
done
done
fi
done <nixpkgs-lint.txt
#curl "https://packages.gentoo.org/packages/suggest.json?q=sqlite3"
#curl 'https://packages.gentoo.org/packages/dev-ruby/sqlite3.json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment