Subversion Repositories

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

Rev 5 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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