set_quilt_vars.sh 1.6 KB

1234567891011121314151617181920212223242526272829
  1. # Sets quilt variables for updating the patches
  2. # Make sure to run this with the shell command "source" in order to inherit the variables into the interactive environment
  3. # There is some problem with the absolute paths in QUILT_PATCHES and QUILT_SERIES breaking quilt
  4. # (refresh and diff don't read QUILT_*_ARGS, and series displays absolute paths instead of relative)
  5. # Specifying a quiltrc file fixes this, so "--quiltrc -" fixes this too.
  6. # One side effect of '--quiltrc -' is that we lose default settings from /etc/quilt.quiltrc, so they are redefined below.
  7. alias quilt='quilt --quiltrc -'
  8. # Assume this script lives within the repository
  9. REPO_ROOT=$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]:-${(%):-%x}}")")")
  10. export QUILT_PATCHES="$REPO_ROOT/patches"
  11. #export QUILT_SERIES=$(readlink -f "$REPO_ROOT/patches/series")
  12. # Options below borrowed from Debian and default quilt options (from /etc/quilt.quiltrc on Debian)
  13. export QUILT_PUSH_ARGS="--color=auto"
  14. export QUILT_DIFF_OPTS="--show-c-function"
  15. export QUILT_PATCH_OPTS="--unified --reject-format=unified"
  16. export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto --sort"
  17. export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
  18. export QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
  19. export QUILT_SERIES_ARGS="--color=auto"
  20. export QUILT_PATCHES_ARGS="--color=auto"
  21. export LC_ALL=C
  22. # When non-default less options are used, add the -R option so that less outputs
  23. # ANSI color escape codes "raw".
  24. [ -n "$LESS" -a -z "${QUILT_PAGER+x}" ] && export QUILT_PAGER="less -FRX"