Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 5 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/sh
## 01_line-endings.dpatch by Magnus Holmgren <magnus@kibibyte.se>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Convert CRLF line endings to LF in certain Windows-related files

FILES_WITH_CRLF="src/libspf2/spf_dns_windns.c
                 src/libspf2/spf_win32.c
                 src/libreplace/win32_config.h
                 src/include/spf_dns_windns.h
                 src/include/spf_win32.h"

set -e

dpatch_patch() {
    # Change line endings to LF in files with CRLF
    sed -ri -e 's/\r$//' $FILES_WITH_CRLF
}

dpatch_unpatch() {
    # Change line endings back to CRLF in files that had it in the tarball
    # Unfortunately there are exceptions ... have to watch out for changes
    # in future upstream versions (or simply make backups instead).
    sed -ri -e '/\r$|^#pragma comment/!s/$/\r/' $FILES_WITH_CRLF
    sed -ri -e '$s/\r$//' src/libspf2/spf_dns_windns.c
}

DPATCH_LIB_NO_DEFAULT=1

. /usr/share/dpatch/dpatch.lib.sh