This file is indexed.

/usr/sbin/gpt-uninstall is in grid-packaging-tools 3.6.7-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#! /usr/bin/perl


my ($prefix, $globus_prefix, $exec_prefix, $bindir, $sbindir, $libdir);
my ($datarootdir, $datadir, $perlmoduledir, $gptdatadir);
my ($gptexecsharedir, $amdir, $pkg_confdir, $aclocaldir);

if (exists $ENV{GPT_LOCATION})
{
    $prefix = $ENV{GPT_LOCATION};
}
else
{
    $prefix = "/usr";
}

if (exists $ENV{GLOBUS_LOCATION})
{
    $globus_prefix = $ENV{GLOBUS_LOCATION};
}
else
{
    $globus_prefix = "/usr";
}

$exec_prefix = "${prefix}";
$bindir = "${exec_prefix}/bin";
$sbindir = "${exec_prefix}/sbin";
$libdir = "${exec_prefix}/lib";
$datarootdir = "${prefix}/share";
$datadir = "${prefix}/share";
$perlmoduledir = "/usr/share/perl5";
$gptdatadir = "${datadir}/globus/gpt";
$gptexecsharedir = "${datadir}/globus/gpt";
$amdir = "${datadir}/globus/amdir";
$pkg_confdir = "${datadir}/globus/gpt";
$aclocaldir = "${datadir}/globus/aclocal";

unshift(@INC, "${perlmoduledir}");

use Data::Dumper;

use strict;
use Carp;
use Cwd;
use Getopt::Long;
use Config;

#
# Do a perl check for version >= 5.005.
#

if ( ! ( defined eval "require 5.005" ) )
{
    die "GPT requires at least Perl version 5.005";
}

system("$sbindir/gpt_version") == 0
         or die "GPT died due to Version mismatch.  Check PATH and GPT_LOCATION\n" ;


if ( ! ( defined eval "require Grid::GPT::GPTObject" ) )
{
    die("$prefix does not appear to hold a valid GPT installation\n");
}

require Pod::Usage;

my ($noaction, $force, $help, $man, $native, $version, $debug, $verbose,
    $bundle, $location);


GetOptions(
           'help|?'           => \$help,
           'man'              => \$man,
           'force|?'          => \$force,
           'version'          => \$version,
           'debug'          => \$debug,
           'verbose'          => \$verbose,
           'bundles'          => \$bundle,
           'location=s'       => \$location,
           'installdir=s'     => \$location,
           'noaction|n'       => \$noaction,
          )
  or Pod::Usage::pod2usage(0);

Pod::Usage::pod2usage(1) if $help;
Pod::Usage::pod2usage(-verbose => 2) if $man;


require Grid::GPT::GPTIdentity;
Grid::GPT::GPTIdentity::print_gpt_version() if defined $version;

my @inputs = @ARGV;

require Grid::GPT::Algorithms;
require Grid::GPT::PkgMngmt;
require Grid::GPT::Locations;
require Grid::GPT::PkgMngmt::Inform;

my $log = new Grid::GPT::PkgMngmt::Inform(
                                          verbose => $verbose, 
                                          debug => $debug
                                         );


my $locations = new Grid::GPT::Locations(
                                         installdir => $location,
                                        );

my $checks = 
  new Grid::GPT::Algorithms(
                            log => $log,
                            force => $force,
                            locations => $locations,
                            with_filelists => 1,
                           );

my $pkgmngr = new Grid::GPT::PkgMngmt(
                                      log => $log,
                                      locations => $locations,
                                     );

my ($results);

if (defined $bundle) {
  $results = $checks->remove(inputs => \@inputs, bundles => 1);
} else {
  $results = $checks->remove(inputs => \@inputs);
}

if (! defined $results) {
  $locations->cleantmp();
  die $checks->{'error_msg'} if ! defined $results;
}


if (defined $noaction) {

  print "The following bundles would be removed\n" if @{$results->{'bndls'}};

  for my $b (@{$results->{'bndls'}}) {
    print "\t$b->{'Name'} ver: ", $b->version_label(), "\n";
  }

  print "The following packages would be removed\n" if @{$results->{'pkgs'}};

  for my $p (@{$results->{'pkgs'}}) {
    print "\t",$p->label()," ver: ", $p->version_label(), "\n";
  }

  $locations->cleantmp();
  exit 0;
}

if (defined $bundle and ! @{$results->{'bndls'}}) {

  die "ERROR: No bundles were removed\n";

} elsif (! @{$results->{'pkgs'}}) {

  die "ERROR: No packages were removed\n";
}


$pkgmngr->remove(%$results);

$locations->cleantmp();
exit 0;

=head1 NAME

B<gpt-uninstall> - Uninstall any GPT package.

=head1 SYNOPSIS

gpt-uninstall [--force --help -name ] pkgname-flavor-pkgtype

=head1 DESCRIPTION

B<gpt-uninstall> will uninstall a package from the system.  


=head1 OPTIONS

=over 8

=item B<-force> 

This will force actions to take place.

=item B<-native>

Use native package manager (Only works with rpm).

=item B<pkgname-flavor-pkgtype> 

Expression describing the packages that should be removed.

=item B<-help>

Print a brief help message and exits.

=item B<-man>

Prints the manual page and exits.

=item B<-version>

Prints the version of GPT and exits.

=back

=head1 EXAMPLES

  gpt-uninstall -name=foo

removes all flavors and package types with the name "foo".

 gpt-uninstall foo

Also removes all flavors and package types with the name "foo".

  gpt-uninstall 'foo-*-*'

A third way of typing the same uninstall.  Note the single quotes.

  gpt-uninstall '*-noflavor-*'

Remove all of the packages with a 'noflavor' build flavor.

  gpt-uninstall '*-*-*'

Remove all packages.  Note that files generated by gpt-postinstall
will not be removed

=head1 BUGS

Currently the flavor check that gpt-uninstall uses only works if the flavor is installed by gpt-build.  And so for example:

 gpt-uninstall foo-gcc32-*

will B<not> work.  The work around is to uninstall the packages individually using something like:

 gpt-uninstall -name=foo -flavor=gcc32 -pkgtype=pgm

Or use a wild card for the flavor to uninstall all flavors of the package.

 gpt-uninstall foo-*-*


=head1 SEE ALSO

gpt-install(8) gpt-query(8) gpt-verify(8) gpt-postinstall(8)

=head1 AUTHOR

Michael Bletzinger E<lt>mbletzin.ncsa.uiuc.eduE<gt> and Eric Blau
E<lt>eblau.ncsa.uiuc.eduE<gt>

=cut