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.

50 lines
1.3 KiB

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