Q about post-extract recent commit breakage

Ryan Schmidt ryandesign at macports.org
Wed Dec 5 10:05:36 UTC 2018



On Dec 4, 2018, at 12:03, Michael Dickens wrote:
> On Tue, Dec 4, 2018, at 2:07 AM, Ryan Schmidt wrote:
>> On Dec 4, 2018, at 01:04, Ryan Schmidt wrote:
>>> On Dec 3, 2018, at 19:35, Michael Dickens wrote:
>>> 
>>>> Here's the error (just do "sudo port extract cmake-devel"; it results in this error on every OS I tested, from 10.5 to 10.14):
>>>> {{{
>>>> Error: Failed to extract cmake-devel: error renaming "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13" to "/opt/local/var/macports/build/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/work/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13/cmake-772edffbf0c08fc0a6fcf74fb98545b7afcfee13-772edffbf0c08fc0a6fcf74fb98545b7afcfee13": trying to rename a volume or move a directory into itself
>>>> Error: See /opt/local/var/macports/logs/_opt_sources_MacPorts_ports_github_macports_devel_cmake/cmake-devel/main.log for details.
>>>> }}}
>>> 
>>> Ok, that's because cmake-devel does this:
>>> 
>>>   post-extract {
>>>       move ${workpath}/${name}-${commit}-${commit} ${workpath}/${name}-${commit}
>>>   }
>>> 
>>> Now that base has been changed, MacPorts has already made a ${worksrcdir} (in this case ${name}-${commit}) symlink for you. So for compatibility with both the released version of MacPorts and master, you should ensure it doesn't already exist before moving it:
>>> 
>>>   post-extract {
>>>       if {![file exists ${worksrcpath}]} {
>>>           move ${workpath}/${name}-${commit}-${commit} ${worksrcpath}
>>>       }
>>>   }
>>> 
>>> which is basically what's done in the remaining commit for libao in this PR:
>>> 
>>> https://github.com/macports/macports-ports/pull/1760
>>> 
>>> After compatibility with the current version of MacPorts is no longer needed, the entire post-extract block can be removed.
>> 
>> Or, more simply and more usually, you should be able to just:
>> 
>> worksrcdir        ${name}-${commit}-${commit}
>> 
>> (and again, if desired, remove it once a future version of MacPorts is 
>> released).
> 

> Or, even more simply, just remove the post-extract all together. I don't recall why it's the in the first place, but removing it seems to do the trick. Thanks! 


That works with the not-yet-released MacPorts master version, but does not work with the released MacPorts 2.5.4; for that version, you still need to set worksrcdir manually when it is not the default value. Fixed in 860f9c647f60a33043e8a13dfe688c575faa88cd.




More information about the macports-dev mailing list