Subversion Repositories

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

Rev 5 | 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() {
    if [ ! -f debian/patched/patched-line-endings.tar.gz ]; then
        tar -czf debian/patched/patched-line-endings.tar.gz $FILES_WITH_CRLF
        # Change line endings to LF in files with CRLF
        sed -ri -e 's/\r$//' $FILES_WITH_CRLF
    fi
}

dpatch_unpatch() {
    # Change line endings back to CRLF in files that had it in the tarball
    tar -xzf debian/patched/patched-line-endings.tar.gz
}

DPATCH_LIB_NO_DEFAULT=1

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