diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-03-11 18:39:04 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-03-11 18:39:04 +0800 |
commit | f9ef48260d06a9214c8f9610f74187c1f642ea6c (patch) | |
tree | 2c26a712bbcce849da381fd2a531b8812851aca9 /Mk/Uses | |
parent | ec942c7894770affba041b6cb4c72c8daa865a44 (diff) | |
download | freebsd-ports-gnome-f9ef48260d06a9214c8f9610f74187c1f642ea6c.tar.gz freebsd-ports-gnome-f9ef48260d06a9214c8f9610f74187c1f642ea6c.tar.zst freebsd-ports-gnome-f9ef48260d06a9214c8f9610f74187c1f642ea6c.zip |
Allow overriding WRKSRC for USES=dos2unix
Approved by: portmgr (mat)
Differential Revision: https://reviews.freebsd.org/D5607
Diffstat (limited to 'Mk/Uses')
-rw-r--r-- | Mk/Uses/dos2unix.mk | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Mk/Uses/dos2unix.mk b/Mk/Uses/dos2unix.mk index 7a5e83ea7e98..62adc24004a0 100644 --- a/Mk/Uses/dos2unix.mk +++ b/Mk/Uses/dos2unix.mk @@ -5,6 +5,7 @@ # DOS2UNIX_REGEX a regular expression to match files that needs to be converted # DOS2UNIX_FILES list of files of glob pattern relative to ${WRKSRC} # DOS2UNIX_GLOB list of glob pattern find(1) will match with +# DOS2UNIX_WRKSRC top-level path for directory traversal instead of ${WRKSRC} # # MAINTAINER: portmgr@FreeBSD.org @@ -15,22 +16,24 @@ _INCLUDE_USES_DOS2UNIX_MK= yes _DOS2UNIX_ALL= yes .endif +DOS2UNIX_WRKSRC?= ${WRKSRC} + _USES_patch+= 200:dos2unix dos2unix: @${ECHO_MSG} "===> Converting DOS text files to UNIX text files" .if defined(_DOS2UNIX_ALL) - @${FIND} ${WRKSRC} -type f -print0 | \ + @${FIND} ${DOS2UNIX_WRKSRC} -type f -print0 | \ ${XARGS} -0 ${SED} -i '' -e 's/
$$//' .else .if defined(DOS2UNIX_FILES) - @(cd ${WRKSRC}; \ + @(cd ${DOS2UNIX_WRKSRC}; \ ${ECHO_CMD} ${DOS2UNIX_FILES} | ${XARGS} ${SED} -i '' -e 's/
$$//' ) .elif defined(DOS2UNIX_REGEX) - @${FIND} -E ${WRKSRC} -type f -iregex '${DOS2UNIX_REGEX}' -print0 | \ + @${FIND} -E ${DOS2UNIX_WRKSRC} -type f -iregex '${DOS2UNIX_REGEX}' -print0 | \ ${XARGS} -0 ${SED} -i '' -e 's/
$$//' .else .for f in ${DOS2UNIX_GLOB} - @${FIND} ${WRKSRC} -type f -name '${f}' -print0 | \ + @${FIND} ${DOS2UNIX_WRKSRC} -type f -name '${f}' -print0 | \ ${XARGS} -0 ${SED} -i '' -e 's/
$$//' .endfor .endif |