show-vine-default.sh 802 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # $Id: show-vine-default.sh,v 1.2 2009/05/20 15:31:29 munepi Exp munepi $
  3. if [ $# -ne 1 ]; then
  4. cat<<EOF
  5. Usage: $(basename $0) <version>
  6. EOF
  7. exit 1
  8. fi
  9. VERSION=$1
  10. if [ $(egrep -m 1 $VERSION /var/lib/emacsen-common/installed-flavors) ]; then
  11. FLAVOR=$(egrep -m 1 $VERSION /var/lib/emacsen-common/installed-flavors)
  12. else
  13. exit 1
  14. fi
  15. [ -d /etc/${FLAVOR} ] || exit 1
  16. ORDER="base faces"
  17. ORDER="${ORDER} $(ls /etc/${FLAVOR}/site-start.d/*-init.el | \
  18. sed -e "s!.*/[0-9]*\(.*\)-init\.el!\1!g")"
  19. LIST="$(find /usr/share/${FLAVOR}/site-lisp/ \
  20. -regex '.*/vine-default.*\.el')"
  21. for PKG in $ORDER; do
  22. if [ $(echo "$LIST" | egrep $PKG) ]; then
  23. EL=$(echo "$LIST" | egrep $PKG | head -1)
  24. echo ";;; Begin $EL"
  25. cat $EL
  26. echo ";;; End of $EL"
  27. echo ""
  28. fi
  29. done
  30. exit