]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
newvers.sh: Unbreak building in Git repositories.
author0mp <0mp@FreeBSD.org>
Thu, 27 Sep 2018 12:15:31 +0000 (12:15 +0000)
committer0mp <0mp@FreeBSD.org>
Thu, 27 Sep 2018 12:15:31 +0000 (12:15 +0000)
commit56e8b453375628f392df8d65725b3d924735c77f
tree1c9c35c3ca12f99467e6e789c979066a4332017e
parente65e357a63d489e834e67ac32c7fdc78f985ed77
newvers.sh: Unbreak building in Git repositories.

Building the kernel in Git repositories when git-svn is not available and
the "help.autocorrect" Git parameter is enabled results in Git trying to
replace the "svn" command (it does not know) with "serve". As a result the
output of the "git server" command is appended to the value of the
environmental variable VERINFO, which causes the auto generated vers.c
file to contain invalid C syntax (missing newline escapes):

    #define "@(#)FreeBSD 12.0-ALPHA7  r000eversion 2
    0015agent=git/2.19.0
    000cls-refs
    0012fetch=shallow
    0012server-option
    0000=5e2272613fa(splash-vt)"
    #define VERSTR "FreeBSD 12.0-ALPHA7  r000eversion 2
    0015agent=git/2.19.0
    000cls-refs
    0012fetch=shallow
    0012server-option
    0000=5e2272613fa(splash-vt)\n"

Using `-c help.autocorrect=0` seems to be a good solution as it does not
modify user's environment. I am not sure, however, if we should use
programs (or Git commands), which we are not sure exist (we never check if
git-svn is available on the host), as there may be more unexpected
behaviors like this one.

Reviewed by: eadler, emaste, krion
Approved by: re (gjb), krion (mentor)
Sponsored by: Bally Wulff Games & Entertainment GmbH
Differential Revision: https://reviews.freebsd.org/D17271
sys/conf/newvers.sh