Browse Source

Do not cripple version if last tag was not found

IOW, it's not guaranteed that once we are in git repo we can always see
the tag.  VERSION should be reliable, though.
Alois Mahdal 10 years ago
parent
commit
a4c39428e3
1 changed files with 1 additions and 5 deletions
  1. 1
    5
      utils/mkit/include/build.sh

+ 1
- 5
utils/mkit/include/build.sh View File

161
     # meta-data is to *identify* the code, and provide safe path back
161
     # meta-data is to *identify* the code, and provide safe path back
162
     # to tree; commit refs are already perfect for that.
162
     # to tree; commit refs are already perfect for that.
163
     #
163
     #
164
-    # FIXME:  The assumpton "if we are in git repo, we can read version
165
-    #         from tags" fails if we are in shallow clone made from
166
-    #         other than a tagged commit.
167
-    #
168
     # FIXME:  Using PRERELEASE for release IDs may not be compatible with
164
     # FIXME:  Using PRERELEASE for release IDs may not be compatible with
169
     #         release strategy implemented in release.sh
165
     #         release strategy implemented in release.sh
170
     #
166
     #
184
         then    # the tree is "dirty", i.e. has been edited
180
         then    # the tree is "dirty", i.e. has been edited
185
             local dirty=dirty
181
             local dirty=dirty
186
         fi
182
         fi
187
-        version=${lasttag:1}
183
+        test -n "$lasttag" && version=${lasttag:1}
188
         local suffix=""
184
         local suffix=""
189
         case $prerl:$commit:$dirty in
185
         case $prerl:$commit:$dirty in
190
             ::)        suffix=""                       ;;
186
             ::)        suffix=""                       ;;