commit cf0bea24b8c03e7894578c144dbbca1a9aca3061 parent 81aa7cc99c4eeb7bb64a58a4b07ac98653a8842a Author: parazyd <parazyd@dyne.org> Date: Wed, 31 Jul 2019 14:03:58 +0200 Optimize generate-google-fonts.sh Diffstat:
M | media-fonts/generate-google-fonts.sh | | | 35 | ++++++++--------------------------- |
1 file changed, 8 insertions(+), 27 deletions(-)
diff --git a/media-fonts/generate-google-fonts.sh b/media-fonts/generate-google-fonts.sh @@ -42,37 +42,16 @@ for i in "$gitdir/apache/"*/ "$gitdir/ofl/"*/; do ;; esac - # command ls -1 ~/src/fonts/apache ~/src/fonts/ofl /usr/portage/media-fonts \ - # | sort > fonts.sorted - # uniq fonts.sorted > fonts.uniq - # diff fonts.uniq fonts.sorted | grep '^> ' - skip="andika - cantarell - cardo - exo - inconsolata - jomolhari - khmer - nunito - roboto - signika - viga - vollkorn" - - # Avoid what is already in portage. - s=0 - for j in $skip; do - if [ "$j" = "$font" ]; then - s=1 - break - fi - done - if [ "$s" = 1 ]; then + if [ -d "/usr/portage/media-fonts/$font" ]; then echo "Skipping: $shlicense/$font" continue fi + existed=0 echo "Generating: $shlicense/$font" + if [ -d "$font" ]; then + existed=1 + fi mkdir -p "$font" cd "$font" || exit 1 @@ -117,6 +96,8 @@ EOF </pkgmetadata> EOF - ebuild "${font}-9999.ebuild" digest + if [ "$existed" = 1 ]; then + ebuild "${font}-9999.ebuild" digest + fi cd - >/dev/null done