Subversion Repositories

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

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

Rev Author Line No. Line
2 magnus 1
#!/bin/sh
2
## 01_line-endings.dpatch by Magnus Holmgren <magnus@kibibyte.se>
3
##
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Convert CRLF line endings to LF in certain Windows-related files
6
 
7
FILES_WITH_CRLF="src/libspf2/spf_dns_windns.c
8
                 src/libspf2/spf_win32.c
9
                 src/libreplace/win32_config.h
10
                 src/include/spf_dns_windns.h
11
                 src/include/spf_win32.h"
12
 
13
set -e
14
 
15
dpatch_patch() {
5 magnus 16
    if [ ! -f debian/patched/patched-line-endings.tar.gz ]; then
17
        tar -czf debian/patched/patched-line-endings.tar.gz $FILES_WITH_CRLF
18
        # Change line endings to LF in files with CRLF
19
        sed -ri -e 's/\r$//' $FILES_WITH_CRLF
20
    fi
2 magnus 21
}
22
 
23
dpatch_unpatch() {
24
    # Change line endings back to CRLF in files that had it in the tarball
5 magnus 25
    tar -xzf debian/patched/patched-line-endings.tar.gz
2 magnus 26
}
27
 
28
DPATCH_LIB_NO_DEFAULT=1
29
 
30
. /usr/share/dpatch/dpatch.lib.sh