On 2016-09-12 10:41, Clemens Lang wrote:
> On Sun, Sep 11, 2016 at 11:47:58AM -0700, [email protected] wrote:
>> Revision: 152507
>>           https://trac.macports.org/changeset/152507
>> Author:   [email protected]
>> Date:     2016-09-11 11:47:58 -0700 (Sun, 11 Sep 2016)
>> Log Message:
>> -----------
>> buildbot: skip cleanup if port is not installed
>> [...]
>> Modified: contrib/mp-buildbot/mpbb-cleanup
>> ===================================================================
>> --- contrib/mp-buildbot/mpbb-cleanup 2016-09-11 18:41:15 UTC (rev 152506)
>> +++ contrib/mp-buildbot/mpbb-cleanup 2016-09-11 18:47:58 UTC (rev 152507)
>> @@ -10,6 +10,15 @@
>>  }
>>  
>>  cleanup() {
>> +    # if this is the very first build, selfupdate did not install port yet
>> +    # $option_prefix is set by mpbb
>> +    # shellcheck disable=SC2154
>> +    if [ ! -e "${option_prefix}/bin/port" ]; then
>> +        echo "---> Skipping cleanup"
>> +        echo "port not installed at ${option_prefix}/bin/port"
>> +        return
>> +    fi
>> +
>>      echo "----> Deactivating ports"
>>      # $option_prefix is set by mpbb
>>      # shellcheck disable=SC2154
> 
> If $prefix/bin/port does not exist, $prefix/bin/port-tclsh will not
> exist either, and the invocation of "tools/uninstall-old-ports.tcl"
> below will fail as well.

The 'return' just skips everything else in this step, so that would be
covered.

Another solution would be to run selfupdate before the cleanup step to
ensure we always cleanup with a working port command. Although such a
situation should only happen when the slaveprefix was deleted manually.

Rainer
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to