From patchwork Fri Sep 6 17:21:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3808 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6bd4:b0:5b9:581e:f939 with SMTP id c20csp279491max; Fri, 6 Sep 2024 10:21:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX4mVLuMYcyWAlctR+Q8c9sr2VAZHDqtRSHjlJbYTyOi4Tttkl8yz6jUt4AhD9muKPsW4zf+W97dKk=@openvpn.net X-Google-Smtp-Source: AGHT+IGTH2ejE6K30EgQdVi12q9GZmoHOnGrnONWa5zPhR89bgZNXbLv6y3dn0c61KkiFy/lRMxk X-Received: by 2002:a05:6a21:3513:b0:1ca:edd5:9254 with SMTP id adf61e73a8af0-1cf2a031c11mr145841637.16.1725643310659; Fri, 06 Sep 2024 10:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725643310; cv=none; d=google.com; s=arc-20240605; b=WP1+S+mn6Oe26gSeMOEUkzbREZjq0vrwzrwG+Y8UpMC3+DjVuYD4YJ+p+KdaAlIBRU z3a+VKuORYHuFGcqajvN37kD7ROcL2mqTaSTXOXmwgbEas0z1copCrJBluYN3aGbVPfM PSWVbZj1l68GlCRRiKyvEdTNO7r9hxcdVKMgYnJuEwa8YCfdEGAFdYSJul0vjHRyEl7E OIxZHlTszf52K0ktPYOmfywJquKu4iIir9Cz+vmx79zi58GsJNpCsCXLXVBxhIZXUJgS E7eNptiz0CpmVCU1nmoIWdSsy8YqOW5BZ3/N/hR76fhshe2EVLkTzOGtY4kRjzPQW9HE 8Bww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=eFXyPNJwoTabR45AyBOOxrF4JaEoilm8JuNiR3K69EU=; fh=mh9xDPVZkryxU75B0yc8tt5Kym8S5ZpNbm0rMRiqJw0=; b=SuWmnttIMXK9VrOg/iFWD8c+Q4eKZKwpYb0xj83gMh4SIFGFOSDZY8ix2luyBk8n0m gRjTHTdKG2uPMOe+0aJRr+X7HwNXD8nJNSurWFGzqC1vTZlrqIYW3O1As8EXefQu5T8v HtbDbe0iIgporq986N9bNZ78aweNUOI7n7ArcrQCAgLmmOI5xaHuQ1c/hSzIYi5eZVvA 4T6+oyFnIXDDgulbtmdzoNI7alGw7OwNiCCeC/oyRcm/ddI/u5GbKf/+G4+Pqz7rqMFo 7LUnxnR1fXPCAsiBInDRuXkh35dosbuEIUPw9JP50/GSFRY/kKlatFWQLz+RVjrUV12L Wy/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=RPHU3CLM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HSuSPZr1; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=ViKSYJpm; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id d2e1a72fcca58-71797762928si3244509b3a.313.2024.09.06.10.21.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 10:21:50 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=RPHU3CLM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HSuSPZr1; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=ViKSYJpm; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1smceJ-0005b1-R8; Fri, 06 Sep 2024 17:21:31 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1smceI-0005ap-HW for openvpn-devel@lists.sourceforge.net; Fri, 06 Sep 2024 17:21:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ptA2+9AxqRRobsleDPDrI9/RHNxtocJvr9C3cRGgJGQ=; b=RPHU3CLMWD0PI/DjcQwNOZUL/d h7oMbK1CR+lh1rlzdkyALclweX4Sk9z9thoPfoI18VY+WjG5MeO1tC435sEg4Z5IllByAN/YSMrtx Nzimzc5zrGcCfmC6K9GFHSD1F3xokvazoStWpdsHRbkxD0RhaNk2yt37CqihrP1s6eas=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ptA2+9AxqRRobsleDPDrI9/RHNxtocJvr9C3cRGgJGQ=; b=HSuSPZr1q7DckDkopmqrPjrHXI XLeh+M/0+9byuYY5Hc++yDnqg8UrvTpqAUNaPtKaMphBBwq4kG9ZZdZDBNTG9F37jYwQSQ1xaNx8k cbF8wtpQKTUbd/LAq7Y9NaKSNe0eMgK6tejdvHlORQnW3zKAe5N2a7121lKodmDyYxIU=; Received: from mout-p-101.mailbox.org ([80.241.56.151]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1smceG-0002ZI-FI for openvpn-devel@lists.sourceforge.net; Fri, 06 Sep 2024 17:21:29 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4X0jgb0Ms6z9sFb; Fri, 6 Sep 2024 19:21:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1725643275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ptA2+9AxqRRobsleDPDrI9/RHNxtocJvr9C3cRGgJGQ=; b=ViKSYJpmXjSCrE2RxGW3/7QegTYIg9nb3T4m/p2si6EUU3sqEr972Dut7L1ntYQzIPVCjT 6kqnkhmjfFpLT09e/D68FLGSznpgPog7UTinkuTpt1uOdqqIhU78OgeCkoyJKbw9vG85Zg krsdZctGVsHEW+M7kCo6FmRSV+BEdUhmhdVBZvdSZHKGDGFXSlgKv2Ag/VGQr+68SO3gA5 b2Y6nHJ27CheM5Tas6XHIGIgwo3iUjPwpssK/8F8N59iEaGHfCsAqAStClcxYt+IhGZ1NF T0DVKOXDBrUj7qwmc9gnsnpp9/fvYCOHtDPPhqF2ds4wFh5fKXSINyovxuuoFA== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Fri, 6 Sep 2024 19:21:12 +0200 Message-Id: <20240906172112.87148-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: E.g. if you use openvpn as a git submodule, it can be a file that points to the parent's git directory. The changes to Makefile.am are not strictly required, they still work with that case, but I wanted to keep the usage consistent. Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.151 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1smceG-0002ZI-FI Subject: [Openvpn-devel] [PATCH v3] configure: Allow to detect git checkout if .git is not a directory X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yuriy Darnobyt , Arne Schwabe Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1809468160217063114?= X-GMAIL-MSGID: =?utf-8?q?1809468160217063114?= E.g. if you use openvpn as a git submodule, it can be a file that points to the parent's git directory. The changes to Makefile.am are not strictly required, they still work with that case, but I wanted to keep the usage consistent. Change-Id: I9b7a3df012e7606ddb04a944e3fa33247180e8dd Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Acked-by: Yuriy Darnobyt --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/675 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe Yuriy Darnobyt diff --git a/Makefile.am b/Makefile.am index 87230fe..84b7112 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,9 +75,9 @@ README.wolfssl config-version.h: - @CONFIGURE_GIT_CHFILES="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \ - CONFIGURE_GIT_UNCOMMITTED="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \ - CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \ + @CONFIGURE_GIT_CHFILES="`$(GIT) -C \"$(top_srcdir)\" diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \ + CONFIGURE_GIT_UNCOMMITTED="`$(GIT) -C \"$(top_srcdir)\" diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \ + CONFIGURE_GIT_REVISION="`$(GIT) -C \"$(top_srcdir)\" rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`$(GIT) -C \"$(top_srcdir)\" rev-parse --short=16 HEAD`"; \ echo "#define CONFIGURE_GIT_REVISION \"$${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \ echo "#define CONFIGURE_GIT_FLAGS \"$${CONFIGURE_GIT_CHFILES}$${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp diff --git a/configure.ac b/configure.ac index 9ce826c..ea0da1f 100644 --- a/configure.ac +++ b/configure.ac @@ -1308,9 +1308,11 @@ AC_MSG_CHECKING([git checkout]) GIT_CHECKOUT="no" -if test -n "${GIT}" -a -d "${srcdir}/.git"; then - AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h]) - GIT_CHECKOUT="yes" +if test -n "${GIT}"; then + if ${GIT} -C "$srcdir" rev-parse --is-inside-work-tree >/dev/null 2>&1; then + AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h]) + GIT_CHECKOUT="yes" + fi fi AC_MSG_RESULT([${GIT_CHECKOUT}])