diff options
author | Loïc Hoguin <[email protected]> | 2015-06-28 23:08:01 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-06-28 23:12:10 +0200 |
commit | 857f595ed5293a9dae42ef64062461ee35547663 (patch) | |
tree | 27b3fd1690f1141ef51c89ec0507762e2976ae3e /core/index.mk | |
parent | 9a2dd5dfb20b2b5dbb08d9441a184815b5337cbe (diff) | |
download | erlang.mk-857f595ed5293a9dae42ef64062461ee35547663.tar.gz erlang.mk-857f595ed5293a9dae42ef64062461ee35547663.tar.bz2 erlang.mk-857f595ed5293a9dae42ef64062461ee35547663.zip |
Bundle the package index directly inside erlang.mk
If you were using the index file as a "lock file",
bear with me for a moment, equivalent functionality
will soon be added. :-)
Diffstat (limited to 'core/index.mk')
-rw-r--r-- | core/index.mk | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/index.mk b/core/index.mk new file mode 100644 index 0000000..a16eceb --- /dev/null +++ b/core/index.mk @@ -0,0 +1,26 @@ +# Copyright (c) 2015, Loïc Hoguin <[email protected]> +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: search + +define pkg_print + @printf "%s\n" \ + $(if $(call core_eq,$(1),$(pkg_$(1)_name)),,"Pkg name: $(1)") \ + "App name: $(pkg_$(1)_name)" \ + "Description: $(pkg_$(1)_description)" \ + "Home page: $(pkg_$(1)_homepage)" \ + "Fetch with: $(pkg_$(1)_fetch)" \ + "Repository: $(pkg_$(1)_repo)" \ + "Commit: $(pkg_$(1)_commit)" \ + "" + +endef + +search: +ifdef q + $(foreach p,$(PACKAGES), \ + $(if $(findstring $(call core_lc,$(q)),$(call core_lc,$(pkg_$(p)_name) $(pkg_$(p)_description))), \ + $(call pkg_print,$(p)))) +else + $(foreach p,$(PACKAGES),$(call pkg_print,$(p))) +endif |