ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
Subject Getting the Exec task to shut up
Date Tue, 22 May 2007 15:34:36 GMT
As part of our build process, I have to convert DOS line endings to
Unix line endings on shell script we package in our tarball.

I use the "dos2unix" command for that which I've placed inside a shell
script. Then, I have the ant "exec" task run the shell script.

A funny thing, my shell script produces no output. I've used the
"--quiet" switch on the dos2unix command, then I even redirect the
output to /dev/null and merge STDERR to STDOUT. If I run the build.xml
via the command line, I get no output. However, if I have
CruiseControl run the build, I get thousands of lines of:

dos2unix: converting file bin/dom_asset_adserver_xref_initializer to
UNIX format ...
dos2unix: converting file bin/run_de6_auto_import to UNIX format ...
dos2unix: converting file bin/run_flight_status_checker.cmd to UNIX format ...
dos2unix: converting file bin/run_dom_autoimport_request_processor to
UNIX format ...
dos2unix: converting file bin/run_dom_autoimport_loader.sh to UNIX format ...
dos2unix: converting file bin/run_flight_status_checker.sh to UNIX format ...
dos2unix: converting file bin/run_flight_status_checker_AS.sh to UNIX format ...
dos2unix: converting file bin/run_dom_autoimport_requester to UNIX format ...
dos2unix: converting file bin/run_autoimport_extractor to UNIX format ...

I'm at a loss as to why I am getting these messages in my
CruiseControl log and how I can get rid of them.

Here's my shell script:

#! /bin/ksh
# fixLineEndings
#
for directory in "$@"
do
    echo "Fixing line endings in directory \"$directory\""
    find $directory -type f | while read file
    do
        filetype=`file $file`
        if echo "$filetype" | grep "text" > /dev/null 2>&1
        then
            dos2unix -q "$file" > /dev/null 2>&1
        fi
    done
done


And here's my Ant task:

    <exec
        executable="${basedir}/fixLineEndings"
        os="Linux">
        <arg value="${tarfilebase}/bin"/>
        <arg value="${tarfilebase}/conf"/>
        <arg value="${tarfilebase}/dbutil"/>
    </exec>

--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message