OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

  1. #!/bin/bash
  2. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # T2 SDE: misc/GenDepGraph.sh
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- T2-COPYRIGHT-NOTE-END ---
  15. if [ -z "$1" ] ; then
  16. cat 1>&2 <<-EOT
  17. graphviz dependency graph generator
  18. usage:
  19. $0 <list of package dirs>
  20. output can be compiled with graphviz, for example:
  21. # $0 package/kde/* > kde-deps.dot
  22. # dot -Tps kde-deps.dot > kde-deps.ps
  23. EOT
  24. exit 1
  25. fi
  26. pattern=`mktemp`
  27. result=`mktemp`
  28. dscs="";
  29. for p in $@ ; do
  30. desc=`ls $p/*.cache 2> /dev/null | head -n 1`
  31. if [ -r "$desc" ] ; then
  32. dscs="$dscs "$desc
  33. echo '\[DEP\] '`basename $p` >> $pattern
  34. else
  35. echo "warning: no cache file for $p" 1>&2
  36. fi
  37. done
  38. grep -f $pattern $dscs > $result
  39. echo "Digraph G {"
  40. sed 's,.*/\([^.]*\).*\[DEP\] \(.*\),\"\1\" -> \"\2\",g' $result
  41. echo "}"
  42. rm $pattern
  43. rm $result