Module Name:    src
Committed By:   martin
Date:           Mon Sep 11 14:41:51 UTC 2023

Modified Files:
        src [netbsd-10]: build.sh

Log Message:
Pull up following revision(s) (requested by khorben in ticket #367):

        build.sh: revision 1.374

build.sh: add support for git worktree

Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)
   src$ git worktree add ../src-clean-tree
   [...]
   src$ (cd ../src-clean-tree && ./build.sh tools)
   [...]
   ERROR: Cannot determine VCS for '.../src-clean-tree/'


To generate a diff of this commit:
cvs rdiff -u -r1.365.2.1 -r1.365.2.2 src/build.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.365.2.1 src/build.sh:1.365.2.2
--- src/build.sh:1.365.2.1	Mon Mar 13 21:40:24 2023
+++ src/build.sh	Mon Sep 11 14:41:51 2023
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.365.2.1 2023/03/13 21:40:24 jdc Exp $
+#	$NetBSD: build.sh,v 1.365.2.2 2023/09/11 14:41:51 martin Exp $
 #
 # Copyright (c) 2001-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2010,7 +2010,7 @@ createmakewrapper()
 	eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.365.2.1 2023/03/13 21:40:24 jdc Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.365.2.2 2023/09/11 14:41:51 martin Exp $
 # with these arguments: ${_args}
 #
 
@@ -2371,7 +2371,7 @@ setup_mkrepro()
 
 			t=$("${cvslatest}" ${cvslatestflags} "${d}")
 			vcs=cvs
-		elif [ -d "${d}.git" ]; then
+		elif [ -d "${d}.git" -o -f "${d}.git" ]; then
 			t=$(cd "${d}" && git log -1 --format=%ct)
 			vcs=git
 		elif [ -d "${d}.hg" ]; then

Reply via email to