debian-quilt 678 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # vim: set ts=4 sw=4 sts=4 et :
  3. #
  4. # Given a series.conf file and debian patches directory, patches
  5. # are copied to debian patch directory
  6. USAGE="${0} <series.conf> <patchdir>"
  7. set -e
  8. set -o pipefail
  9. DIR="${0%/*}"
  10. SERIES_CONF="${1}"
  11. PATCH_DIR="${2}"
  12. if test $# -lt 2 || [ ! -e "${SERIES_CONF}" ] || [ ! -d "${PATCH_DIR}" ] ; then
  13. echo "${USAGE}" >&2
  14. exit 1
  15. fi
  16. # Clear patch series.conf file
  17. rm -f "${PATCH_DIR}/series"
  18. touch "${PATCH_DIR}/series"
  19. while read -r patch_file
  20. do
  21. if [ -e "${DIR}/${patch_file}" ]; then
  22. echo -e "${patch_file##*/}" >> "${PATCH_DIR}/series"
  23. cp "${DIR}/${patch_file}" "${PATCH_DIR}"
  24. fi
  25. done < "${SERIES_CONF}"