How identify and remove leftover files on buildbots?

Ryan Schmidt ryandesign at macports.org
Mon Nov 3 22:10:12 PST 2014


On Nov 3, 2014, at 3:43 AM, Thomas Friedrichsmeier wrote:
> 
> Ryan Schmidt wrote on Sun Nov 2 16:05:00 PST 2014:
>> Why do you need to delete these files? Can new versions of rkward not
>> overwrite the old files?
> 
> That is exactly the problem:
> 
> Error: org.macports.activate for port rkward returned: Image error: 
> /opt/local/Library/Frameworks/R.framework/Resources/library/rkward/CITATION 
> already exists and does not belong to a registered port.  Unable to activate 
> port rkward. Use 'port -f activate rkward' to force the activation.
> 
> The file rkward/CITATION clearly belongs to the rkward port, but it is not 
> registered as such, and the buildbot refuses to overwrite it. This is probably 
> just the first file where the problem is encountered. RKWard installs files 
> (utilizing "R CMD INSTALL") to exactly two directories under R.framework:
> 
> /opt/local/Library/Frameworks/R.framework/Resources/library/rkward/
> /opt/local/Library/Frameworks/R.framework/Resources/library/rkwardtests/
> 
> I do not know, whether all files in these directories are unregistered, or 
> only some. But all files in these two directories clearly belong to the rkward 
> port.
> 
>> If not, shouldn't the deletion of these files be happening in rkward's
>> pre-activate, not R's?
> 
> I'd tend to think so, too, but I don't have a clear understanding of what 
> happens during activation / de-activation, or in more general of what the 
> buildbot does. However, AFAIU Marko's reasoning, 
> - the unregistered rkward files would be in the way of (de-)activating the R 
> port itself
> - and since the R port would have to be activated, first, this would prevent 
> the buildbot from even getting to rkward's pre-activation stage.
> 
>> Ideally we would figure out how to make R's install feature install into 
>> the destroot.
> 
> It's somewhat hard to diagnose, but my current best guess is that the problem 
> is due to:
> 
> 1. The last time the rkward port was installed, not all files installed via R 
> CMD INSTALL went into the destroot, and thus did not get registered.
> 2. This time, all files to be installed in 
> /opt/local/Library/Frameworks/R.framework/Resources/library/ do get 
> destrooted, properly. Which is why the buildbot thinks the port is trying to 
> overwrite files that don't belong to it.
> (3. This is likely due to some change in the version of R installed at the 
> time of 1, or some other external change. RKWard's installation procedure for 
> these files is unchanged since over three years.)

Great, so it sounds like the original problem that led to the files being directly installed has already been fixed, and all that we need to do now is delete those files before activating the port that installs them. That port is rkward, so that's where the pre-activate block belongs. Either write a pre-activate block that explicitly deletes all the files that were directly installed before, or if you don't have such a list and can't reproduce it by reinstalling an old version of R and rkward on your system, then you could fs-traverse those two known directories:

${frameworks_dir}/R.framework/Resources/library/rkward/
${frameworks_dir}/R.framework/Resources/library/rkwardtests/

and delete any non-registered files in there.




More information about the macports-dev mailing list