updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / cuda-toolkit-old / install-linux.pl.ununinstall.patch
blob7062a4f190f2b11e03032b21b7a9311843070f64
1 --- pkg/install-linux.pl 2009-07-15 06:24:28.000000000 +0900
2 +++ pkg/install-linux.pl.fix 2009-07-28 22:00:56.000000000 +0900
3 @@ -9,96 +9,6 @@
5 my %CmdLineOption;
7 -sub uninstallCuda {
8 - my ($uninstallPath) = @_;
10 - # bin
11 - system( "rm -rfv $uninstallPath/bin2c" );
12 - system( "rm -rfv $uninstallPath/cudafe" );
13 - system( "rm -rfv $uninstallPath/fatbin" );
14 - system( "rm -rfv $uninstallPath/filehash" );
15 - system( "rm -rfv $uninstallPath/nvcc" );
16 - system( "rm -rfv $uninstallPath/nvcc.profile" );
17 - system( "rm -rfv $uninstallPath/ptxas" );
19 - # doc
20 - system( "rm -rfv $uninstallPath/../doc/cublas_library.pdf" );
21 - system( "rm -rfv $uninstallPath/../doc/cublas_library.txt" );
22 - system( "rm -rfv $uninstallPath/../doc/cuda_profiler.txt" );
23 - system( "rm -rfv $uninstallPath/../doc/CUDA_Programming_Guide.pdf" );
24 - system( "rm -rfv $uninstallPath/../doc/cufft_library.pdf" );
25 - system( "rm -rfv $uninstallPath/../doc/cufft_library.txt" );
26 - system( "rm -rfv $uninstallPath/../doc/nvcc.pdf" );
27 - system( "rm -rfv $uninstallPath/../doc/release_notes.txt" );
28 - system( "rm -rfv $uninstallPath/../doc/EULA.txt" );
30 - system( "rm -rfv $uninstallPath/../doc/CUBLAS_Library*" );
31 - system( "rm -rfv $uninstallPath/../doc/CUDA_Profiler*" );
32 - system( "rm -rfv $uninstallPath/../doc/CUDA_Programming_Guide*" );
33 - system( "rm -rfv $uninstallPath/../doc/CUFFT_Library*" );
34 - system( "rm -rfv $uninstallPath/../doc/NVCC*" );
35 - system( "rm -rfv $uninstallPath/../doc/CUDA_Release_Notes*" );
36 - system( "rm -rfv $uninstallPath/../doc/CUDA_Programming_Guide_Revision_History*" );
37 - system( "rm -rfv $uninstallPath/../doc/README.txt" );
39 - # include
40 - system( "rm -rfv $uninstallPath/../include/builtin_types.h");
41 - system( "rm -rfv $uninstallPath/../include/channel_descriptor.h");
42 - system( "rm -rfv $uninstallPath/../include/common_functions.h");
43 - system( "rm -rfv $uninstallPath/../include/crt");
44 - system( "rm -rfv $uninstallPath/../include/cublas.h");
45 - system( "rm -rfv $uninstallPath/../include/cuComplex.h");
46 - system( "rm -rfv $uninstallPath/../include/cudaD3D9.h");
47 - system( "rm -rfv $uninstallPath/../include/cuda_d3d9_interop.h");
48 - system( "rm -rfv $uninstallPath/../include/__cudaFatFormat.h");
49 - system( "rm -rfv $uninstallPath/../include/cudaGL.h");
50 - system( "rm -rfv $uninstallPath/../include/cuda_gl_interop.h");
51 - system( "rm -rfv $uninstallPath/../include/cuda.h");
52 - system( "rm -rfv $uninstallPath/../include/cuda_runtime_api.h");
53 - system( "rm -rfv $uninstallPath/../include/cuda_runtime.h");
54 - system( "rm -rfv $uninstallPath/../include/cufft.h");
55 - system( "rm -rfv $uninstallPath/../include/device_functions.h");
56 - system( "rm -rfv $uninstallPath/../include/device_launch_parameters.h");
57 - system( "rm -rfv $uninstallPath/../include/driver_types.h");
58 - system( "rm -rfv $uninstallPath/../include/host_defines.h");
59 - system( "rm -rfv $uninstallPath/../include/math_constants.h");
60 - system( "rm -rfv $uninstallPath/../include/math_functions_dbl_ptx1.h");
61 - system( "rm -rfv $uninstallPath/../include/math_functions.h");
62 - system( "rm -rfv $uninstallPath/../include/texture_fetch_functions.h");
63 - system( "rm -rfv $uninstallPath/../include/texture_types.h");
64 - system( "rm -rfv $uninstallPath/../include/vector_functions.h");
65 - system( "rm -rfv $uninstallPath/../include/vector_types.h");
67 - # open64
68 - system( "rm -rfv $uninstallPath/../open64");
70 - # src
71 - system( "rm -rfv $uninstallPath/../src/fortran.c");
73 - # lib
74 - system( "rm -rfv $uninstallPath/../lib/libcublasemu.so*");
75 - system( "rm -rfv $uninstallPath/../lib/libcublas.so*");
76 - system( "rm -rfv $uninstallPath/../lib/libcudart.so*");
77 - system( "rm -rfv $uninstallPath/../lib/libcuda.so*");
78 - system( "rm -rfv $uninstallPath/../lib/libcufftemu.so*");
79 - system( "rm -rfv $uninstallPath/../lib/libcufft.so*");
80 - system( "rm -rfv $uninstallPath/../lib/libfatZip.so");
81 - system( "rm -rfv $uninstallPath/../lib/libptxcomp.so");
82 - system( "rm -rfv $uninstallPath/../lib/README.fatZip");
84 - rmdir "$uninstallPath/../lib";
85 - rmdir "$uninstallPath/../doc";
86 - rmdir "$uninstallPath/../src";
87 - rmdir "$uninstallPath/../open64";
88 - rmdir "$uninstallPath/../include";
89 - rmdir "$uninstallPath";
91 - if ($uninstallPath =~ /(.*\/cuda)\/bin$/) {
92 - rmdir "$1";
93 - }
95 -}
97 ## Turn off buffering
98 STDOUT->autoflush(1);
100 @@ -144,57 +53,6 @@
102 $prefix =~ s/~/$HOME/g;
105 -### Uninstall if necessary
107 -### look for previous version by looking for nvcc in the path
108 -my @paths = split /:/, $ENV{"PATH"};
109 -my $pathdir;
110 -my @files;
112 -### also include /usr/local just in case
113 -push(@paths, "/usr/local/bin");
115 -### also include /usr/local/cuda just in case
116 -push(@paths, "/usr/local/cuda/bin");
118 -### also push the requested path
119 -push(@paths, $prefix);
121 -foreach $pathdir (@paths) {
123 - opendir(DIR, $pathdir);
124 - @files = grep { /^nvcc$/ } readdir(DIR);
126 - if ($#files == 0) {
127 - if ($ARGV[0] eq "auto") {
128 - uninstallCuda($pathdir);
129 - } else {
130 - printf("A previous version of CUDA was found in $pathdir\n");
132 - my $yesno = "";
133 - while ($yesno ne "yes" &&
134 - $yesno ne "no" &&
135 - $yesno ne "abort") {
136 - printf("Would you like to uninstall? (yes/no/abort): ");
137 - $yesnoline = Term::ReadLine->new("foo");
138 - $yesno = $yesnoline->readline();
141 - if ($yesno eq "abort") {
142 - exit(0);
145 - if ($yesno eq "yes") {
146 - uninstallCuda($pathdir);
151 - closedir(DIR);
155 ## make sure we can write the file
156 system("mkdir -p $prefix && chmod 0755 $prefix") unless (-d "$prefix");
157 system("touch $prefix/empty");