[151265] contrib/mp-buildbot/mpbb-install-dependencies

Ryan Schmidt ryandesign at macports.org
Sun Aug 14 05:02:38 PDT 2016


> On Aug 11, 2016, at 1:53 AM, mojca at macports.org wrote:
> 
> Revision
> 151265
> Author
> mojca at macports.org
> Date
> 2016-08-10 23:53:19 -0700 (Wed, 10 Aug 2016)
> Log Message
> 
> mp-buildbot/install-dependencies: write port name, do not repeat text to be printed
> Modified Paths
> 
> 	• contrib/mp-buildbot/mpbb-install-dependencies
> Diff
> 
> Modified: contrib/mp-buildbot/mpbb-install-dependencies (151264 => 151265)
> 
> --- contrib/mp-buildbot/mpbb-install-dependencies	2016-08-11 06:48:51 UTC (rev 151264)
> +++ contrib/mp-buildbot/mpbb-install-dependencies	2016-08-11 06:53:19 UTC (rev 151265)
> 
> @@ -40,10 +40,14 @@
> 
>      dependencies_count=$(echo "$dependencies" | wc -l | sed 's/ *//g')
> 
>      dependencies_counter=1
> 
>  
> 
> -    echo "Installing $dependencies_count dependencies:"
> -    echo "Installing $dependencies_count dependencies:" >> "$log_status_dependencies"
> -    echo "$dependencies" | sed -E 's/^/ - /'
> -    echo "$dependencies" | sed -E 's/^/ - /' >> "$log_status_dependencies"
> 
> +    text="Installing $dependencies_count dependencies of $option_port:"
> +    echo "$text"
> +    echo "$text" >> "$log_status_dependencies"
> +

Rather than having to echo the same thing twice, you can use tee:

echo "Installing $dependencies_count dependencies of $option_port:" | tee -a "$log_status_dependencies"

This will display the text on stdout and append it to the logfile.



More information about the macports-dev mailing list