From patchwork Thu Aug 6 01:05:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF4C61731 for ; Thu, 6 Aug 2020 01:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCBF82173E for ; Thu, 6 Aug 2020 01:05:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NIvJLwQE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726787AbgHFBFb (ORCPT ); Wed, 5 Aug 2020 21:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbgHFBFL (ORCPT ); Wed, 5 Aug 2020 21:05:11 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43550C061756 for ; Wed, 5 Aug 2020 18:05:11 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 9so7343464wmj.5 for ; Wed, 05 Aug 2020 18:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fxbI3gNG8JdTQkG5Y25d1d2hrsEBJ51XfvP7YONYgA8=; b=NIvJLwQECtlsLtO4HRmDIAnYztOM3hqOjQ1SVNRjUkwS4dt6z5T3z76y46Xa269ej/ fFk2y5+CiVOsQv6JSnv0LvbvErCj//gLmdCQW0TX68+1tT57VTGvgPRkzB/7ULfFQ2FM advuBYpnDfs149nW3osBMNEP1RKEpIWKWBnxUNVyqyGBBRnL5OXtgfB0s083DpjdRafC Urqhbkg+kg4v58k2mmM0dPfSFPFDldY4Cvf/HOTy8i+xDuWVJqyLTr+j8qepEx+qXpPy Xqgmny3RT0UOcaE+6C5bQkNjnxiOfsQk647sI7+k9gIeL6SLJmUnyYn8drJmNJ4jp2jK /sYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fxbI3gNG8JdTQkG5Y25d1d2hrsEBJ51XfvP7YONYgA8=; b=f6xnJjV0dFzF+TmMUhBQd1bDsma77ipQK8056f70ZBkQI3vrR2JJ0/SDSOZ4CMyNMS Ytgo8kLQUqMsG0eL0EigCFAmyZ7/HVSqzki0LctJxp0mqLcHqcaEOGJnhbdK6tRk0X2z 6DuOKoKFzFgK7nxAK5h56ci48w9KInbBVPTlyu+/+th85vZUvrveTBz2k90tF7KpkTj0 iODh7zefYcBjoOw53mOig4YtiUmx7JYKNcRVFDuZe4IbT7SaWhvGHsJRxGS/vGatMgj6 K5YBoulFot2N12/jr6HdLgZDstIhbRM0FCIgJVwn9XNod6txt8vK562zCT84Xw3uHccy J6/g== X-Gm-Message-State: AOAM532sWdEmoHEDsyh69XjOZZw9YodDkFz5VA3BSsDrgFH7cjs6szFl QOlunoydxpYBbxhoN/mzX+hAE1c1 X-Google-Smtp-Source: ABdhPJz0Irz18C17CIt7qY5sHMJ2ru55edOyDUP3Yap9lWrF0jPVYqtZO9D59o0A1f6IjeObijGM3Q== X-Received: by 2002:a1c:7915:: with SMTP id l21mr5814425wme.50.1596675906987; Wed, 05 Aug 2020 18:05:06 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m1sm4314366wmc.28.2020.08.05.18.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 18:05:06 -0700 (PDT) Message-Id: <1f63b4fc7c2ae1970d7226bbf0b66901528fb9d8.1596675905.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "lufia via GitGitGadget" Date: Thu, 06 Aug 2020 01:05:01 +0000 Subject: [PATCH 1/4] Use $(SHELL_PATH) instead of sh in Makefile. Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "KADOTA, Kyohei" , lufia Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: lufia In the not POSIX environment, like Plan 9, sh might not be looked up in the directories named by the $PATH. Signed-off-by: lufia --- config.mak.uname | 12 ++++++------ git-gui/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config.mak.uname b/config.mak.uname index c7eba69e54..f3eb2b91a2 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -4,12 +4,12 @@ # Microsoft's Safe Exception Handling in libraries (such as zlib). # Typically required for VS2013+/32-bit compilation on Vista+ versions. -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') -uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') -uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') -uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') +uname_S := $(shell $(SHELL_PATH) -c 'uname -s 2>/dev/null || echo not') +uname_M := $(shell $(SHELL_PATH) -c 'uname -m 2>/dev/null || echo not') +uname_O := $(shell $(SHELL_PATH) -c 'uname -o 2>/dev/null || echo not') +uname_R := $(shell $(SHELL_PATH) -c 'uname -r 2>/dev/null || echo not') +uname_P := $(shell $(SHELL_PATH) -c 'uname -p 2>/dev/null || echo not') +uname_V := $(shell $(SHELL_PATH) -c 'uname -v 2>/dev/null || echo not') ifdef MSVC # avoid the MingW and Cygwin configuration sections diff --git a/git-gui/Makefile b/git-gui/Makefile index f10caedaa7..c47603c397 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -11,9 +11,9 @@ GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN -include GIT-VERSION-FILE -uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') -uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') +uname_S := $(shell $(SHELL_PATH) -c 'uname -s 2>/dev/null || echo not') +uname_O := $(shell $(SHELL_PATH) -c 'uname -o 2>/dev/null || echo not') +uname_R := $(shell $(SHELL_PATH) -c 'uname -r 2>/dev/null || echo not') SCRIPT_SH = git-gui.sh GITGUI_MAIN := git-gui From patchwork Thu Aug 6 01:05:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702657 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5972F13B6 for ; Thu, 6 Aug 2020 01:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47A3422CF7 for ; Thu, 6 Aug 2020 01:05:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZBzAAwA+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbgHFBF2 (ORCPT ); Wed, 5 Aug 2020 21:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbgHFBFK (ORCPT ); Wed, 5 Aug 2020 21:05:10 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6321EC061575 for ; Wed, 5 Aug 2020 18:05:09 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 9so7343486wmj.5 for ; Wed, 05 Aug 2020 18:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=4UuM5/ldThGYvw7XCsyyhq8treS7zYTiB/PDxgaYZOI=; b=ZBzAAwA+yry85/CTaVNZRpOaNpJ1lcpllUehK0/vBQJt9bdWo1v97XG4PCqK6acHc9 nZIf8XQFmV7l6uVn5Hxpkj+uwW2yPiDnNQmftlWsmvwWih0BBW+AiHu9WJal6mInLCot +9xWdtEF97OgzYNzpvAiW9l/8ES4PYfYsV0hYy7JLpyZ1AWhbc0dtDlzMr0BF8CpZvz8 KuNWfrupmO8XJvCN7UYCghMSIyP25Zees4E7+F17w6vZbiJoycKqWRIaWILsBHusFVQ+ gbFA+DYO7Zp0qwSCC1xrZIS0gdbk1CvwfTNw3zRskt8znG4Y/YpnHEK9mrQ4bS95w6Kd JNgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=4UuM5/ldThGYvw7XCsyyhq8treS7zYTiB/PDxgaYZOI=; b=jdL5ahcYF4sye1DZbwl+K/OJ4YIMkehDEqkMJ9+QL2t53Q3ynNb8cn9yUcgsxUL49i RoBedXFU6N9HfFvUNsOibuzoShkmScyn9A6bF0xx5p5POhxQE0L66k4ehhquV8HvbrgC PoPUBFqizJ4zyKwWGwMT2akz2Rbag3KHZcEr3bDAjX0BtRbBz/P5LGNz0A6x52TPgmBj 6TqWKP4ngmWQwQpSu6vMoZBcD+WACyikEvAWqdXmEnk/mWpCqzljI5t1CPbirTKC4XXS LRurN7pdN8jUO7KJ5UM/6lSa7BwItzvcPbFfemtXQM5psc3zSMn+4LsN5GH/czuGd4Xs 7hew== X-Gm-Message-State: AOAM530wS8ecCkKir+ABRBMWW3Ye60A9SEnVRZEuPr9+8N2hvGb7xq4s T+A0YYhkhBj2yqdIZCnCJZv9PrjN X-Google-Smtp-Source: ABdhPJzuSm2N++PCbwCNZSQajjTkF7r50j7LDDzy3JzT5M7YWH1hXMMGLopFSwK2a5elWkVRoJsTJg== X-Received: by 2002:a1c:2d95:: with SMTP id t143mr5310135wmt.44.1596675907805; Wed, 05 Aug 2020 18:05:07 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s205sm4861107wme.7.2020.08.05.18.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 18:05:07 -0700 (PDT) Message-Id: <22f8f3e37a18263d890307701903dc18c98aa54b.1596675905.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "lufia via GitGitGadget" Date: Thu, 06 Aug 2020 01:05:02 +0000 Subject: [PATCH 2/4] Define TAR_CF and TAR_XF variables in Makefile Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "KADOTA, Kyohei" , lufia Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: lufia Plan 9's tar(1) don't support o option. So I changed Makefiles to replace tar commands if needed. Signed-off-by: lufia --- Makefile | 14 ++++++++------ templates/Makefile | 6 ++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 372139f1f2..e222241509 100644 --- a/Makefile +++ b/Makefile @@ -547,6 +547,8 @@ AR = ar RM = rm -f DIFF = diff TAR = tar +TAR_CF = $(TAR) cf +TAR_XF = $(TAR) xof FIND = find INSTALL = install TCL_PATH = tclsh @@ -2926,13 +2928,13 @@ endif $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' ifndef NO_GETTEXT $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)' - (cd po/build/locale && $(TAR) cf - .) | \ - (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -) + (cd po/build/locale && $(TAR_CF) - .) | \ + (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR_XF) -) endif ifndef NO_PERL $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)' - (cd perl/build/lib && $(TAR) cf - .) | \ - (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -) + (cd perl/build/lib && $(TAR_CF) - .) | \ + (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR_XF) -) $(MAKE) -C gitweb install endif ifndef NO_TCLTK @@ -2999,8 +3001,8 @@ install-man: install-man-perl install-man-perl: man-perl $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3' - (cd perl/build/man/man3 && $(TAR) cf - .) | \ - (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -) + (cd perl/build/man/man3 && $(TAR_CF) - .) | \ + (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR_XF) -) install-html: $(MAKE) -C Documentation install-html diff --git a/templates/Makefile b/templates/Makefile index d22a71a399..eddc07effb 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -6,6 +6,8 @@ endif INSTALL ?= install TAR ?= tar +TAR_CF ?= tar cf +TAR_XF ?= tar xof RM ?= rm -f prefix ?= $(HOME) template_instdir ?= $(prefix)/share/git-core/templates @@ -62,5 +64,5 @@ clean: install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)' - (cd blt && $(TAR) cf - .) | \ - (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -) + (cd blt && $(TAR_CF) - .) | \ + (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR_XF) -) From patchwork Thu Aug 6 01:05:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702663 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 183631731 for ; Thu, 6 Aug 2020 01:05:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFDD022CE3 for ; Thu, 6 Aug 2020 01:05:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="urJWwz+9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbgHFBFe (ORCPT ); Wed, 5 Aug 2020 21:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbgHFBFM (ORCPT ); Wed, 5 Aug 2020 21:05:12 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE76C061757 for ; Wed, 5 Aug 2020 18:05:11 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id k20so8041650wmi.5 for ; Wed, 05 Aug 2020 18:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=/dGZi5rmQREJD46v4NSDJLG7Jjjiiuicdzy5xoEf68Y=; b=urJWwz+9oCiZ619KMvEdakKHAD0dQr35YzJMONQxs4BLv8Y4UaXyRisboFCkfvVwYP Aa+VwYAv0cjOOkxHw6RQG/WbkyekfN0kfKUy/AkJCFtcgVwR1nw3qW2bUn58PQf7ucTn mcrg5l9NyVUPSQU48Dzzb84JM0qzn3RVmFS9OvZpaf7+6ZT0d0NDR/Q4bVo1OrX/UHXh 2tV/2Kymy4PwLEy3tmK6GqE408PDolGN9x5WqBk/RkrMjEc0PRgkJJeFeMQ0rqt/6+g1 p+EvI9Z//ZTgHwOWTcmWGKKfsXp9CpKHGCwnIBILJtroFuF/B/lPa1zTLwFcaZJmPejM cOfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=/dGZi5rmQREJD46v4NSDJLG7Jjjiiuicdzy5xoEf68Y=; b=V/aWW7xkTQZ3ULEOGpICe4m6QLOXjv5Z1y2GENrzak4O55AdZOasXCN8jeVpJaRPLT l8iQYlwiGb6Kox7w7FRqr/3Ry9u8+VBIOJJmwnWbLpvgxFyh2VxEzytCkXoLCSQjXVVZ 66QRv+8pOZhqojeY0qKuN575h4srvHU+9gHgY68zpQfzBoTbR7fW0Sd2sxuGNP429LU2 qCTzGfvE13NWX6y0qfKtIc7vRy9H2olnKxLR9MelPtCSsPJiDP1UuW2iJ+uPsfxs5RES GFY4KsWvhOdfSI+8I/Gn9KZ515lbCi1oi6OPrpAvH8gFLKcZXBEBPEhTjXaz0h7k7LWF cYwQ== X-Gm-Message-State: AOAM531UueprjHnOwt1rC6niElnf5DRepnFrMX01ihKwZVQCXbD3t5/s aGcOl8Kq6OaCo4FklaWA02TtaS0c X-Google-Smtp-Source: ABdhPJzwP6NI3tQHO/2qIA+7wToC6CjBFK37Mt8qxuhuFwoRLT/40HOcWZiiTfQGSysmq5NSV0xXtw== X-Received: by 2002:a05:600c:284:: with SMTP id 4mr5628658wmk.48.1596675908577; Wed, 05 Aug 2020 18:05:08 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id v29sm4596371wrv.51.2020.08.05.18.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 18:05:08 -0700 (PDT) Message-Id: In-Reply-To: References: From: "lufia via GitGitGadget" Date: Thu, 06 Aug 2020 01:05:03 +0000 Subject: [PATCH 3/4] Fit to Plan 9's ANSI/POSIX compatibility layer Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "KADOTA, Kyohei" , lufia Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: lufia That haven't any commands: cut, expr and printf. And its sed(1)'s label is limited to maximum seven characters. Therefore I replaced some labels to drop a character. * close -> cl * continue -> cont (cnt is used for count) * line -> ln * hered -> hdoc * shell -> sh * string -> str Signed-off-by: lufia --- GIT-VERSION-GEN | 2 +- generate-cmdlist.sh | 19 ++++++++----- t/chainlint.sed | 66 ++++++++++++++++++++++----------------------- 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9db2f4feab..a7cc01caf9 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -26,7 +26,7 @@ else VN="$DEF_VER" fi -VN=$(expr "$VN" : v*'\(.*\)') +VN=${VN#v} if test -r $GVF then diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 45fecf8bdf..8344ca6264 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -6,11 +6,11 @@ die () { } command_list () { - eval "grep -ve '^#' $exclude_programs" <"$1" + eval "grep -v -e '^#' $exclude_programs" <"$1" } get_categories () { - tr ' ' '\n'| + tr ' ' '\012'| grep -v '^$' | sort | uniq @@ -18,13 +18,13 @@ get_categories () { category_list () { command_list "$1" | - cut -c 40- | + awk '{ print substr($0, 40) }' | get_categories } get_synopsis () { sed -n ' - /^NAME/,/'"$1"'/H + /^NAME/,/'"$1"'/h ${ x s/.*'"$1"' - \(.*\)/N_("\1")/ @@ -60,16 +60,23 @@ define_category_names () { echo "};" } +if test -z "$(echo -n)" +then + alias print='echo -n' +else + alias print='printf %s' +fi + print_command_list () { echo "static struct cmdname_help command_list[] = {" command_list "$1" | while read cmd rest do - printf " { \"$cmd\", $(get_synopsis $cmd), 0" + print " { \"$cmd\", $(get_synopsis $cmd), 0" for cat in $(echo "$rest" | get_categories) do - printf " | CAT_$cat" + print " | CAT_$cat" done echo " }," done diff --git a/t/chainlint.sed b/t/chainlint.sed index 70df40e34b..8a25c5b855 100644 --- a/t/chainlint.sed +++ b/t/chainlint.sed @@ -117,7 +117,7 @@ /^[ ]*!*[ ]*(..*)[ ]*[0-9]*[<>|&]/boneline # multi-line "(...\n...)" -/^[ ]*(/bsubshell +/^[ ]*(/bsubsh # innocuous line -- print it and advance to next line b @@ -130,11 +130,11 @@ b } b -:subshell +:subsh # bare "(" line? -- stash for later printing /^[ ]*([ ]*$/ { h - bnextline + bnextln } # "(..." line -- split off and stash "(", then process "..." as its own line x @@ -143,7 +143,7 @@ x s/(// bslurp -:nextline +:nextln N s/.*\n// @@ -151,10 +151,10 @@ s/.*\n// # incomplete line "...\" /\\$/bicmplte # multi-line quoted string "...\n..."? -/"/bdqstring +/"/bdqstr # multi-line quoted string '...\n...'? (but not contraction in string "it's") /'/{ - /"[^'"]*'[^'"]*"/!bsqstring + /"[^'"]*'[^'"]*"/!bsqstr } :folded # here-doc -- swallow it @@ -163,8 +163,8 @@ s/.*\n// # before closing ")", "done", "elsif", "else", or "fi" will need to be # re-visited to drop "suspect" marking since final line of those constructs # legitimately lacks "&&", so "suspect" mark must be removed -/^[ ]*#/bnextline -/^[ ]*$/bnextline +/^[ ]*#/bnextln +/^[ ]*$/bnextln # in-line comment -- strip it (but not "#" in a string, Bash ${#...} array # length, or Perforce "//depot/path#42" revision in filespec) /[ ]#/{ @@ -175,22 +175,22 @@ s/.*\n// # multi-line "case ... esac" /^[ ]*case[ ]..*[ ]in/bcase # multi-line "for ... done" or "while ... done" -/^[ ]*for[ ]..*[ ]in/bcontinue -/^[ ]*while[ ]/bcontinue -/^[ ]*do[ ]/bcontinue -/^[ ]*do[ ]*$/bcontinue -/;[ ]*do/bcontinue +/^[ ]*for[ ]..*[ ]in/bcont +/^[ ]*while[ ]/bcont +/^[ ]*do[ ]/bcont +/^[ ]*do[ ]*$/bcont +/;[ ]*do/bcont /^[ ]*done[ ]*&&[ ]*$/bdone /^[ ]*done[ ]*$/bdone /^[ ]*done[ ]*[<>|]/bdone /^[ ]*done[ ]*)/bdone -/||[ ]*exit[ ]/bcontinue -/||[ ]*exit[ ]*$/bcontinue +/||[ ]*exit[ ]/bcont +/||[ ]*exit[ ]*$/bcont # multi-line "if...elsif...else...fi" -/^[ ]*if[ ]/bcontinue -/^[ ]*then[ ]/bcontinue -/^[ ]*then[ ]*$/bcontinue -/;[ ]*then/bcontinue +/^[ ]*if[ ]/bcont +/^[ ]*then[ ]/bcont +/^[ ]*then[ ]*$/bcont +/;[ ]*then/bcont /^[ ]*elif[ ]/belse /^[ ]*elif[ ]*$/belse /^[ ]*else[ ]/belse @@ -234,10 +234,10 @@ s/.*\n// } } # line ends with pipe "...|" -- valid; not missing "&&" -/|[ ]*$/bcontinue +/|[ ]*$/bcont # missing end-of-line "&&" -- mark suspect /&&[ ]*$/!s/^/?!AMP?!/ -:continue +:cont # retrieve and print previous line x n @@ -250,7 +250,7 @@ s/\\\n// bslurp # check for multi-line double-quoted string "...\n..." -- fold to one line -:dqstring +:dqstr # remove all quote pairs s/"\([^"]*\)"/@!\1@!/g # done if no dangling quote @@ -258,13 +258,13 @@ s/"\([^"]*\)"/@!\1@!/g # otherwise, slurp next line and try again N s/\n// -bdqstring +bdqstr :dqdone s/@!/"/g bfolded # check for multi-line single-quoted string '...\n...' -- fold to one line -:sqstring +:sqstr # remove all quote pairs s/'\([^']*\)'/@!\1@!/g # done if no dangling quote @@ -272,7 +272,7 @@ s/'\([^']*\)'/@!\1@!/g # otherwise, slurp next line and try again N s/\n// -bsqstring +bsqstr :sqdone s/@!/'/g bfolded @@ -282,11 +282,11 @@ bfolded :heredoc s/^\(.*\)<<[ ]*[-\\'"]*\([A-Za-z0-9_][A-Za-z0-9_]*\)['"]*/<\2>\1<]*\)>.*\n[ ]*\1[ ]*$/!{ s/\n.*$// - bheredsub + bhdocsub } s/^<[^>]*>// s/\n.*$// @@ -305,7 +305,7 @@ bcase x s/?!AMP?!// x -bcontinue +bcont # found "done" closing for-loop or while-loop, or "fi" closing if-then -- drop # "suspect" from final contained line since that line legitimately lacks "&&" @@ -321,10 +321,10 @@ bchkchn # found nested multi-line "(...\n...)" -- pass through untouched :nest x -:nstslurp +:nstslrp n # closing ")" on own line -- stop nested slurp -/^[ ]*)/bnstclose +/^[ ]*)/bnstcl # comment -- not closing ")" if in comment /^[ ]*#/bnstcnt # "$((...))" -- arithmetic expansion; not closing ")" @@ -332,11 +332,11 @@ n # "$(...)" -- command substitution; not closing ")" /\$([^)][^)]*)[^)]*$/bnstcnt # closing "...)" -- stop nested slurp -/)/bnstclose +/)/bnstcl :nstcnt x -bnstslurp -:nstclose +bnstslrp +:nstcl s/^/>>/ # is it "))" which closes nested and parent subshells? /)[ ]*)/bslurp From patchwork Thu Aug 6 01:05:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04C2514E3 for ; Thu, 6 Aug 2020 01:05:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1C2C22CF7 for ; Thu, 6 Aug 2020 01:05:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K16Lc6a4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbgHFBFc (ORCPT ); Wed, 5 Aug 2020 21:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgHFBFL (ORCPT ); Wed, 5 Aug 2020 21:05:11 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B6FCC061574 for ; Wed, 5 Aug 2020 18:05:11 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id 184so8070867wmb.0 for ; Wed, 05 Aug 2020 18:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=S8kn8pjI/+dxOHvK2BMvDNo0+HXwqDf+BvlJ3nxXU3M=; b=K16Lc6a4FFPoiwqlZL9lWOVpa14v6ILoNZfa6JHa7c9uU44RA3AZVa3qPyTkVKK7ou kDOvxvg5KTz5yA10p86blAjtwP9PMcyneHkISYI4+9g3fDBbrXIDTTx4DBxiFUDY4qrd Zs8/k/Jui3a3IGfQ7KddnNtNlMNBbTFqbnTnywCECNz2DgbFgrOMGGKec0uO47F24kjP ysL2sdZ+tnbU3QTO42lMo/IA0UtuAFdpv9G8dT4EXjFxl2pRoaBYn79MumaOEyVVbR9K HVChkjHr2aI4sbWyppolVaOBjAjvJm7FH8fpUFvj7IomNxBZo++X2PIhYJpT7sgRt5wi 01Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=S8kn8pjI/+dxOHvK2BMvDNo0+HXwqDf+BvlJ3nxXU3M=; b=YELqSSS8i/BI3WorrAfcRB4Ta4tRegaCpCkRe9WMByDUdCRL1NfwRfRc6eh4ZuaoZR ptjK3zjFlHKb8wNpGWjc/lZMToNHyj/by/8a8P8jlGppCcXwS0sYjru0lCqvUT93pm+F EMx6m/P/ePCaKIajJDzVNoqL1kIkx83nJpC7DEbmmsl3lNepFFWWq80sNmavlDM9Qeiz WkRbz1zUoklph/oySFXIJYsSXkSd34ZJjaOvaua6SibAeXDC0K59AxyN+RlWy/uWZXVs MfWLcWJIfgMC6e0K9lUHDq7LDGERX7MvwcDwJ39mu2em2ibFzf7ZqnJNqBeCB1peNG22 aMuQ== X-Gm-Message-State: AOAM533I0PiU8623sIMgxGFb76j5RqIxoWDwgbRJcKiA3ZS8G3Rm1o4W uy6gre4CwYPI4faDN+pxjcd/qhrO X-Google-Smtp-Source: ABdhPJxa32So5dOEEtTwiz+Db2Z1Fb6NCPJaQI4Ud7bkAi9G31ozTbTR8LdDfQa3IR+g5zVPZs6fbw== X-Received: by 2002:a1c:a7d1:: with SMTP id q200mr5316462wme.131.1596675909331; Wed, 05 Aug 2020 18:05:09 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 32sm4767749wrn.86.2020.08.05.18.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 18:05:08 -0700 (PDT) Message-Id: <4ebd56a3c52c2a4a47d69d851f75deccc3ce8932.1596675905.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "lufia via GitGitGadget" Date: Thu, 06 Aug 2020 01:05:04 +0000 Subject: [PATCH 4/4] Use $(LD) instead of $(CC) for linking the object files Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "KADOTA, Kyohei" , lufia Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: lufia Plan 9's loader(aka. linker) is separated from the compiler. The compilers are called 8c, 6c... for each machine architectures; corresponded loaders are called 8l, 6l... Signed-off-by: lufia --- .github/workflows/main.yml | 1 + Makefile | 19 ++++++++++--------- ci/lib.sh | 8 +++++++- config.mak.in | 1 + config.mak.uname | 6 ++++++ 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84a5dcff7a..37b006f371 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -243,6 +243,7 @@ jobs: pool: ubuntu-latest env: CC: ${{matrix.vector.cc}} + LD: ${{matrix.vector.cc}} jobname: ${{matrix.vector.jobname}} runs-on: ${{matrix.vector.pool}} steps: diff --git a/Makefile b/Makefile index e222241509..a52a05604a 100644 --- a/Makefile +++ b/Makefile @@ -543,6 +543,7 @@ export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir # Set our default programs CC = cc +LD = cc AR = ar RM = rm -f DIFF = diff @@ -2128,7 +2129,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \ '-DGIT_INFO_PATH="$(infodir_relative_SQ)"' git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) \ $(filter %.o,$^) $(LIBS) help.sp help.s help.o: command-list.h @@ -2459,25 +2460,25 @@ compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null endif git-%$X: %.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) git-bugreport$X: bugreport.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(LIBS) git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(IMAP_SEND_LDFLAGS) $(LIBS) git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(CURL_LIBCURL) $(LIBS) git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \ $(VCSSVN_LIB) $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY) @@ -2487,7 +2488,7 @@ $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY) cp $< $@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) $(LIB_FILE): $(LIB_OBJS) @@ -2782,7 +2783,7 @@ t/helper/test-svn-fe$X: $(VCSSVN_LIB) t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) + $(QUIET_LINK)$(LD) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) check-sha1:: t/helper/test-tool$X t/helper/test-sha1.sh diff --git a/ci/lib.sh b/ci/lib.sh index 3eefec500d..19c5beb277 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -125,6 +125,7 @@ then test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')" CC="${CC:-gcc}" + LD="$CC" # use a subdirectory of the cache dir (because the file share is shared # among *all* phases) @@ -149,6 +150,7 @@ then CI_REPO_SLUG="$GITHUB_REPOSITORY" CI_JOB_ID="$GITHUB_RUN_ID" CC="${CC:-gcc}" + LD="$CC" cache_dir="$HOME/none" @@ -184,6 +186,7 @@ linux-clang|linux-gcc) if [ "$jobname" = linux-gcc ] then export CC=gcc-8 + export LD="$CC" MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3" else MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2" @@ -207,6 +210,7 @@ osx-clang|osx-gcc) if [ "$jobname" = osx-gcc ] then export CC=gcc-9 + export LD="$CC" MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python3)" else MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=$(which python2)" @@ -222,12 +226,14 @@ GETTEXT_POISON) ;; Linux32) CC=gcc + LD="$CC" ;; linux-musl) CC=gcc + LD="$CC" MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3 USE_LIBPCRE2=Yes" MAKEFLAGS="$MAKEFLAGS NO_REGEX=Yes ICONV_OMITS_BOM=Yes" ;; esac -MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}" +MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc} LD=${LD:-cc}" diff --git a/config.mak.in b/config.mak.in index e6a6d0f941..76ea7e781e 100644 --- a/config.mak.in +++ b/config.mak.in @@ -2,6 +2,7 @@ # @configure_input@ CC = @CC@ +LD = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ diff --git a/config.mak.uname b/config.mak.uname index f3eb2b91a2..3c4c11eec1 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -69,6 +69,7 @@ ifeq ($(uname_S),GNU/kFreeBSD) endif ifeq ($(uname_S),UnixWare) CC = cc + LD = $(CC) NEEDS_SOCKET = YesPlease NEEDS_NSL = YesPlease NEEDS_SSL_WITH_CRYPTO = YesPlease @@ -90,6 +91,7 @@ ifeq ($(uname_S),SCO_SV) endif ifeq ($(uname_R),5) CC = cc + LD = $(CC) BASIC_CFLAGS += -Kthread endif NEEDS_SOCKET = YesPlease @@ -435,6 +437,7 @@ ifeq ($(uname_S),Windows) DEFAULT_HELP_FORMAT = html CC = compat/vcbuild/scripts/clink.pl + LD = $(CC) AR = compat/vcbuild/scripts/lib.pl CFLAGS = BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE @@ -525,6 +528,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL) ifeq ($(uname_R).$(uname_V),L17.02) CC += -WRVU=L16.05 endif + LD = $(CC) # Disable all optimization, seems to result in bad code, with -O or -O2 # or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects # abends on "git push". Needs more investigation. @@ -665,8 +669,10 @@ else BASIC_LDFLAGS += -Wl,--large-address-aware endif CC = gcc + LD = $(CC) COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \ -fstack-protector-strong + BASIC_LDFLAGS += -fstack-protector-strong EXTLIBS += -lntdll INSTALL = /bin/install NO_R_TO_GCC_LINKER = YesPlease