Current section

36 Versions

Jump to

Compare versions

16 files changed
+336 additions
-165 deletions
  @@ -2,7 +2,7 @@
2 2
3 3 PROJECT = cowlib
4 4 PROJECT_DESCRIPTION = Support library for manipulating Web protocols.
5 - PROJECT_VERSION = 2.17.1
5 + PROJECT_VERSION = 2.18.0
6 6
7 7 # Options.
8 8
  @@ -38,7 +38,7 @@ define HEX_TARBALL_EXTRA_METADATA
38 38 #{
39 39 licenses => [<<"ISC">>],
40 40 links => #{
41 - <<"Function reference">> => <<"https://ninenines.eu/docs/en/cowlib/2.17/manual/">>,
41 + <<"Function reference">> => <<"https://ninenines.eu/docs/en/cowlib/2.18/manual/">>,
42 42 <<"GitHub">> => <<"https://github.com/ninenines/cowlib">>,
43 43 <<"Sponsor">> => <<"https://github.com/sponsors/essen">>
44 44 }
  @@ -1,6 +1,6 @@
1 1 {application, 'cowlib', [
2 2 {description, "Support library for manipulating Web protocols."},
3 - {vsn, "2.17.1"},
3 + {vsn, "2.18.0"},
4 4 {modules, ['cow_base64url','cow_capsule','cow_cookie','cow_date','cow_deflate','cow_hpack','cow_http','cow_http1','cow_http2','cow_http2_machine','cow_http3','cow_http3_machine','cow_http_hd','cow_http_struct_hd','cow_http_te','cow_iolists','cow_link','cow_mimetypes','cow_multipart','cow_qpack','cow_qs','cow_sse','cow_uri','cow_uri_template','cow_ws']},
5 5 {registered, []},
6 6 {applications, [kernel,stdlib,crypto]},
  @@ -17,7 +17,7 @@
17 17 ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
18 18 export ERLANG_MK_FILENAME
19 19
20 - ERLANG_MK_VERSION = 0b549ff
20 + ERLANG_MK_VERSION = efb0d04
21 21 ERLANG_MK_WITHOUT =
22 22
23 23 # Make 3.81 and 3.82 are deprecated.
  @@ -573,14 +573,6 @@ dep_verbose_0 = @echo " DEP $1 ($(call query_version,$1))";
573 573 dep_verbose_2 = set -x;
574 574 dep_verbose = $(dep_verbose_$(V))
575 575
576 - # Optimization: don't recompile deps unless truly necessary.
577 -
578 - ifndef IS_DEP
579 - ifneq ($(MAKELEVEL),0)
580 - $(shell rm -f ebin/dep_built)
581 - endif
582 - endif
583 -
584 576 # Core targets.
585 577
586 578 ALL_APPS_DIRS_TO_BUILD = $(if $(LOCAL_DEPS_DIRS)$(IS_APP),$(LOCAL_DEPS_DIRS),$(ALL_APPS_DIRS))
  @@ -634,26 +626,29 @@ endef
634 626 endif
635 627 endif
636 628
629 + $(ERLANG_MK_TMP)/dep_built:
630 + $(verbose) mkdir -p $(ERLANG_MK_TMP)/dep_built
631 +
637 632 ifneq ($(SKIP_DEPS),)
638 633 deps::
639 634 else
640 635 ALL_DEPS_DIRS_TO_BUILD = $(if $(filter-out $(DEPS_DIR)/elixir,$(ALL_DEPS_DIRS)),$(filter-out $(DEPS_DIR)/elixir,$(ALL_DEPS_DIRS)),$(ALL_DEPS_DIRS))
641 636
642 - deps:: $(ALL_DEPS_DIRS_TO_BUILD) apps clean-tmp-deps.log | $(ERLANG_MK_TMP)
637 + deps:: $(ALL_DEPS_DIRS_TO_BUILD) apps clean-tmp-deps.log | $(ERLANG_MK_TMP)/dep_built
643 638 ifneq ($(ALL_DEPS_DIRS_TO_BUILD),)
644 639 $(verbose) set -e; for dep in $(ALL_DEPS_DIRS_TO_BUILD); do \
645 640 if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/deps.log; then \
646 641 :; \
647 642 else \
648 643 echo $$dep >> $(ERLANG_MK_TMP)/deps.log; \
649 - if [ -z "$(strip $(FULL))" ] $(if $(force_rebuild_dep),&& ! ($(call force_rebuild_dep,$$dep)),) && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \
644 + if [ -z "$(strip $(FULL))" ] $(if $(force_rebuild_dep),&& ! ($(call force_rebuild_dep,$$dep)),) && [ ! -L $$dep ] && [ -f $(ERLANG_MK_TMP)/dep_built/`basename $$dep` ]; then \
650 645 :; \
651 646 elif [ "$$dep" = "$(DEPS_DIR)/hut" -a "$(HUT_PATCH)" ]; then \
652 647 $(MAKE) -C $$dep app IS_DEP=1; \
653 - if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
648 + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $(ERLANG_MK_TMP)/dep_built/`basename $$dep`; fi; \
654 649 elif [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \
655 650 $(MAKE) -C $$dep IS_DEP=1; \
656 - if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
651 + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $(ERLANG_MK_TMP)/dep_built/`basename $$dep`; fi; \
657 652 else \
658 653 echo "Error: No Makefile to build dependency $$dep." >&2; \
659 654 exit 2; \
  @@ -735,7 +730,7 @@ define maybe_flock
735 730 if command -v flock >/dev/null; then \
736 731 flock $1 sh -c "$2"; \
737 732 elif command -v lockf >/dev/null; then \
738 - lockf $1 sh -c "$2"; \
733 + lockf -k $1 sh -c "$2"; \
739 734 else \
740 735 $2; \
741 736 fi
  @@ -1303,7 +1298,7 @@ define dep_fetch_fail
1303 1298 endef
1304 1299
1305 1300 define dep_target
1306 - $(DEPS_DIR)/$(call query_name,$1): $(if $(filter elixir,$(BUILD_DEPS) $(DEPS)),$(if $(filter-out elixir,$1),$(DEPS_DIR)/elixir/ebin/dep_built)) $(if $(filter hex,$(call query_fetch_method,$1)),$(if $(wildcard $(DEPS_DIR)/$(call query_name,$1)),,$(DEPS_DIR)/hex_core/ebin/dep_built)) | $(ERLANG_MK_TMP)
1301 + $(DEPS_DIR)/$(call query_name,$1): $(if $(filter elixir,$(BUILD_DEPS) $(DEPS)),$(if $(filter-out elixir,$1),$(ERLANG_MK_TMP)/dep_built/elixir)) $(if $(filter hex,$(call query_fetch_method,$1)),$(if $(wildcard $(DEPS_DIR)/$(call query_name,$1)),,$(ERLANG_MK_TMP)/dep_built/hex_core)) | $(ERLANG_MK_TMP)
1307 1302 $(eval DEP_NAME := $(call query_name,$1))
1308 1303 $(eval DEP_STR := $(if $(filter $1,$(DEP_NAME)),$1,"$1 ($(DEP_NAME))"))
1309 1304 $(verbose) if test -d $(APPS_DIR)/$(DEP_NAME); then \
  @@ -1345,20 +1340,22 @@ endef
1345 1340 $(if $(filter hex_core,$(DEPS) $(BUILD_DEPS) $(DOC_DEPS) $(REL_DEPS) $(TEST_DEPS)),,\
1346 1341 $(eval $(call dep_target,hex_core)))
1347 1342
1348 - $(DEPS_DIR)/hex_core/ebin/dep_built: | $(ERLANG_MK_TMP)
1343 + $(ERLANG_MK_TMP)/dep_built/hex_core: | $(ERLANG_MK_TMP)
1349 1344 $(verbose) $(call maybe_flock,$(ERLANG_MK_TMP)/hex_core.lock,\
1350 - if [ ! -e $(DEPS_DIR)/hex_core/ebin/dep_built ]; then \
1345 + if [ ! -e $(ERLANG_MK_TMP)/dep_built/hex_core ]; then \
1351 1346 $(MAKE) $(DEPS_DIR)/hex_core; \
1352 1347 $(MAKE) -C $(DEPS_DIR)/hex_core IS_DEP=1; \
1353 - touch $(DEPS_DIR)/hex_core/ebin/dep_built; \
1348 + mkdir -p $(ERLANG_MK_TMP)/dep_built; \
1349 + touch $(ERLANG_MK_TMP)/dep_built/hex_core; \
1354 1350 fi)
1355 1351
1356 - $(DEPS_DIR)/elixir/ebin/dep_built: | $(ERLANG_MK_TMP)
1352 + $(ERLANG_MK_TMP)/dep_built/elixir: | $(ERLANG_MK_TMP)
1357 1353 $(verbose) $(call maybe_flock,$(ERLANG_MK_TMP)/elixir.lock,\
1358 - if [ ! -e $(DEPS_DIR)/elixir/ebin/dep_built ]; then \
1354 + if [ ! -e $(ERLANG_MK_TMP)/dep_built/elixir ]; then \
1359 1355 $(MAKE) $(DEPS_DIR)/elixir; \
1360 1356 $(MAKE) -C $(DEPS_DIR)/elixir; \
1361 - touch $(DEPS_DIR)/elixir/ebin/dep_built; \
1357 + mkdir -p $(ERLANG_MK_TMP)/dep_built; \
1358 + touch $(ERLANG_MK_TMP)/dep_built/elixir; \
1362 1359 fi)
1363 1360
1364 1361 $(foreach dep,$(BUILD_DEPS) $(DEPS),$(eval $(call dep_target,$(dep))))
  @@ -1442,6 +1439,7 @@ ifneq ($(wildcard $(PROJECT_BEAM_CACHE_DIR)/ebin-app),)
1442 1439 else
1443 1440 $(verbose) $(MAKE) --no-print-directory clean-app
1444 1441 endif
1442 + $(verbose) rm $(ERLANG_MK_TMP)/$(PROJECT).test
1445 1443
1446 1444 beam-cache-restore-test: | $(PROJECT_BEAM_CACHE_DIR)
1447 1445 $(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR)/ebin-app
  @@ -1509,7 +1507,7 @@ ifneq ($(wildcard src/)$(wildcard lib/),)
1509 1507
1510 1508 # Targets.
1511 1509
1512 - app:: $(if $(wildcard ebin/test),beam-cache-restore-app) deps
1510 + app:: $(if $(wildcard $(ERLANG_MK_TMP)/$(PROJECT).test),beam-cache-restore-app) deps
1513 1511 $(verbose) $(MAKE) --no-print-directory $(PROJECT).d
1514 1512 $(verbose) $(MAKE) --no-print-directory app-build
1515 1513
  @@ -1773,7 +1771,7 @@ ebin/$(PROJECT).app:: $(ERL_FILES) $(CORE_FILES) $(wildcard src/$(PROJECT).app.s
1773 1771 $(verbose) if $(ELIXIR_COMP_FAILED); then exit 1; fi
1774 1772 $(eval GITDESCRIBE := $(shell git describe --dirty --abbrev=7 --tags --always --first-parent 2>/dev/null \
1775 1773 || git describe --dirty --abbrev=7 --tags --always 2>/dev/null || true))
1776 - $(eval MODULES := $(MODULES) $(patsubst %,'%',$(sort $(notdir $(basename \
1774 + $(eval MODULES := $(sort $(MODULES) $(patsubst %,'%',$(notdir $(basename \
1777 1775 $(filter-out $(ERLC_EXCLUDE_PATHS),$(ERL_FILES) $(CORE_FILES) $(BEAM_FILES)))))))
1778 1776 ifeq ($(wildcard src/$(PROJECT).app.src),)
1779 1777 $(app_verbose) printf '$(subst %,%%,$(subst $(newline),\n,$(subst ','\'',$(call app_file,$(GITDESCRIBE),$(MODULES)))))' \
  @@ -1981,7 +1979,7 @@ endef
1981 1979 define dep_autopatch_mix
1982 1980 sed 's|\(defmodule.*do\)|\1\n try do\n Code.compiler_options(on_undefined_variable: :warn)\n rescue _ -> :ok\n end\n|g' $(DEPS_DIR)/$(1)/mix.exs > $(DEPS_DIR)/$(1)/mix.exs.new; \
1983 1981 mv $(DEPS_DIR)/$(1)/mix.exs.new $(DEPS_DIR)/$(1)/mix.exs; \
1984 - $(MAKE) $(DEPS_DIR)/hex_core/ebin/dep_built; \
1982 + $(MAKE) $(ERLANG_MK_TMP)/dep_built/hex_core; \
1985 1983 MIX_ENV="$(if $(MIX_ENV),$(strip $(MIX_ENV)),prod)" \
1986 1984 $(call erlang,$(call dep_autopatch_mix.erl,$1))
1987 1985 endef
  @@ -2072,13 +2070,13 @@ $(foreach dep,$(TEST_DEPS),$(eval $(call dep_target,$(dep))))
2072 2070 ifneq ($(SKIP_DEPS),)
2073 2071 test-deps:
2074 2072 else
2075 - test-deps: $(ALL_TEST_DEPS_DIRS)
2073 + test-deps: $(ALL_TEST_DEPS_DIRS) | $(ERLANG_MK_TMP)/dep_built
2076 2074 $(verbose) set -e; for dep in $(ALL_TEST_DEPS_DIRS) ; do \
2077 - if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \
2075 + if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $(ERLANG_MK_TMP)/dep_built/`basename $$dep` ]; then \
2078 2076 :; \
2079 2077 else \
2080 2078 $(MAKE) -C $$dep IS_DEP=1; \
2081 - if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
2079 + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $(ERLANG_MK_TMP)/dep_built/`basename $$dep`; fi; \
2082 2080 fi \
2083 2081 done
2084 2082 endif
  @@ -2108,13 +2106,13 @@ endif
2108 2106
2109 2107 test-build:: IS_TEST=1
2110 2108 test-build:: ERLC_OPTS=$(TEST_ERLC_OPTS)
2111 - test-build:: $(if $(wildcard src),$(if $(wildcard ebin/test),,beam-cache-restore-test)) $(if $(IS_APP),,deps test-deps)
2109 + test-build:: $(if $(wildcard src),$(if $(wildcard $(ERLANG_MK_TMP)/$(PROJECT).test),,beam-cache-restore-test)) $(if $(IS_APP),,deps test-deps)
2112 2110 # We already compiled everything when IS_APP=1.
2113 2111 ifndef IS_APP
2114 2112 ifneq ($(wildcard src),)
2115 2113 $(verbose) $(MAKE) --no-print-directory $(PROJECT).d ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
2116 2114 $(verbose) $(MAKE) --no-print-directory app-build ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
2117 - $(gen_verbose) touch ebin/test
2115 + $(gen_verbose) touch $(ERLANG_MK_TMP)/$(PROJECT).test
2118 2116 endif
2119 2117 ifneq ($(wildcard $(TEST_DIR)),)
2120 2118 $(verbose) $(MAKE) --no-print-directory test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
  @@ -2129,7 +2127,7 @@ test-build-app:: deps test-deps
2129 2127 ifneq ($(wildcard src),)
2130 2128 $(verbose) $(MAKE) --no-print-directory $(PROJECT).d ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
2131 2129 $(verbose) $(MAKE) --no-print-directory app-build ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
2132 - $(gen_verbose) touch ebin/test
2130 + $(gen_verbose) touch $(ERLANG_MK_TMP)/$(PROJECT).test
2133 2131 endif
2134 2132 ifneq ($(wildcard $(TEST_DIR)),)
2135 2133 $(verbose) $(MAKE) --no-print-directory test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))"
  @@ -2591,7 +2589,7 @@ else
2591 2589
2592 2590 MAN_INSTALL_PATH ?= /usr/local/share/man
2593 2591 MAN_SECTIONS ?= 3 7
2594 - MAN_PROJECT ?= $(shell echo $(PROJECT) | sed 's/^./\U&\E/')
2592 + MAN_PROJECT ?= $(shell echo $(PROJECT) | awk '{ print toupper(substr($$0,1,1)) substr($$0,2) }')
2595 2593 MAN_VERSION ?= $(PROJECT_VERSION)
2596 2594
2597 2595 # Plugin-specific targets.
  @@ -3624,7 +3622,7 @@ define hex_user_create.erl
3624 3622 endef
3625 3623
3626 3624 # The $(info ) call inserts a new line after the password prompt.
3627 - hex-user-create: $(DEPS_DIR)/hex_core/ebin/dep_built
3625 + hex-user-create: $(ERLANG_MK_TMP)/dep_built/hex_core
3628 3626 $(if $(HEX_USERNAME),,$(eval HEX_USERNAME := $(shell read -p "Username: " username; echo $$username)))
3629 3627 $(if $(HEX_PASSWORD),,$(eval HEX_PASSWORD := $(shell stty -echo; read -p "Password: " password; stty echo; echo $$password) $(info )))
3630 3628 $(if $(HEX_EMAIL),,$(eval HEX_EMAIL := $(shell read -p "Email: " email; echo $$email)))
  @@ -3654,7 +3652,7 @@ define hex_key_add.erl
3654 3652 end
3655 3653 endef
3656 3654
3657 - hex-key-add: $(DEPS_DIR)/hex_core/ebin/dep_built
3655 + hex-key-add: $(ERLANG_MK_TMP)/dep_built/hex_core
3658 3656 $(if $(HEX_USERNAME),,$(eval HEX_USERNAME := $(shell read -p "Username: " username; echo $$username)))
3659 3657 $(if $(HEX_PASSWORD),,$(eval HEX_PASSWORD := $(shell stty -echo; read -p "Password: " password; stty echo; echo $$password) $(info )))
3660 3658 $(gen_verbose) $(call erlang,$(call hex_key_add.erl,$(HEX_USERNAME),$(HEX_PASSWORD),\
  @@ -3732,7 +3730,7 @@ hex_tar_verbose_0 = @echo " TAR $(notdir $(ERLANG_MK_TMP))/$(@F)";
3732 3730 hex_tar_verbose_2 = set -x;
3733 3731 hex_tar_verbose = $(hex_tar_verbose_$(V))
3734 3732
3735 - $(HEX_TARBALL_OUTPUT_FILE): $(DEPS_DIR)/hex_core/ebin/dep_built app
3733 + $(HEX_TARBALL_OUTPUT_FILE): $(ERLANG_MK_TMP)/dep_built/hex_core app
3736 3734 $(hex_tar_verbose) $(call erlang,$(call hex_tarball_create.erl))
3737 3735
3738 3736 hex-tarball-create: $(HEX_TARBALL_OUTPUT_FILE)
  @@ -3783,14 +3781,14 @@ define hex_release_publish.erl
3783 3781 end
3784 3782 endef
3785 3783
3786 - hex-release-tarball: $(DEPS_DIR)/hex_core/ebin/dep_built $(HEX_TARBALL_OUTPUT_FILE)
3784 + hex-release-tarball: $(ERLANG_MK_TMP)/dep_built/hex_core $(HEX_TARBALL_OUTPUT_FILE)
3787 3785 $(verbose) $(call erlang,$(call hex_release_publish_summary.erl))
3788 3786
3789 - hex-release-publish: $(DEPS_DIR)/hex_core/ebin/dep_built hex-release-tarball
3787 + hex-release-publish: $(ERLANG_MK_TMP)/dep_built/hex_core hex-release-tarball
3790 3788 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3791 3789 $(gen_verbose) $(call erlang,$(call hex_release_publish.erl,$(HEX_SECRET),false))
3792 3790
3793 - hex-release-replace: $(DEPS_DIR)/hex_core/ebin/dep_built hex-release-tarball
3791 + hex-release-replace: $(ERLANG_MK_TMP)/dep_built/hex_core hex-release-tarball
3794 3792 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3795 3793 $(gen_verbose) $(call erlang,$(call hex_release_publish.erl,$(HEX_SECRET),true))
3796 3794
  @@ -3809,7 +3807,7 @@ define hex_release_delete.erl
3809 3807 end
3810 3808 endef
3811 3809
3812 - hex-release-delete: $(DEPS_DIR)/hex_core/ebin/dep_built
3810 + hex-release-delete: $(ERLANG_MK_TMP)/dep_built/hex_core
3813 3811 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3814 3812 $(gen_verbose) $(call erlang,$(call hex_release_delete.erl,$(HEX_SECRET)))
3815 3813
  @@ -3829,7 +3827,7 @@ define hex_release_retire.erl
3829 3827 end
3830 3828 endef
3831 3829
3832 - hex-release-retire: $(DEPS_DIR)/hex_core/ebin/dep_built
3830 + hex-release-retire: $(ERLANG_MK_TMP)/dep_built/hex_core
3833 3831 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3834 3832 $(gen_verbose) $(call erlang,$(call hex_release_retire.erl,$(HEX_SECRET),\
3835 3833 $(if $(HEX_VERSION),$(HEX_VERSION),$(PROJECT_VERSION)),\
  @@ -3851,7 +3849,7 @@ define hex_release_unretire.erl
3851 3849 end
3852 3850 endef
3853 3851
3854 - hex-release-unretire: $(DEPS_DIR)/hex_core/ebin/dep_built
3852 + hex-release-unretire: $(ERLANG_MK_TMP)/dep_built/hex_core
3855 3853 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3856 3854 $(gen_verbose) $(call erlang,$(call hex_release_unretire.erl,$(HEX_SECRET),\
3857 3855 $(if $(HEX_VERSION),$(HEX_VERSION),$(PROJECT_VERSION))))
  @@ -3860,7 +3858,7 @@ HEX_DOCS_DOC_DIR ?= doc/
3860 3858 HEX_DOCS_TARBALL_FILES ?= $(sort $(call core_find,$(HEX_DOCS_DOC_DIR),*))
3861 3859 HEX_DOCS_TARBALL_OUTPUT_FILE ?= $(ERLANG_MK_TMP)/$(PROJECT)-docs.tar.gz
3862 3860
3863 - $(HEX_DOCS_TARBALL_OUTPUT_FILE): $(DEPS_DIR)/hex_core/ebin/dep_built app docs
3861 + $(HEX_DOCS_TARBALL_OUTPUT_FILE): $(ERLANG_MK_TMP)/dep_built/hex_core app docs
3864 3862 $(hex_tar_verbose) tar czf $(HEX_DOCS_TARBALL_OUTPUT_FILE) -C $(HEX_DOCS_DOC_DIR) \
3865 3863 $(HEX_DOCS_TARBALL_FILES:$(HEX_DOCS_DOC_DIR)%=%)
3866 3864
  @@ -3884,7 +3882,7 @@ define hex_docs_publish.erl
3884 3882 end
3885 3883 endef
3886 3884
3887 - hex-docs-publish: $(DEPS_DIR)/hex_core/ebin/dep_built hex-docs-tarball-create
3885 + hex-docs-publish: $(ERLANG_MK_TMP)/dep_built/hex_core hex-docs-tarball-create
3888 3886 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3889 3887 $(gen_verbose) $(call erlang,$(call hex_docs_publish.erl,$(HEX_SECRET)))
3890 3888
  @@ -3904,7 +3902,7 @@ define hex_docs_delete.erl
3904 3902 end
3905 3903 endef
3906 3904
3907 - hex-docs-delete: $(DEPS_DIR)/hex_core/ebin/dep_built
3905 + hex-docs-delete: $(ERLANG_MK_TMP)/dep_built/hex_core
3908 3906 $(if $(HEX_SECRET),,$(eval HEX_SECRET := $(shell stty -echo; read -p "Secret: " secret; stty echo; echo $$secret) $(info )))
3909 3907 $(gen_verbose) $(call erlang,$(call hex_docs_delete.erl,$(HEX_SECRET),\
3910 3908 $(if $(HEX_VERSION),$(HEX_VERSION),$(PROJECT_VERSION))))
  @@ -4231,13 +4229,13 @@ $(foreach dep,$(SHELL_DEPS),$(eval $(call dep_target,$(dep))))
4231 4229 ifneq ($(SKIP_DEPS),)
4232 4230 build-shell-deps:
4233 4231 else
4234 - build-shell-deps: $(ALL_SHELL_DEPS_DIRS)
4232 + build-shell-deps: $(ALL_SHELL_DEPS_DIRS) | $(ERLANG_MK_TMP)/dep_built
4235 4233 $(verbose) set -e; for dep in $(ALL_SHELL_DEPS_DIRS) ; do \
4236 - if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \
4234 + if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $(ERLANG_MK_TMP)/dep_built/`basename $$dep` ]; then \
4237 4235 :; \
4238 4236 else \
4239 4237 $(MAKE) -C $$dep IS_DEP=1; \
4240 - if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \
4238 + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $(ERLANG_MK_TMP)/dep_built/$$dep; fi; \
4241 4239 fi \
4242 4240 done
4243 4241 endif
  @@ -1,10 +1,10 @@
1 1 {<<"links">>,
2 2 [{<<"Function reference">>,
3 - <<"https://ninenines.eu/docs/en/cowlib/2.17/manual/">>},
3 + <<"https://ninenines.eu/docs/en/cowlib/2.18/manual/">>},
4 4 {<<"GitHub">>,<<"https://github.com/ninenines/cowlib">>},
5 5 {<<"Sponsor">>,<<"https://github.com/sponsors/essen">>}]}.
6 6 {<<"name">>,<<"cowlib">>}.
7 - {<<"version">>,<<"2.17.1">>}.
7 + {<<"version">>,<<"2.18.0">>}.
8 8 {<<"description">>,<<"Support library for manipulating Web protocols.">>}.
9 9 {<<"app">>,<<"cowlib">>}.
10 10 {<<"build_tools">>,[<<"make">>,<<"rebar3">>]}.
  @@ -42,6 +42,10 @@
42 42
43 43 -include("cow_inline.hrl").
44 44
45 + -ifdef(TEST).
46 + -include_lib("stdlib/include/assert.hrl").
47 + -endif.
48 +
45 49 %% Cookie header.
46 50
47 51 -spec parse_cookie(binary()) -> [{binary(), binary()}].
  @@ -164,7 +168,7 @@ parse_cookie_error_test_() ->
164 168 Tests = [
165 169 <<"=">>
166 170 ],
167 - [{V, fun() -> {'EXIT', {badarg, _}} = (catch parse_cookie(V)) end} || V <- Tests].
171 + [{V, fun() -> ?assertError(badarg, parse_cookie(V)) end} || V <- Tests].
168 172 -endif.
169 173
170 174 %% Set-Cookie header.
  @@ -425,9 +429,8 @@ setcookie_max_age_test() ->
425 429 <<" Max-Age=111">>,
426 430 <<" Secure">>] = F(<<"Customer">>, <<"WILE_E_COYOTE">>,
427 431 #{max_age => 111, secure => true}),
428 - case catch F(<<"Customer">>, <<"WILE_E_COYOTE">>, #{max_age => -111}) of
429 - {'EXIT', {{badarg, {max_age, -111}}, _}} -> ok
430 - end,
432 + ?assertError({badarg, {max_age, -111}},
433 + F(<<"Customer">>, <<"WILE_E_COYOTE">>, #{max_age => -111})),
431 434 [<<"Customer=WILE_E_COYOTE">>,
432 435 <<" Expires=", _/binary>>,
433 436 <<" Max-Age=86417">>] = F(<<"Customer">>, <<"WILE_E_COYOTE">>,
Loading more files…