Browse code

improvements to .gitignore

Nat! authored on 12-09-2016 12:30:10
Showing 5 changed files
... ...
@@ -1,4 +1,6 @@
1
-# mulle-bootstrap, cross platform dependency manager for Linux, OS X, FreeBSD, Windows
1
+# mulle-bootstrap, cross platform dependency manager using bash and cmake
2
+
3
+... for Linux, OS X, FreeBSD, Windows
2 4
 
3 5
 Everything `mulle-bootstrap` installs is relative to your project root, creating
4 6
 a virtual environment. Downloaded packages and binaries don't "pollute" your
... ...
@@ -9,14 +11,13 @@ In times of need, it can also checkout [svn](//andreasjacobsen.com/2008/10/26/su
9 11
 * builds [cmake](//blog.cppcms.com/post/54),
10 12
 [xcodebuild](//devcodehack.com/xcode-sucks-and-heres-why/) and
11 13
 [configure](//quetzalcoatal.blogspot.de/2011/06/why-autoconf-sucks.html)
12
-projects and installs there output into a "dependencies" folder.
14
+projects and installs their output into a "dependencies" folder.
13 15
 * installs [brew](//dzone.com/articles/why-osx-sucks-and-you-should) binaries and
14
-libraries into an "addictions" folder
16
+libraries into an "addictions" folder (on participating platforms)
15 17
 * runs on **OS X**, **FreeBSD** (without brew), **Linux**, **Windows** with
16 18
   MINGW bash (without brew)
17 19
 * certainly not a "lightweight" project with ca. 10000 lines of shell script
18 20
   code
19
-* reduced configurability of mulle-bootstrap, since I didn't use it so far much and it slows things down on MINGW
20 21
 
21 22
 
22 23
 ## Tell me more
... ...
@@ -48,6 +48,9 @@ inheritance scheme.
48 48
 * script names have changed. For instance, post-install.sh is now post-fetch.sh.
49 49
 * dist-clean is gone, now dist means "clean dist". You can also say dist clean
50 50
 it doesn't matter.
51
+* don't pollute .gitignore with embedded repositories inside .repos#
52
+* reduced configurability of mulle-bootstrap, since I didn't use it so far much and it slows things down on MINGW
53
+
51 54
 
52 55
 1.1
53 56
 ===
... ...
@@ -1104,6 +1104,43 @@ ${clone}"
1104 1104
 }
1105 1105
 
1106 1106
 
1107
+append_dir_to_gitignore_if_needed()
1108
+{
1109
+
1110
+   case "${1}" in
1111
+      "${CLONES_SUBDIR}/"*)
1112
+         return 0
1113
+      ;;
1114
+   esac
1115
+
1116
+   local directory
1117
+
1118
+   # make it absolute dir for git
1119
+
1120
+   case "$1" in
1121
+      /*/)
1122
+         directory="$1"
1123
+      ;;
1124
+      /*)
1125
+         directory="$1/"
1126
+      ;;
1127
+      */)
1128
+         directory="/$1"
1129
+      ;;
1130
+      *)
1131
+         directory="/$1/"
1132
+      ;;
1133
+   esac
1134
+
1135
+   fgrep -s -x "${directory}" .gitignore > /dev/null 2>&1
1136
+   if [ $? -ne 0 ]
1137
+   then
1138
+      exekutor echo "${directory}" >> .gitignore || fail "Couldn\'t append to .gitignore"
1139
+      log_info "Added \"${directory}\" to \".gitignore\""
1140
+   fi
1141
+}
1142
+
1143
+
1107 1144
 clone_embedded_repository()
1108 1145
 {
1109 1146
    local dstprefix
... ...
@@ -52,7 +52,7 @@ eval_exekutor()
52 52
          echo "==>" "$@" >&2
53 53
       else
54 54
          echo "==>" "$@" > "${MULLE_LOG_DEVICE}"
55
-      fi         
55
+      fi
56 56
    fi
57 57
 
58 58
    if [ "${MULLE_EXECUTOR_DRY_RUN}" != "YES" ]
... ...
@@ -78,7 +78,7 @@ exekutor()
78 78
          echo "==>" "$@" >&2
79 79
       else
80 80
          echo "==>" "$@" > "${MULLE_LOG_DEVICE}"
81
-      fi         
81
+      fi
82 82
    fi
83 83
 
84 84
    if [ "${MULLE_EXECUTOR_DRY_RUN}" != "YES" ]
... ...
@@ -834,17 +834,6 @@ write_protect_directory()
834 834
 }
835 835
 
836 836
 
837
-append_dir_to_gitignore_if_needed()
838
-{
839
-   grep -s -x "$1/" .gitignore > /dev/null 2>&1
840
-   if [ $? -ne 0 ]
841
-   then
842
-      exekutor echo "$1/" >> .gitignore || fail "Couldn\'t append to .gitignore"
843
-      log_info "Added \"$1/\" to \".gitignore\""
844
-   fi
845
-}
846
-
847
-
848 837
 # ####################################################################
849 838
 #                               Init
850 839
 # ####################################################################
... ...
@@ -317,7 +317,7 @@ mark_all_embedded_repositories_zombies()
317 317
 
318 318
       for symlink in `ls -1d "${path}/"*`
319 319
       do
320
-         i="`cat "$symlink"`" || fail "Old style mulle-bootstrap files detected, dist-clean it"
320
+         i="`cat "$symlink" 2>/dev/null`" || fail "Old style mulle-bootstrap files detected, \`mulle-bootstrap dist clean\` it ($PWD/$symlink)"
321 321
          name="`basename -- "$i"`"
322 322
          exekutor touch "${zombiepath}/${name}"
323 323
       done