提交 5e3c5db7 authored 作者: Travis Cross's avatar Travis Cross

Don't show unclean in version string for now

Showing whether the git repository is clean at the time of build will
be useful, but currently something in our bootstrap/configure/early
make process is causing the tree to look unclean at just the wrong
moment and clean builds are showing up as unclean.
上级 14cb9af6
......@@ -9,6 +9,8 @@
#include <sys/wait.h>
#include <time.h>
static int show_unclean = 0;
static int sys(char *buf, int buflen, char *cmd) {
int i, p[2];
if (pipe(p)) return 255;
......@@ -50,7 +52,7 @@ int main(int argc, char **argv) {
if ((sys1(xcommit,sizeof(xcommit),"git rev-list -n1 --abbrev=10 --abbrev-commit HEAD")))
return 1;
snprintf(xver,sizeof(xver),"+git~%s~%s",xfdate,xcommit);
if ((sys(NULL,0,"git diff-index --quiet HEAD"))) {
if (show_unclean && (sys(NULL,0,"git diff-index --quiet HEAD"))) {
char buf[256], now[256]; time_t now_t=time(NULL); struct tm *now_tm;
if (!(now_tm=gmtime(&now_t))) return 1;
strftime(now,sizeof(now),"%Y%m%dT%H%M%SZ",now_tm);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论