PageRenderTime 56ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/shlomif-settings/Bash/Themes/themes/lm-solve/source.bash

https://bitbucket.org/shlomif/shlomif-computer-settings
BASH | 108 lines | 73 code | 17 blank | 18 comment | 3 complexity | fa8f67479ba83d6a8ff8009be69bd82a MD5 | raw file
  1. load_common mymake
  2. load_common completion
  3. load_common prompt
  4. base="$HOME/progs/perl/mazes"
  5. hg_base="$base/hg"
  6. trunk="$hg_base/lm-solve-source"
  7. this="$trunk"
  8. PATH="$inst_modules_dir/bin/:$PATH"
  9. setup()
  10. {
  11. (
  12. if ! test -d "$this" ; then
  13. mkdir -p "$hg_base"
  14. cd "$hg_base"
  15. hg clone 'ssh://hg@bitbucket.org/shlomif/lm-solve-source'
  16. fi
  17. cd "$this"
  18. )
  19. }
  20. # Make sure that gvim's filename completion ignores filenames that it should
  21. # not edit.
  22. __dist_name()
  23. {
  24. (__check_for_distro &&
  25. cat META.yml | grep "^name:" | sed 's/^name: *//'
  26. )
  27. }
  28. __version()
  29. {
  30. (__check_for_distro &&
  31. cat META.yml | grep "^version:" | sed 's/^version: *//'
  32. )
  33. }
  34. __check_for_distro()
  35. {
  36. if [ -e "META.yml" ] ; then
  37. return 0
  38. else
  39. echo "Not a distro dir" 1>&2
  40. return 1
  41. fi
  42. }
  43. __test_distribution()
  44. {
  45. __check_for_distro &&
  46. (
  47. make disttest
  48. rm -fr "$(__dist_name)-$(__version)"
  49. )
  50. }
  51. cd $this
  52. __install_to_temp()
  53. {
  54. (
  55. make -f "$modules_makefile" "$(pwd)"
  56. )
  57. }
  58. # (
  59. # if [ -e Makefile.PL ] ; then
  60. # perl Makefile.PL PREFIX="$inst_modules_dir"
  61. # make
  62. # make test
  63. # make install
  64. # elif [ -e Build.PL ] ; then
  65. # perl Build.PL
  66. # ./Build
  67. # ./Build test
  68. # ./Build install prefix="$inst_modules_dir"
  69. # else
  70. # echo "Unknown instamethod" 1>&2
  71. # exit 1
  72. # fi
  73. # )
  74. __prepare_install_all_to_temp_makefile()
  75. {
  76. (cd "$build_scripts_dir" && perl create-makefile.pl)
  77. }
  78. __install_all_to_temp()
  79. {
  80. (
  81. make -f "$modules_makefile" all
  82. )
  83. }
  84. prompt()
  85. {
  86. __prompt_cmd \
  87. "\$trunk=$trunk" \
  88. "\$base=$base" \
  89. "~=$HOME"
  90. }
  91. proj_name='lm-solve';