imapfilter convenience wrapper

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/bin/bash
  2. #shellcheck disable=SC2034
  3. # MKit - simple install helper
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # Add 'async' tag to build meta-data (true|false)
  7. #
  8. # If 'true' and during the version computation git branch is behind
  9. # or ahead its remote counterpart, build meta-data (part after '+'
  10. # sign) will contain word 'async'.
  11. #
  12. # This is to warn testers and developers when build was done after
  13. # automatic rebase done by CI system.
  14. #
  15. # Defaults to 'true'.
  16. #
  17. MKIT_ASYNC=${MKIT_ASYNC:-true}
  18. #
  19. # Bump size (for vbump_? and release_?)
  20. #
  21. MKIT_BUMPSIZE=${MKIT_BUMPSIZE:-1}
  22. #
  23. # Debug mode (true|false)
  24. #
  25. MKIT_DEBUG=${MKIT_DEBUG:-false}
  26. #
  27. # Default deploy mode for files
  28. #
  29. MKIT_DEFAULT_MODE="644"
  30. #
  31. # Dry mode (true|false)
  32. #
  33. # Set to true to not install anything. Implies MKIT_DEBUG.
  34. #
  35. MKIT_DRY=${MKIT_DRY:-false}
  36. #
  37. # Is MKit running in CI (true|false)
  38. #
  39. # If MKit is running in CI, it's recommended to set this to 'true'
  40. # to enable one or more useful warnings.
  41. #
  42. # Defaults to 'false'.
  43. #
  44. MKIT_IN_CI=${MKIT_IN_CI:-false}
  45. #
  46. # Path to mkit.ini
  47. #
  48. MKIT_INI=${MKIT_INI:-mkit.ini}
  49. #
  50. # Limit ini expansion depth
  51. #
  52. # To avoid endless loops, this value is subtracted each
  53. # time ini() expands a reference; when zero is reached,
  54. # no more expansions happen.
  55. #
  56. MKIT_INI_EXPAND=2
  57. #
  58. # Path to MKit local config and temp
  59. #
  60. # Typically hidden in project root, here MKit can
  61. # save its temporary lists.
  62. #
  63. MKIT_LOCAL=${MKIT_LOCAL:-.mkit}
  64. #
  65. # Paths to MKit plugins
  66. #
  67. # Colon-separated list of paths where MKit will recognize
  68. # plug-ins.
  69. #
  70. MKIT_PLUGINPATH=${MKIT_PLUGINPATH:-$MKIT_DIR/plugins:$MKIT_LOCAL/plugins:$MKIT_DIR-plugins}
  71. #
  72. # Package name
  73. #
  74. # Used as base for tarball and in some default macros.
  75. #
  76. MKIT_PROJ_PKGNAME=""
  77. #
  78. # Add time-based ordinal tag to SemVer build data?
  79. #
  80. # Can be 'none', 'ctime' or 'btime'.
  81. #
  82. # If 'ctime', devel builds have also timestamp-based tag in format of
  83. # `t%Y%m%d%H%M%S`, that is, a small character 't' followed by timestamp
  84. # without non-digit characters. The timestamps are in UTC, ie. timezones
  85. # need not apply. 'btime' has the same format, except that it's derived
  86. # from build time, while 'ctime' is from last commit's commit date.
  87. #
  88. # This helps with deploying development builds where packaging system
  89. # is not SemVer-compliant and makes it hard to install arbitrary version.
  90. # For example, old yum version (as of RHEL-6) will not let you install
  91. # version that it deems older than is installed, making it hard to
  92. # continually upgrade during active development. While packaging
  93. # systems have their own rules (and SemVer says both versions should be
  94. # considered same) this tag will make it more likely to "win" the build
  95. # you made later.
  96. #
  97. # Note that this does not affect clean builds (ie. builds from clean
  98. # repo with HEAD corresponding to latest version tag.).
  99. #
  100. # Also note that 'btime' makes the version non-deterministic: merely
  101. # initiating the build a second later will result in different version.
  102. #
  103. MKIT_TSTAMP=${MKIT_TSTAMP:-ctime}
  104. #
  105. # Upstream hash to add to build meta-data
  106. #
  107. # If set to non-empty string, it must represent a short-hash of
  108. # upstream commit on which local branch was automatically rebased
  109. # before build.
  110. #
  111. # If CI system automatically rebases branches, the resulting short-hash
  112. # (appearing with `g` prefix) will be meaningless, and might be
  113. # misleading -- testers and developers might see the build as coming
  114. # from an unknown source.
  115. #
  116. # In that case, it's strongly recommended for CI to set this to the
  117. # original pushed short-hash before the rebase. Resulting meta-data
  118. # will contain both hashes, allowing users to pair test results with
  119. # original push. The appearance of the extra hash will also warn
  120. # about the fact that the rebase took place.
  121. #
  122. # For example, if developer pushed branch 'foo' that pointed to
  123. # `5faf551`, and CI system rebased it, altering the HEAD to
  124. # `bb4baa4`, by default the version would look like:
  125. #
  126. # 0.0.1+t202103011224.foo.gbb4baa4
  127. #
  128. # This would be meaningless for testing, as the `bb4baa4` hash is
  129. # completely temporary and unknonwn.
  130. #
  131. # However, a conformant CI should set `MKIT_UPSTREAM=5faf551`, which
  132. # will result in version like:
  133. #
  134. # 0.0.1+t202103011224.foo.gbb4baa4.u5faf551
  135. #
  136. # which still has technically correct git hash after `g`, but contains
  137. # the original hash as pushed after `u`.
  138. #
  139. # Defaults to empty value.
  140. #
  141. MKIT_UPSTREAM=${MKIT_UPSTREAM:-}
  142. #
  143. # This MKit version
  144. #
  145. MKIT_VERSION=0.1.3