aboutsummaryrefslogtreecommitdiff
path: root/sboconfig
diff options
context:
space:
mode:
authorJacob Pipkin <d4wnr4z0r@yahoo.com>2012-05-14 23:18:11 -0500
committerJacob Pipkin <d4wnr4z0r@yahoo.com>2012-05-14 23:18:11 -0500
commitce539af98deefc6bc72848cfc0fc0fa82d6c8cb4 (patch)
tree9aa2286d0afdb1e8e954d45eddc5f6ddf063ce15 /sboconfig
parent7d18bbc2cc60c6fdef2a52ca6158eb33e4f26e89 (diff)
downloadsbotools2-ce539af98deefc6bc72848cfc0fc0fa82d6c8cb4.tar.xz
verify -j input, and redo way of getting pkg name to allow for incorrect versions in info files, and because the new way is much more accurate.
Diffstat (limited to 'sboconfig')
-rwxr-xr-xsboconfig17
1 files changed, 7 insertions, 10 deletions
diff --git a/sboconfig b/sboconfig
index af5de7a..583c449 100755
--- a/sboconfig
+++ b/sboconfig
@@ -70,19 +70,16 @@ my %changes;
while (my ($key,$value) = each %valid_confs) {
$changes{$value} = $options{$key} if exists $options{$key};
}
+if (exists $changes{JOBS}) {
+ unless ($changes{JOBS} =~ /^\d+$/) {
+ print "You have provided an invalid parameter for -j\n";
+ exit 1;
+ }
+}
my $conf_dir = $SBO::Lib::conf_dir;;
my $conf_file = $SBO::Lib::conf_file;
-sub make_temp_file {
- make_path ('/tmp/sbotools') unless -d '/tmp/sbotools';
- my $temp_dir = -d '/tmp/sbotools' ? '/tmp/sbotools' : $ENV{TMPDIR} ||
- $ENV{TEMP};
- my $filename = sprintf "%s/%d-%d-0000", $temp_dir, $$, time;
- sysopen my ($fh), $filename, O_WRONLY|O_EXCL|O_CREAT;
- return ($fh,$filename);
-}
-
sub config_write {
script_error ('config_write requires two arguments.') unless exists $_[1];
my ($key,$val) = @_;
@@ -91,7 +88,7 @@ sub config_write {
or print "Unable to create $conf_dir. Exiting.\n" and exit (1);
}
if (-f $conf_file) {
- my ($fh,$filename) = make_temp_file();
+ my ($fh,$filename) = make_temp_file ();
open my $reader, '<', $conf_file;
print {$fh} <$reader>;
close ($fh);