Skip to content

Commit e8d1bc4

Browse files
authored
Merge pull request #155 from mavit/make-pc-url
Prevent mangled URL in .pc file
2 parents 6c8329e + 6542346 commit e8d1bc4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ ifeq (, $(PARSER_NAME))
1212
endif
1313

1414
ifeq (, $(PARSER_URL))
15-
PARSER_URL := $(subst :,/,$(PARSER_REPO_URL))
15+
PARSER_URL := $(subst .git,,$(PARSER_REPO_URL))
16+
ifeq ($(shell echo $(PARSER_URL) | grep '^[a-z][-+.0-9a-z]*://'),)
17+
PARSER_URL := $(subst :,/,$(PARSER_URL))
1618
PARSER_URL := $(subst git@,https://,$(PARSER_URL))
17-
PARSER_URL := $(subst .git,,$(PARSER_URL))
19+
endif
1820
endif
1921

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

0 commit comments

Comments
 (0)