Skip to content

Commit

Permalink
Prevent mangled URL in .pc file
Browse files Browse the repository at this point in the history
Previously, the `Makefile` assumed that Git URLs were always “SSH style”, e.g., `[email protected]:tree-sitter/tree-sitter-java.git`.  This change causes the right thing to be done when a normal URL is encountered, e.g. `https://github.com/tree-sitter/tree-sitter-java.git`.

Relates to https://bugzilla.redhat.com/show_bug.cgi?id=2193261
  • Loading branch information
mavit committed Aug 2, 2023
1 parent 6c8329e commit 6542346
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ ifeq (, $(PARSER_NAME))
endif

ifeq (, $(PARSER_URL))
PARSER_URL := $(subst :,/,$(PARSER_REPO_URL))
PARSER_URL := $(subst .git,,$(PARSER_REPO_URL))
ifeq ($(shell echo $(PARSER_URL) | grep '^[a-z][-+.0-9a-z]*://'),)
PARSER_URL := $(subst :,/,$(PARSER_URL))
PARSER_URL := $(subst git@,https://,$(PARSER_URL))
PARSER_URL := $(subst .git,,$(PARSER_URL))
endif
endif

UPPER_PARSER_NAME := $(shell echo $(PARSER_NAME) | tr a-z A-Z )
Expand Down

0 comments on commit 6542346

Please sign in to comment.