[152507] contrib/mp-buildbot/mpbb-cleanup

Rainer Müller raimue at macports.org
Mon Sep 12 01:53:04 PDT 2016


On 2016-09-12 10:41, Clemens Lang wrote:
> On Sun, Sep 11, 2016 at 11:47:58AM -0700, raimue at macports.org wrote:
>> Revision: 152507
>>           https://trac.macports.org/changeset/152507
>> Author:   raimue at macports.org
>> 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


More information about the macports-dev mailing list