system: Make the git version code more robust.

Really confusing sequence errors if Factor vm isn't compiled with proper git label.

e.g. good: -DFACTOR_GIT_LABEL="heads/master-102fe6154e9deec5dff38ee70519f7bbe506f6ce"

bad: -DFACTOR_GIT_LABEL=""
before this patch gave an integer comparison error comparing ``f 16 <``
handle-patch-and-put
Doug Coleman 2018-07-22 11:32:02 -05:00
parent 102fe6154e
commit 2b4d2a4a13
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
! Copyright (c) 2007, 2010 slava pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs continuations init io kernel kernel.private make
math math.parser namespaces sequences ;
USING: accessors assocs continuations init io kernel
kernel.private make math.parser namespaces sequences splitting ;
IN: system
PRIMITIVE: (exit) ( n -- * )
@ -27,10 +27,10 @@ UNION: unix macosx linux ;
: vm-git-label ( -- string ) \ vm-git-label get-global ;
: vm-git-ref ( -- string )
vm-git-label CHAR: - over last-index head ;
vm-git-label "-" split1-last drop ;
: vm-git-id ( -- string )
vm-git-label CHAR: - over last-index 1 + tail ;
vm-git-label "-" split1-last nip ;
: vm-compiler ( -- string ) \ vm-compiler get-global ;