[R-SIG-Mac] Removing (completely) TCl/Tk
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Dec 9 20:02:43 CET 2015
On 09/12/2015 16:50, Federico Calboli wrote:
>
>> On 9 Dec 2015, at 18:40, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
>>
>> On 09/12/2015 16:12, Federico Calboli wrote:
>>> Hi All,
>>>
>>> I have TCL/Tk installed from the latest DMG image for R 3.2.2 I will upgrade to R 3.2.3 as soon as the DMG is available). I’d like to *completely remove* Tcl/Tk as installed by the DMG image. I can get a list of files from:
>>>
>>> pkgutil --files org.r-project.x86_64.tcltk.x11
>>>
>>> but the list is long it it looks like it is going to be tedious to remove all the files one by one (I could remove the directories but I could only do that once I am sure nothing else is there from another source).
>>>
>>> Is there a smarter way of achieving my goal?
>>
>> You could edit the list to remove directories such as
>>
>> usr
>> usr/local
>> usr/local/bin
>> usr/local/include
>> usr/local/lib
>> usr/local/lib/pkgconfig
>> usr/local/man
>> usr/local/man/man1
>> usr/local/man/man3
>> usr/local/share
>> usr/local/share/man
>> usr/local/share/man/mann
>>
>> then use a (shell? R?) script on the list.
>
> Indeed. My only concern is whether these directories have been created by the R DMG installer and have *never* been used by any other program to put some Tcl/Tk related file (or not just those, especially in the ‘man’ directories!). Hence my desire to remove the files in the list, so I can ascertain post-hoc whether the directories are empty or not (and thus remove them).
So use unlink() below.
> BW
>
> F
>
>
>
>
>
>>
>> Also, the R-devel manual sources contains the commented block:
>>
>> @c Maybe too dangerous for naive users.
>> @c The second could be uninstalled by an @R{} script like
>>
>> @c @example
>> @c lis <- system2("pkgutil", "--files org.r-project.x86_64.texinfo", stdout = TRUE)
>> @c setwd("/")
>> @c file.remove(rev(lis))
>> @c @end example
>>
>> @c @noindent
>> @c run as the owner of @file{/usr/local}.
>>
>> where file.remove will remove empty directories (and rev() ensures they are emptied first).
>>
>>
>> --
>> Brian D. Ripley, ripley at stats.ox.ac.uk
>> Emeritus Professor of Applied Statistics, University of Oxford
>
> --
> Federico Calboli
> Ecological Genetics Research Unit
> Department of Biosciences
> PO Box 65 (Biocenter 3, Viikinkaari 1)
> FIN-00014 University of Helsinki
> Finland
>
> federico.calboli at helsinki.fi
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
More information about the R-SIG-Mac
mailing list