Make: Support shallow git clones for testing
Since commit 1ec9b94
, we derive the version number from git tags with
build-aux/git-version-gen. When a shallow clone doesn't include a
suitable tag, this fails, and make refuses to build anything. Since
Travis uses git-clone --depth=50, it'll break as soon as we've got
more than 50 commits since the last release.
Support arbitrarily shallow clones for limited purposes like testing
by falling back from a proper V.N-H version number to UNKNOWN-H.
To guard against use of such builds for other purposes, log a warning
on server startup, and print one on player login.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
41ce9e37fd
commit
5e1b590867
4 changed files with 16 additions and 5 deletions
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 2000
|
||||
* Markus Armbruster, 2004-2014
|
||||
* Markus Armbruster, 2004-2017
|
||||
* Ron Koenderink, 2004-2009
|
||||
*/
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
#include "optlist.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
static int command(void);
|
||||
static int status(void);
|
||||
|
@ -63,6 +63,11 @@ player_main(struct player *p)
|
|||
pr("\n"
|
||||
"*** Server configured for testing ***\n"
|
||||
"*** If you see this in a game, it is misconfigured! ***\n");
|
||||
else if (strstr(version, "UNKNOWN-"))
|
||||
pr("\n"
|
||||
"*** Server version is unknown ***\n"
|
||||
"*** If you see this in a game, it was built incorrectly! ***\n");
|
||||
|
||||
if (init_nats() < 0) {
|
||||
pr("Server confused, try again later\n");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue