#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "fonts(TrueType font collection)シリーズの選択"   --checklist "fontsシリーズの中からインストールしたいパッケージを 選んでください．カーソルの上下キーで 対象を選択し，space キーでマーク(X)します． Enter キーでインストールを開始します．" 24 72 15 "IPAexfont" "IPAex TrueTypeフォント" "on" \
"IPAfont" "IPA TrueTypeフォント" "on" \
"VLGothic" "VLGothic TrueTypeフォント" "on" \
"dejavu_fonts_ttf" "Unicode用TTフォント" "on" \
"font_adobe_utopia_type1" "Adobe Utopia Type1 フォント" "on" \
"font_alias" "フォント別名定義集" "on" \
"font_bh_ttf" "B&H Lucida TT フォント" "on" \
"font_bh_type1" "B&H Lucida Type1 フォント" "on" \
"font_ibm_type1" "IBM Type1 フォント" "on" \
"font_xfree86_type1" "Type1 カーソルフォント" "on" \
"fonts_migmix" "MigMix TTフォント" "on" \
"fonts_migu" "TTフォントMigu" "on" \
"liberation_fonts_ttf" "Liberation TTフォント" "on" \
"noto_fonts" "Notoフォント" "on" \
"noto_fonts_cjk" "Noto フォント CJK" "on" \
"noto_fonts_emoji" "Noto フォント Emoji" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in IPAexfont IPAfont VLGothic dejavu_fonts_ttf font_adobe_utopia_type1 font_alias font_bh_ttf font_bh_type1 font_ibm_type1 font_xfree86_type1 fonts_migmix fonts_migu liberation_fonts_ttf noto_fonts noto_fonts_cjk noto_fonts_emoji  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in IPAexfont IPAfont VLGothic dejavu_fonts_ttf font_adobe_utopia_type1 font_alias font_bh_ttf font_bh_type1 font_ibm_type1 font_xfree86_type1 fonts_migmix fonts_migu liberation_fonts_ttf noto_fonts noto_fonts_cjk noto_fonts_emoji ; do
    if grep "$PACKAGE" /tmp/SeTpkgs 1> /dev/null 2> /dev/null ; then
        echo "$PACKAGE: ADD" >> /tmp/SeTnewtag
    else echo "$PACKAGE: SKP" >> /tmp/SeTnewtag
    fi
done
rm -f /tmp/SeTpkgs

