瀏覽代碼

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 年之前
父節點
當前提交
a4c39428e3
共有 1 個檔案被更改,包括 1 行新增5 行删除
  1. 1
    5
      utils/mkit/include/build.sh

+ 1
- 5
utils/mkit/include/build.sh 查看文件

@@ -161,10 +161,6 @@ get_version() {
161 161
     # meta-data is to *identify* the code, and provide safe path back
162 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 164
     # FIXME:  Using PRERELEASE for release IDs may not be compatible with
169 165
     #         release strategy implemented in release.sh
170 166
     #
@@ -184,7 +180,7 @@ get_version() {
184 180
         then    # the tree is "dirty", i.e. has been edited
185 181
             local dirty=dirty
186 182
         fi
187
-        version=${lasttag:1}
183
+        test -n "$lasttag" && version=${lasttag:1}
188 184
         local suffix=""
189 185
         case $prerl:$commit:$dirty in
190 186
             ::)        suffix=""                       ;;