From 0f681890281630549983e958744514e5a0219a47 Mon Sep 17 00:00:00 2001 From: Genevieve Helsel Date: Sun, 14 Apr 2024 00:18:09 -0700 Subject: [PATCH] Update Makefile to not error if repo was cloned using Sapling This changes the `test` Makefile target conditional to pass for Sapling cloned repos. I was building this locally and ran into this issue because I cloned the repo using Sapling (https://sapling-scm.com) which uses a `.sl` directory at the repo root as opposed to a `.git` directory, and as such got the error message about zip files. Getting around the message was just making an empty top level `.git` directory, but IMO it shouldn't show this error in the first place. As of now, this would also fail with for Mercurial cloned repos (which uses a `.hg` directory). I thought of generalizing it to check for any hidden top level directory, but technically `.git` can be a can be a text file (see: https://git-scm.com/docs/gitrepository-layout) Also, I opted to not change the message printed in the failure case to include this as it might cause more confusion than benefit. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 35aca32..49b0483 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,7 @@ endif all: test modules test: - @if [ ! -e ./.git ] ; then echo $(MSG); exit 1; fi; + @if [ ! -e ./.git -a ! -e ./.sl ] ; then echo $(MSG); exit 1; fi; modules: $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules