<commit_before>use Grid::GPT::Setup;
use Getopt::Long;

my $name		= 'jobmanager-condor';
my $manager_type	= 'condor';
my $condor_os		= '';
my $condor_arch		= '';
my $c_opts		= '';
my $cmd;

GetOptions('service-name|s=s' => \$name,
	   'help|h' => \$help,
	   'condor-os=s' => \$condor_os,
	   'condor-arch=s' => \$condor_arch);

&usage if $help;

my $metadata =
    new Grid::GPT::Setup(package_name => "globus_gram_job_manager_setup_condor");

my $globusdir	= $ENV{GLOBUS_LOCATION};
my $libexecdir	= "$globusdir/libexec";

mkdir $ENV{GLOBUS_LOCATION} . "/lib/perl/Globus/GRAM/JobManager", 0777;

if($condor_os ne '')
{
    $c_opts = " --with-condor-os=$condor_os";
}
if($condor_arch ne '')
{
    $c_opts .= " --with-condor-arch=$condor_arch";
}

print `./find-condor-tools $c_opts --cache-file=/dev/null`;
if($? != 0)
{
    print STDERR "Error locating condor commands, aborting!\n";
    exit 2;
}

chmod 0755, 'globus-condor-print-config';

my $condor_jm_config = `globus-condor-print-config`;
chomp($condor_jm_config);

# Create service
$cmd = "$libexecdir/globus-job-manager-service -add -m condor -s \"$name\"";
system("$cmd -extra-config='$condor_jm_config' >/dev/null 2>/dev/null");
if($? != 0)
{
    print STDERR "Error creating service entry $name. Aborting!\n";
    exit 3;
}

open(VALIDATION_FILE, ">$ENV{GLOBUS_LOCATION}/share/globus_gram_job_manager/condor.rvf");

print VALIDATION_FILE <<EOF;
Attribute: condorsubmit
Description: "Allow the client to specify abitrary additional attributes to
             be included in the Condor submit description file."
ValidWhen: GLOBUS_GRAM_JOB_SUBMIT
EOF

close VALIDATION_FILE;

$metadata->finish();

sub usage
{
    print "Usage: $0 [options]\n".
          "Options:  [-service-name|-s service_name]\n".
	  "          [-condor-os=CONDOR OS]\n".<commit_msg>fixed bug 701<commit_after>use Grid::GPT::Setup;
use Getopt::Long;

my $name		= 'jobmanager-condor';
my $manager_type	= 'condor';
my $condor_os		= '';
my $condor_arch		= '';
my $c_opts		= '';
my $cmd;

GetOptions('service-name|s=s' => \$name,
	   'help|h' => \$help,
	   'condor-os=s' => \$condor_os,
	   'condor-arch=s' => \$condor_arch);

&usage if $help;

my $metadata =
    new Grid::GPT::Setup(package_name => "globus_gram_job_manager_setup_condor");

my $globusdir	= $ENV{GLOBUS_LOCATION};
my $libexecdir	= "$globusdir/libexec";

mkdir $ENV{GLOBUS_LOCATION} . "/lib/perl/Globus/GRAM/JobManager", 0777;

if($condor_os ne '')
{
    $c_opts = " --with-condor-os=$condor_os";
}
if($condor_arch ne '')
{
    $c_opts .= " --with-condor-arch=$condor_arch";
}

print `./find-condor-tools $c_opts --cache-file=/dev/null`;
if($? != 0)
{
    print STDERR "Error locating condor commands, aborting!\n";
    exit 2;
}

chmod 0755, './globus-condor-print-config';

my $condor_jm_config = `./globus-condor-print-config`;
chomp($condor_jm_config);

# Create service
$cmd = "$libexecdir/globus-job-manager-service -add -m condor -s \"$name\"";
system("$cmd -extra-config='$condor_jm_config' >/dev/null 2>/dev/null");
if($? != 0)
{
    print STDERR "Error creating service entry $name. Aborting!\n";
    exit 3;
}

open(VALIDATION_FILE, ">$ENV{GLOBUS_LOCATION}/share/globus_gram_job_manager/condor.rvf");

print VALIDATION_FILE <<EOF;
Attribute: condorsubmit
Description: "Allow the client to specify abitrary additional attributes to
             be included in the Condor submit description file."
ValidWhen: GLOBUS_GRAM_JOB_SUBMIT
EOF

close VALIDATION_FILE;

$metadata->finish();

sub usage
{
    print "Usage: $0 [options]\n".
          "Options:  [-service-name|-s service_name]\n".
	  "          [-condor-os=CONDOR OS]\n".
{'fraction_non_alphanumeric': 0.17520661157024794, 'fraction_numerical': 0.008539944903581268, 'mean_word_length': 4.106891701828411, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2652174', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1411, 'n_words': 283}